MDL-52828 competencies: Breakdown report
[moodle.git] / report / competency / templates / user_course_navigation.mustache
CommitLineData
fde4592c
DW
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 report_competency/user_course_navigation
19
20 Moodle navigation control allowing to jump to a user or filter to an activity.
21
22 Example context (json):
23 { "hasusers": false, "hasmodules": false}
24}}
27737ae6 25<div class="float-right card p-x-1 p-b-1">
a8007119
DW
26<p>{{{groupselector}}}</p>
27<form class="user-competency-course-navigation">
21e0dd61
DW
28{{#hasusers}}
29<span>
60011d9a 30<label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>
21e0dd61
DW
31<select id="user-nav-{{uniqid}}">
32{{#users}}
33<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{fullname}}</option>
34{{/users}}
35</select>
36</span>
37{{/hasusers}}
27737ae6
DW
38
39{{#hasmodules}}
40<span>
41<label for="module-nav-{{uniqid}}" class="accesshide">{{#str}}filterbyactivity, tool_lp{{/str}}</label>
42<select id="module-nav-{{uniqid}}">
43{{#modules}}
44<option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{name}}</option>
45{{/modules}}
46</select>
47</span>
48{{/hasmodules}}
21e0dd61 49</form>
a8007119 50</div>
21e0dd61
DW
51{{#js}}
52require(['core/form-autocomplete', 'report_competency/user_course_navigation'], function(autocomplete, nav) {
27737ae6 53 (new nav('#user-nav-{{uniqid}}', '#module-nav-{{uniqid}}', '{{baseurl}}', {{userid}}, {{courseid}}, {{moduleid}}));
21e0dd61 54{{#hasusers}}
60011d9a 55 autocomplete.enhance('#user-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptouser, tool_lp{{/ str }}{{/ quote }});
21e0dd61 56{{/hasusers}}
27737ae6
DW
57{{#hasmodules}}
58 autocomplete.enhance('#module-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}filterbyactivity, tool_lp{{/ str }}{{/ quote }});
59{{/hasmodules}}
21e0dd61
DW
60});
61{{/js}}