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 |
|
|
|
26 |
Example context (json):
|
|
|
27 |
{
|
|
|
28 |
"id": 2,
|
|
|
29 |
"fullname": "Foo bar",
|
|
|
30 |
"profileimageurl": "http://foo.bar/pluginfile.php/79/user/icon/boost/f1?rev=7630",
|
|
|
31 |
"matchingField": "<span class=\"font-weight-bold\">Foo</span> bar",
|
|
|
32 |
"matchingFieldName": "Fullname"
|
|
|
33 |
}
|
|
|
34 |
}}
|
|
|
35 |
{{<core/local/comboboxsearch/resultitem }}
|
|
|
36 |
{{$arialabel}}{{fullname}}{{/arialabel}}
|
|
|
37 |
{{$shorttext}}{{fullname}}{{/shorttext}}
|
|
|
38 |
{{$content}}
|
|
|
39 |
<span class="d-block px-2 w-25">
|
|
|
40 |
{{#profileimageurl}}
|
|
|
41 |
<img class="userpicture w-100 mx-auto d-block" src="{{profileimageurl}}" alt=""/>
|
|
|
42 |
{{/profileimageurl}}
|
|
|
43 |
{{^profileimageurl}}
|
|
|
44 |
<span class="userinitials"></span>
|
|
|
45 |
{{/profileimageurl}}
|
|
|
46 |
</span>
|
|
|
47 |
<span class="d-block pr-3 w-75">
|
|
|
48 |
<span class="d-block w-100 p-0 text-truncate font-weight-bold">
|
|
|
49 |
{{fullname}}
|
|
|
50 |
</span>
|
|
|
51 |
<span class="d-block w-100 pull-left text-truncate small" aria-hidden="true">
|
|
|
52 |
{{{matchingField}}}
|
|
|
53 |
</span>
|
|
|
54 |
<span class="sr-only" aria-label="{{#str}}usermatchedon, core{{/str}}">{{matchingFieldName}}</span>
|
|
|
55 |
</span>
|
|
|
56 |
{{/content}}
|
|
|
57 |
{{/core/local/comboboxsearch/resultitem}}
|