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/resultset
|
|
|
16 |
|
|
|
17 |
Wrapping template for returned result items.
|
|
|
18 |
|
|
|
19 |
Context variables required for this template:
|
|
|
20 |
* instance - The instance ID of the combo box.
|
|
|
21 |
* users - Our returned users to render.
|
|
|
22 |
* found - Count of the found users.
|
|
|
23 |
* total - Total count of users within this report.
|
|
|
24 |
* selectall - Whether to show the select all option.
|
|
|
25 |
* searchterm - The entered text to find these results.
|
|
|
26 |
* hasusers - Allow the handling where no users exist for the returned search term.
|
|
|
27 |
|
|
|
28 |
Example context (json):
|
|
|
29 |
{
|
|
|
30 |
"instance": 25,
|
|
|
31 |
"users": [
|
|
|
32 |
{
|
|
|
33 |
"id": 2,
|
|
|
34 |
"fullname": "Foo bar",
|
|
|
35 |
"profileimageurl": "http://foo.bar/pluginfile.php/79/user/icon/boost/f1?rev=7630",
|
|
|
36 |
"matchingField": "<span class=\"font-weight-bold\">Foo</span> bar",
|
|
|
37 |
"matchingFieldName": "Fullname"
|
|
|
38 |
},
|
|
|
39 |
{
|
|
|
40 |
"id": 3,
|
|
|
41 |
"fullname": "Bar Foo",
|
|
|
42 |
"profileimageurl": "http://foo.bar/pluginfile.php/80/user/icon/boost/f1?rev=7631",
|
|
|
43 |
"matchingField": "Bar <span class=\"font-weight-bold\">Foo</span>",
|
|
|
44 |
"matchingFieldName": "Fullname"
|
|
|
45 |
}
|
|
|
46 |
],
|
|
|
47 |
"matches": 20,
|
|
|
48 |
"selectall": true,
|
|
|
49 |
"searchterm": "Foo",
|
|
|
50 |
"hasresults": true
|
|
|
51 |
}
|
|
|
52 |
}}
|
|
|
53 |
{{<core/local/comboboxsearch/resultset}}
|
|
|
54 |
{{$listid}}user{{/listid}}
|
|
|
55 |
{{$results}}
|
|
|
56 |
{{#users}}
|
|
|
57 |
{{>core_user/comboboxsearch/resultitem}}
|
|
|
58 |
{{/users}}
|
|
|
59 |
{{/results}}
|
|
|
60 |
{{$selectall}}
|
|
|
61 |
{{#selectall}}
|
|
|
62 |
<li
|
|
|
63 |
id="result-row-{{instance}}-0"
|
|
|
64 |
class="w-100 p-1 border-top bottom-0 position-sticky dropdown-item d-flex small p-3"
|
|
|
65 |
role="option"
|
|
|
66 |
{{! The data-short-text attribute is provided so that aria.js would use it rather than the whole content. }}
|
|
|
67 |
data-short-text="{{searchterm}}"
|
|
|
68 |
data-value="0"
|
|
|
69 |
>
|
|
|
70 |
{{#str}}viewallresults, core, {{matches}}{{/str}}
|
|
|
71 |
</li>
|
|
|
72 |
{{/selectall}}
|
|
|
73 |
{{/selectall}}
|
|
|
74 |
{{$listclasses}}mh-100{{/listclasses}}
|
|
|
75 |
{{/core/local/comboboxsearch/resultset}}
|