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_course/completion_manual
|
|
|
19 |
|
|
|
20 |
Template for displaying the manual completion button.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"cmid": 0,
|
|
|
25 |
"overallcomplete": true,
|
1441 |
ariadna |
26 |
"overallincomplete": false,
|
|
|
27 |
"normalbutton": true
|
1 |
efrain |
28 |
}
|
|
|
29 |
}}
|
|
|
30 |
{{#istrackeduser}}
|
|
|
31 |
{{#overallcomplete}}
|
1441 |
ariadna |
32 |
<button
|
|
|
33 |
class="btn btn-subtle-success {{^normalbutton}}btn-sm{{/normalbutton}} text-nowrap"
|
|
|
34 |
data-action="toggle-manual-completion"
|
|
|
35 |
data-toggletype="manual:undo"
|
|
|
36 |
data-cmid="{{cmid}}"
|
|
|
37 |
data-activityname="{{activityname}}"
|
|
|
38 |
data-withavailability="{{withavailability}}" {{!
|
|
|
39 |
}}{{#accessibledescription}}{{!
|
|
|
40 |
}}title="{{.}}" {{!
|
|
|
41 |
}}aria-label="{{.}}" {{!
|
|
|
42 |
}}{{/accessibledescription}}{{!
|
|
|
43 |
}}{{^accessibledescription}}{{!
|
|
|
44 |
}}title="{{#str}}completion_manual:aria:done, course, {{activityname}} {{/str}}" {{!
|
|
|
45 |
}}aria-label="{{#str}}completion_manual:aria:done, course, {{activityname}} {{/str}}" {{!
|
|
|
46 |
}}{{/accessibledescription}}
|
|
|
47 |
>
|
1 |
efrain |
48 |
<i class="fa fa-check" aria-hidden="true"></i> {{#str}} completion_manual:done, core_course {{/str}}
|
|
|
49 |
</button>
|
|
|
50 |
{{/overallcomplete}}
|
|
|
51 |
{{#overallincomplete}}
|
1441 |
ariadna |
52 |
<button
|
|
|
53 |
class="btn btn-subtle-body {{^normalbutton}}btn-sm{{/normalbutton}} text-nowrap"
|
|
|
54 |
data-action="toggle-manual-completion"
|
|
|
55 |
data-toggletype="manual:mark-done"
|
|
|
56 |
data-cmid="{{cmid}}"
|
|
|
57 |
data-activityname="{{activityname}}"
|
|
|
58 |
data-withavailability="{{withavailability}}" {{!
|
|
|
59 |
}}{{#accessibledescription}}{{!
|
|
|
60 |
}}title="{{.}}" {{!
|
|
|
61 |
}}aria-label="{{.}}" {{!
|
|
|
62 |
}}{{/accessibledescription}}{{!
|
|
|
63 |
}}{{^accessibledescription}}{{!
|
|
|
64 |
}}title="{{#str}}completion_manual:aria:markdone, course, {{activityname}} {{/str}}" {{!
|
|
|
65 |
}}aria-label="{{#str}}completion_manual:aria:markdone, course, {{activityname}} {{/str}}" {{!
|
|
|
66 |
}}{{/accessibledescription}}
|
|
|
67 |
>
|
1 |
efrain |
68 |
{{#str}} completion_manual:markdone, core_course {{/str}}
|
|
|
69 |
</button>
|
|
|
70 |
{{/overallincomplete}}
|
|
|
71 |
{{/istrackeduser}}
|
|
|
72 |
{{^istrackeduser}}
|
1441 |
ariadna |
73 |
<button
|
|
|
74 |
class="btn btn-subtle-body {{^normalbutton}}btn-sm{{/normalbutton}} text-nowrap"
|
|
|
75 |
disabled
|
|
|
76 |
>
|
1 |
efrain |
77 |
{{#str}} completion_manual:markdone, core_course {{/str}}
|
|
|
78 |
</button>
|
|
|
79 |
{{/istrackeduser}}
|
|
|
80 |
|
|
|
81 |
{{#js}}
|
|
|
82 |
require(['core_course/manual_completion_toggle'], toggle => {
|
1441 |
ariadna |
83 |
toggle.init();
|
1 |
efrain |
84 |
});
|
|
|
85 |
{{/js}}
|