MDL-64506 templates: BS2 pull-x -> BS4 float-x
[moodle.git] / admin / tool / lp / templates / user_competency_course_navigation.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 tool_lp/user_competency_course_navigation
20     Show an auto-complete for jumping to competencies in a plan.
22     Context variables required for this template:
23     * groupselector - HTML
24     * hasusers
25     * users - array
26       * id
27       * selected
28       * fullname
29     * hascompetencies
30     * competencies - array
31       * id
32       * selected
33       * shortname
34       * idnumber
36     // No example context because the JS is connected to webservices
37 }}
38 <div class="float-sm-right card card-block">
39 <p>{{{groupselector}}}</p>
40 <form class="user-competency-course-navigation">
41 {{#hasusers}}
42 <span>
43 <label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>
44 <select id="user-nav-{{uniqid}}" class="custom-select">
45 {{#users}}
46 <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{fullname}}</option>
47 {{/users}}
48 </select>
49 </span>
50 {{/hasusers}}
51 <br>
52 {{#hascompetencies}}
53 <span>
54 <label for="competency-nav-{{uniqid}}" class="accesshide">{{#str}}jumptocompetency, tool_lp{{/str}}</label>
55 <select id="competency-nav-{{uniqid}}" class="custom-select">
56 {{#competencies}}
57 <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{{shortname}}} {{idnumber}}</option>
58 {{/competencies}}
59 </select>
60 </span>
61 {{/hascompetencies}}
62 </form>
63 </div>
64 {{#js}}
65 require(['core/form-autocomplete', 'tool_lp/user_competency_course_navigation'], function(autocomplete, nav) {
66     (new nav('#user-nav-{{uniqid}}', '#competency-nav-{{uniqid}}', '{{baseurl}}', {{userid}}, {{competencyid}}, {{courseid}}));
67 {{#hasusers}}
68     autocomplete.enhance('#user-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptouser, tool_lp{{/ str }}{{/ quote }});
69 {{/hasusers}}
70 {{#hascompetencies}}
71     autocomplete.enhance('#competency-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptocompetency, tool_lp{{/ str }}{{/ quote }});
72 {{/hascompetencies}}
74 });
75 {{/js}}