forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
defaultactivitycompletion.mustache
88 lines (80 loc) · 3.93 KB
/
defaultactivitycompletion.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template core_course/defaultactivitycompletion
Activity completion selector.
Example context (json):
{
"courseid": "2",
"sesskey": "AAAAAA",
"modules": [{
"id": "10",
"formattedname": "Assignment",
"canmanage": true,
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.svg",
"completionstatus": {
"string": "Manual",
"icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
}
}],
"issite": true
}
}}
<div class="container-fluid">
<div class="row my-5 defaultactivitycompletion-header">
<div class="col">
{{#issite}}{{#str}}defaultactivitycompletionsite, core_completion{{/str}}{{/issite}}
{{^issite}}{{#str}}defaultactivitycompletioncourse, core_completion{{/str}}{{/issite}}
</div>
</div>
<div class="modules pt-3">
{{#modules}}
{{#canmanage}}
<div class="defaultactivitycompletion-item d-flex"
id="activitycompletion-{{id}}"
>
<a data-toggle="collapse"
href="#activitycompletioncollapse-{{id}}"
class="icons-collapse-expand {{#modulecollapsed}}collapsed{{/modulecollapsed}}"
aria-expanded="{{^modulecollapsed}}true{{/modulecollapsed}}{{#modulecollapsed}}false{{/modulecollapsed}}"
role="button"
>
<span class="collapsed-icon icon-no-margin me-1"
title="{{#str}} expandcategory, core, {{formattedname}} {{/str}}">
<span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
<span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
<span class="sr-only">{{#str}} expandcategory, core, {{formattedname}} {{/str}}</span>
</span>
<span class="expanded-icon icon-no-margin me-1"
title="{{#str}} collapsecategory, core, {{formattedname}} {{/str}}">
{{#pix}} t/expandedchevron, core {{/pix}}
<span class="sr-only">{{#str}} collapsecategory, core, {{formatedname}} {{/str}}</span>
</span>
<img class="activityicon ms-4" src="{{icon}}" alt="" aria-hidden="true">
<h2 class="activityname ms-3 mb-0">{{{formattedname}}}</h2>
</a>
</div>
<div id="activitycompletioncollapse-{{id}}"
class="defaultactivitycompletion-item-content collapse multi-collapse {{^modulecollapsed}}show{{/modulecollapsed}}"
aria-labelledby="activitycompletion-{{id}}" role="group"
data-region="activitycompletion-{{name}}"
>
<hr class="row">
<div class="py-3">{{{formhtml}}}</div>
</div>
<hr class="row">
{{/canmanage}}
{{/modules}}
</div>
</div>