MDL-68169 user: Limit the number of filter conditions
[moodle.git] / user / templates / local / participantsfilter / filterrow.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/filterrow
20     Template for use by each filter condition.
22     Context variables required for this template:
23       * filtertypes - Array of filter types available.
25     Example context (json):
26     {
27         "filtertypes": [
28             {
29                 "name": "status",
30                 "title": "Status"
31             }
32         ]
33     }
34 }}
35 <div data-filterregion="filter">
36     <div class="rounded mb-3 p-2 bg-white border border-secondary d-flex align-items-center">
37         <label for="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}" class="pt-2">{{#str}}match, core_user{{/str}}</label>
38         <select class="custom-select" data-filterfield="join" id="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}">
39             <option value="0">{{#str}}none{{/str}}</option>
40             <option selected=selected value="1">{{#str}}any{{/str}}</option>
41             <option value="2">{{#str}}all{{/str}}</option>
42         </select>
44         <label class="sr-only pt-2" for="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">filtertype</label>
45         <select class="custom-select" data-filterfield="type" id="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">
46             <option value="">{{#str}}selectfiltertype, core_user{{/str}}</option>
47             {{#filtertypes}}
48             <option value="{{name}}">{{title}}</option>
49             {{/filtertypes}}
50         </select>
52         <div data-filterregion="value"></div>
54         <button data-filteraction="remove" class="ml-auto btn btn-link text-reset" aria-label="{{#str}}clearfilterrow, core_user{{/str}}">
55             <i class="icon fa fa-times-circle pt-2"></i>
56         </button>
57     </div>
58     <div data-filterregion="joinadverb">
59         <div data-filterverbfor="0">{{#str}}adverbfor_andnot, core_user{{/str}}</div>
60         <div data-filterverbfor="1">{{#str}}adverbfor_or, core_user{{/str}}</div>
61         <div data-filterverbfor="2">{{#str}}adverbfor_and, core_user{{/str}}</div>
62     </div>
63 </div>