MDL-67917 user: Add skeleton for new participants filter
[moodle.git] / user / templates / local / participantsfilter / filtertypes.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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 core_user/local/participantsfilter/filtertypes
20     Placeholder to fetch all filter types.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * data-filterregion="filtertypedata"
28     Context variables required for this template:
29     * filtertypes
31     Example context (json):
32     {
33         "filtertypes": [
34             {
35                 "name": "status",
36                 "title": "Enrolment Status",
37                 "allowcustom": "0",
38                 "values": [
39                     {
40                         "value": "0",
41                         "title": "Inactive"
42                     },
43                     {
44                         "value": "1",
45                         "title": "Active"
46                     }
47                 ]
48             }
49         ]
50     }
51 }}
52 <div class="hidden" data-filterregion="filtertypedata">
53     {{#filtertypes}}
54         {{> core_user/local/participantsfilter/filtertype}}
55     {{/filtertypes}}
56 </div>
57 <div class="hidden">
58     <select disabled="disabled" data-filterfield="type" data-filterregion="filtertypelist">
59         <option value="">{{#str}}selectfiltertype, core_user{{/str}}</option>
60         {{#filtertypes}}
61         <option value="{{name}}">{{title}}</option>
62         {{/filtertypes}}
63     </select>
64 </div>