Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
}}
25
<div class="rui-user-course-nav p-3 mb-5">
26
    {{{groupselector}}}
27
    <form class="user-competency-course-navigation">
28
    <input type="hidden" name="user" value="{{userid}}"/>
29
    <input type="hidden" name="id" value="{{courseid}}"/>
30
    <input type="hidden" name="mod" value="{{moduleid}}"/>
31
    {{#hasusers}}
32
    <span>
33
    <label for="user-nav-{{uniqid}}" class="accesshide">{{#str}}jumptouser, tool_lp{{/str}}</label>
34
    <select id="user-nav-{{uniqid}}">
35
    {{#users}}
36
    <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{fullname}}</option>
37
    {{/users}}
38
    </select>
39
    </span>
40
    {{/hasusers}}
41
 
42
    {{#hasmodules}}
43
    <span>
44
    <label for="module-nav-{{uniqid}}" class="accesshide">{{#str}}filterbyactivity, tool_lp{{/str}}</label>
45
    <select id="module-nav-{{uniqid}}">
46
    {{#modules}}
47
    <option value="{{id}}" {{#selected}}selected="selected"{{/selected}}>{{name}}</option>
48
    {{/modules}}
49
    </select>
50
    </span>
51
    {{/hasmodules}}
52
    </form>
53
</div>
54
{{#js}}
55
require(['core/form-autocomplete', 'report_competency/user_course_navigation'], function(autocomplete, nav) {
56
    (new nav('#user-nav-{{uniqid}}', '#module-nav-{{uniqid}}', '{{baseurl}}', {{userid}}, {{courseid}}, {{moduleid}}));
57
{{#hasusers}}
58
    autocomplete.enhance('#user-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}jumptouser, tool_lp{{/ str }}{{/ quote }});
59
{{/hasusers}}
60
{{#hasmodules}}
61
    autocomplete.enhance('#module-nav-{{uniqid}}', false, false, {{# quote }}{{# str }}filterbyactivity, tool_lp{{/ str }}{{/ quote }});
62
{{/hasmodules}}
63
});
64
{{/js}}