912 |
ariadna |
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 |
{{!
|
918 |
ariadna |
18 |
@template theme_universe_child/courseindex/section
|
912 |
ariadna |
19 |
|
|
|
20 |
Displays a course index section entry.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"title": "General",
|
|
|
25 |
"id": 23,
|
|
|
26 |
"uniqid": "0",
|
|
|
27 |
"number": 1,
|
|
|
28 |
"sectionurl": "#",
|
|
|
29 |
"indexcollapsed": 0,
|
|
|
30 |
"current": 1,
|
|
|
31 |
"visible": 1,
|
|
|
32 |
"hasrestrictions": 0,
|
|
|
33 |
"cms": [
|
|
|
34 |
{
|
|
|
35 |
"id": 10,
|
|
|
36 |
"name": "Glossary of characters",
|
|
|
37 |
"url": "#",
|
|
|
38 |
"visible": 1,
|
|
|
39 |
"isactive": 0
|
|
|
40 |
},
|
|
|
41 |
{
|
|
|
42 |
"id": 11,
|
|
|
43 |
"name": "World Cinema forum",
|
|
|
44 |
"url": "#",
|
|
|
45 |
"visible": 1,
|
|
|
46 |
"isactive": 0
|
|
|
47 |
},
|
|
|
48 |
{
|
|
|
49 |
"id": 12,
|
|
|
50 |
"name": "Announcements",
|
|
|
51 |
"url": "#",
|
|
|
52 |
"visible": 0,
|
|
|
53 |
"isactive": 1
|
|
|
54 |
}
|
|
|
55 |
]
|
|
|
56 |
}
|
|
|
57 |
}}
|
|
|
58 |
<div
|
|
|
59 |
class="courseindex-section {{#current}}current{{/current}}"
|
|
|
60 |
id="course-index-section-{{id}}"
|
|
|
61 |
data-for="section"
|
|
|
62 |
data-id="{{id}}"
|
|
|
63 |
data-number="{{number}}"
|
|
|
64 |
role="treeitem"
|
|
|
65 |
aria-owns="courseindexcollapse{{number}}"
|
|
|
66 |
>
|
|
|
67 |
<div class="courseindex-item d-flex
|
|
|
68 |
{{^visible}}dimmed{{/visible}}
|
|
|
69 |
{{#hasrestrictions}}restrictions{{/hasrestrictions}}
|
|
|
70 |
courseindex-section-title"
|
|
|
71 |
id="courseindexsection{{number}}"
|
|
|
72 |
data-for="section_item"
|
|
|
73 |
>
|
1192 |
ariadna |
74 |
<button
|
|
|
75 |
type="button"
|
|
|
76 |
data-toggle="collapse"
|
|
|
77 |
data-target="#courseindexcollapse{{number}}"
|
1194 |
ariadna |
78 |
class="btn btn-text courseindex-chevron icons-collapse-expand {{#indexcollapsed}}collapsed{{/indexcollapsed}}"
|
912 |
ariadna |
79 |
aria-expanded="{{^indexcollapsed}}true{{/indexcollapsed}}{{#indexcollapsed}}false{{/indexcollapsed}}"
|
|
|
80 |
aria-controls="courseindexcollapse{{number}}"
|
|
|
81 |
tabindex="-1"
|
|
|
82 |
>
|
|
|
83 |
<span class="collapsed-icon icon-no-margin mr-1"
|
|
|
84 |
title="{{#str}} expand, core {{/str}}">
|
|
|
85 |
<span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
|
|
|
86 |
<span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
|
|
|
87 |
<span class="sr-only">{{#str}} expand, core {{/str}}</span>
|
|
|
88 |
</span>
|
|
|
89 |
<span class="expanded-icon icon-no-margin mr-1"
|
|
|
90 |
title="{{#str}} collapse, core {{/str}}">
|
|
|
91 |
{{#pix}} t/expandedchevron, core {{/pix}}
|
|
|
92 |
<span class="sr-only">{{#str}} collapse, core {{/str}}</span>
|
|
|
93 |
</span>
|
1192 |
ariadna |
94 |
</button>
|
|
|
95 |
<button
|
|
|
96 |
type="button"
|
|
|
97 |
data-toggle="collapse"
|
|
|
98 |
data-target="#courseindexcollapse{{number}}"
|
1194 |
ariadna |
99 |
class="btn btn-text courseindex-link text-truncate"
|
912 |
ariadna |
100 |
data-action="togglecourseindexsection"
|
|
|
101 |
data-for="section_title"
|
1192 |
ariadna |
102 |
aria-expanded="{{^indexcollapsed}}true{{/indexcollapsed}}{{#indexcollapsed}}false{{/indexcollapsed}}"
|
|
|
103 |
aria-controls="courseindexcollapse{{number}}"
|
912 |
ariadna |
104 |
tabindex="-1"
|
|
|
105 |
>
|
|
|
106 |
{{{title}}}
|
1192 |
ariadna |
107 |
</button>
|
912 |
ariadna |
108 |
<span class="current-badge badge bg-primary text-white ml-2 px-2 rounded-pill">
|
|
|
109 |
{{highlighted}}
|
|
|
110 |
</span>
|
|
|
111 |
<span class="courseindex-locked ml-1" data-for="cm_name">
|
|
|
112 |
{{#pix}} t/locked, core {{/pix}}
|
|
|
113 |
</span>
|
|
|
114 |
<span class="dragicon ml-auto">{{#pix}}i/dragdrop{{/pix}}</span>
|
|
|
115 |
</div>
|
|
|
116 |
<div id="courseindexcollapse{{number}}"
|
|
|
117 |
class="courseindex-item-content collapse {{^indexcollapsed}}show{{/indexcollapsed}}"
|
|
|
118 |
aria-labelledby="courseindexsection{{number}}" role="group"
|
|
|
119 |
>
|
|
|
120 |
<ul class="courseindex-sectioncontent unlist" data-for="cmlist" data-id="{{id}}" role="group">
|
|
|
121 |
{{#cms}}
|
914 |
ariadna |
122 |
{{> theme_universe_child/courseindex/cm }}
|
912 |
ariadna |
123 |
{{/cms}}
|
|
|
124 |
</ul>
|
|
|
125 |
</div>
|
|
|
126 |
</div>
|
|
|
127 |
{{#js}}
|
918 |
ariadna |
128 |
require(['core_courseformat/local/courseindex/section'], function(component) {
|
912 |
ariadna |
129 |
component.init('course-index-section-{{id}}');
|
|
|
130 |
});
|
|
|
131 |
{{/js}}
|