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 core_courseformat/local/courseindex/cm
|
|
|
19 |
|
|
|
20 |
Displays a course index course-module entry.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"id": "12",
|
|
|
25 |
"name": "Announcements",
|
|
|
26 |
"url": "#",
|
|
|
27 |
"visible": 1,
|
|
|
28 |
"isactive": 1,
|
|
|
29 |
"uniqid": "0",
|
|
|
30 |
"accessvisible": 1,
|
|
|
31 |
"hascmrestrictions": 0,
|
|
|
32 |
"indent": 1
|
|
|
33 |
}
|
|
|
34 |
}}
|
|
|
35 |
<li class="courseindex-item
|
|
|
36 |
{{#isactive}}active{{/isactive}}
|
|
|
37 |
{{#hascmrestrictions}}restrictions{{/hascmrestrictions}}
|
|
|
38 |
{{^accessvisible}}dimmed{{/accessvisible}}
|
|
|
39 |
d-flex
|
|
|
40 |
{{#indent}} indented {{/indent}}"
|
|
|
41 |
id="course-index-cm-{{id}}"
|
|
|
42 |
data-for="cm"
|
|
|
43 |
data-id="{{id}}"
|
|
|
44 |
role="treeitem"
|
|
|
45 |
>
|
|
|
46 |
<span class="completioninfo" data-for="cm_completion" data-value="NaN"></span>
|
|
|
47 |
{{#uservisible}}
|
|
|
48 |
<a
|
|
|
49 |
class="courseindex-link"
|
|
|
50 |
{{#url}} href="{{{url}}}" {{/url}}{{^url}} href="#{{{anchor}}}" data-anchor="true" {{/url}}
|
|
|
51 |
data-for="cm_name"
|
|
|
52 |
tabindex="-1"
|
|
|
53 |
>
|
|
|
54 |
{{{name}}}
|
|
|
55 |
</a>
|
|
|
56 |
{{/uservisible}}
|
|
|
57 |
{{^uservisible}}
|
|
|
58 |
<a class="courseindex-link" href="#{{{anchor}}}" data-for="cm_name" tabindex="-1" data-anchor="true">
|
|
|
59 |
{{{name}}}
|
|
|
60 |
</a>
|
|
|
61 |
{{/uservisible}}
|
|
|
62 |
<span class="courseindex-locked ml-1" data-for="cm_name">
|
|
|
63 |
{{#pix}} t/locked, core {{/pix}}
|
|
|
64 |
</span>
|
|
|
65 |
<span class="dragicon ml-auto">{{#pix}}i/dragdrop{{/pix}}</span>
|
|
|
66 |
</li>
|
|
|
67 |
{{#js}}
|
|
|
68 |
require(['core_courseformat/local/courseindex/cm'], function(component) {
|
|
|
69 |
component.init('course-index-cm-{{id}}');
|
|
|
70 |
});
|
|
|
71 |
{{/js}}
|