Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
    Moodle is free software: you can redistribute it and/or modify
4
    it under the terms of the GNU General Public License as published by
5
    the Free Software Foundation, either version 3 of the License, or
6
    (at your option) any later version.
7
    Moodle is distributed in the hope that it will be useful,
8
    but WITHOUT ANY WARRANTY; without even the implied warranty of
9
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
    GNU General Public License for more details.
11
    You should have received a copy of the GNU General Public License
12
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
13
}}
14
{{!
15
    @template core_user/comboboxsearch/resultitem
16
 
17
    Template for the individual result item.
18
 
19
    Context variables required for this template:
20
    * id - User system ID.
21
    * fullname - Users' full name.
22
    * profileimageurl - Link for the users' large profile image.
23
    * matchingField - The field in the user object that matched the search criteria.
24
    * matchingFieldName - The name of the field that was matched upon for A11y purposes.
25
    * link - The link used to redirect upon self to show only this specific user.
26
 
27
    Example context (json):
28
    {
29
        "id": 2,
30
        "fullname": "Foo bar",
31
        "profileimageurl": "http://foo.bar/pluginfile.php/79/user/icon/boost/f1?rev=7630",
32
        "matchingField": "<span class=\"font-weight-bold\">Foo</span> bar",
33
        "matchingFieldName": "Fullname",
34
        "link": "http://foo.bar/grade/report/grader/index.php?id=42&userid=2"
35
    }
36
}}
37
{{<core/local/comboboxsearch/resultitem }}
38
    {{$arialabel}}{{#str}}viewresults, core, {{fullname}}{{/str}}{{/arialabel}}
39
    {{$content}}
40
        <div class="d-flex flex-wrap align-items-center p-1 px-2">
41
            <span>
42
                {{#profileimageurl}}
43
                    <img class="userpicture w-100 mx-auto d-block" src="{{profileimageurl}}" alt=""/>
44
                {{/profileimageurl}}
45
                {{^profileimageurl}}
46
                    <span class="userinitials"></span>
47
                {{/profileimageurl}}
48
            </span>
49
            <span class="ml-3">
50
                <span class="d-block w-100 p-0 text-truncate font-weight-bold">
51
                    {{fullname}}
52
                </span>
53
                <span class="d-block text-truncate small" aria-hidden="true" style="width: 200px; opacity: .6;">
54
                    {{{matchingField}}}
55
                </span>
56
                <span class="sr-only" aria-label="{{#str}}usermatchedon, core{{/str}}">{{matchingFieldName}}</span>
57
            </span>
58
        </div>
59
    {{/content}}
60
{{/core/local/comboboxsearch/resultitem}}