MDL-68612 user: Participants filter row accessibility improvements
[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         "rownumber": 1
34     }
35 }}
36 <div data-filterregion="filter">
37     <fieldset>
38         <legend class="sr-only">{{#str}}filterrowlegend, core_user, {{rownumber}}{{/str}}</legend>
39         <div class="border-radius my-2 p-2 bg-white border d-flex flex-column flex-md-row align-items-md-start">
40             <div class="d-flex flex-column flex-md-row align-items-md-center">
41                 <label for="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}" class="mr-md-2 mb-md-0">{{#str}}match, core_user{{/str}}</label>
42                 <select class="custom-select mb-1 mb-md-0 mr-md-2" data-filterfield="join" id="core_user-local-participantsfilter-filterrow-jointype-{{uniqid}}">
43                     <option value="0">{{#str}}none{{/str}}</option>
44                     <option selected=selected value="1">{{#str}}any{{/str}}</option>
45                     <option value="2">{{#str}}all{{/str}}</option>
46                 </select>
47             </div>
49             <label class="sr-only pt-2" for="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">filtertype</label>
50             <select class="custom-select mb-1 mb-md-0 mr-md-2" data-filterfield="type" id="core_user-local-participantsfilter-filterrow-filtertype-{{uniqid}}">
51                 <option value="">{{#str}}selectfiltertype, core_user{{/str}}</option>
52                 {{#filtertypes}}
53                 <option value="{{name}}">{{title}}</option>
54                 {{/filtertypes}}
55             </select>
57             <div data-filterregion="value" class="d-md-flex flex-column align-items-start flex-lg-row"></div>
59             <button data-filteraction="remove" class="ml-auto icon-no-margin icon-size-4 btn text-reset" aria-label="{{#str}}clearfilterrow, core_user{{/str}}">
60                 <i class="icon fa fa-times-circle"></i>
61             </button>
62         </div>
63         <div data-filterregion="joinadverb" class="pl-1 text-uppercase font-weight-bold">
64             <div data-filterverbfor="0">{{#str}}adverbfor_andnot, core_user{{/str}}</div>
65             <div data-filterverbfor="1">{{#str}}adverbfor_or, core_user{{/str}}</div>
66             <div data-filterverbfor="2">{{#str}}adverbfor_and, core_user{{/str}}</div>
67         </div>
68     </fieldset>
69 </div>