1{{!
2    This file is part of Moodle - http://moodle.org/
3
4    Moodle is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    Moodle is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16}}
17{{!
18    @template mod_forum/local/grades/local/grader/user_picker/user_search
19
20    Classes required for JS:
21    * none
22
23    Data attributes required for JS:
24    * data-action="select-user"
25
26
27    Context variables required for this template:
28    * expandedUsers: Array of users to show, limited to 10
29    * profileimage: Profile image for the user
30    * fullname: User's full name
31    * id: User's ID
32    * hasCollapsed: T/F if there are more users to show
33    * collapsedUsers: Array of users after index 9
34
35    Example context (json):
36    {
37        "expandedUsers": [
38            {
39                "id": 4,
40                "fullname": "Phillip J. Fry",
41                "profileimage": "/pluginfile.php/4/user/icon/boost/f1?rev=58"
42            },
43            {
44                "id": 5,
45                "fullname": "Turanga Leela",
46                "profileimage": "/pluginfile.php/5/user/icon/boost/f1?rev=58"
47            }
48        ],
49        "hasCollapsed": true,
50        "collapsedUsers": [
51            {
52                "id": 14,
53                "fullname": "Bender B. Rodriguez",
54                "profileimage": "/pluginfile.php/14/user/icon/boost/f1?rev=58"
55            }
56        ]
57    }
58}}
59<div class="d-flex flex-column px-3 py-2" data-action="search-user-box">
60    {{#users}}
61        <button
62            class="btn btn-link text-reset p-0 mb-2 d-flex align-items-center"
63            data-action="select-user"
64            data-userid="{{id}}"
65        >
66            {{> mod_forum/local/grades/local/grader/user_picker/user }}
67        </button>
68    {{/users}}
69    {{^users}}
70        <div class="no-search-results-container text-center">
71            {{#pix}} no-search-results, mod_forum {{/pix}}
72            <h5 class="font-weight-bold mt-3">{{#str}}nousersmatch, mod_forum{{/str}}</h5>
73        </div>
74    {{/users}}
75</div>
76