MDL-58138 completion: rebase on font-awesome changes.
[moodle.git] / course / templates / bulkactivitycompletion.mustache
CommitLineData
0b620801
AG
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/bulkactivitycompletion
19
20 Activity completion selector.
21
22 Example context (json):
23 {
24 "courseid": "2",
25 "sesskey": "AAAAAA",
26 "sections": [{
27 "sectionnumber": "0",
28 "name": "General",
29 "activities": [{
30 "cmid": "4",
31 "modname": "Test activity",
7f53e8aa 32 "icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/feedback/pix/icon.png",
0b620801
AG
33 "completionstatus": {
34 "string": "Manual",
7f53e8aa 35 "icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
0b620801
AG
36 }
37 }]
38 }]
39 }
40}}
41<div class="container-fluid">
42 <div class="row m-b-2">
43 <div class="col">{{#str}}bulkactivitydetail, moodle{{/str}}</div>
44 </div>
06cdda46 45<form method="post" action="editbulkcompletion.php" class="mform" id="theform">
0b620801
AG
46 <div class="row m-b-2">
47 <div class="col">
48 <input type="submit" value="{{#str}}edit{{/str}}" class="btn btn-primary" name="submitbutton" aria-label="{{#str}}updateactivities, completion{{/str}}" />
49 <input type="reset" value="{{#str}}cancel{{/str}}" class="btn btn-secondary" aria-label="{{#str}}resetactivities, completion{{/str}}" />
50 </div>
51 </div>
52 <div class="top-section row m-b-1">
53 <div class="col-sm-6 span6">
54 <input type="checkbox" class="mastercheck m-r-1" aria-label="{{#str}}checkall, completion{{/str}}">
55 <label class="font-weight-bold">{{#str}}activitieslabel, moodle{{/str}}</label>
56 </div>
57 <div class="col-sm-6">
58 <label class="font-weight-bold">{{#str}}completiontracking, moodle{{/str}}</label>
59 <span>{{{helpicon}}}</span>
60 </div>
61 </div>
62 <div class="topics">
0b620801 63 {{#sections}}
0b620801
AG
64 <div class="topic-section m-b-1">
65 <div class="row m-b-1">
66 <div class="col-sm-12">
67 <input type="checkbox" data-section-master="{{sectionnumber}}" class="m-r-1" aria-label="{{#str}}checkallsection, completion, {{name}}{{/str}}">
68 <h3>{{name}}</h3>
69 </div>
70 </div>
71 {{> core_course/activityinstance}}
72 </div>
0b620801 73 {{/sections}}
0b620801
AG
74 </div>
75 <input type="hidden" name="id" value="{{courseid}}" />
76 <input type="hidden" name="sesskey" value="{{sesskey}}" />
77 <div class="row">
78 <div class="col">
79 <input type="submit" value="{{#str}}edit{{/str}}" class="btn btn-primary" name="submitbutton" />
80 <input type="reset" value="{{#str}}cancel{{/str}}" class="btn btn-secondary" />
81 </div>
82 </div>
83</form>
84</div>
85
86{{#js}}
87require([
88 'jquery',
89], function($) {
90 $('.mastercheck').click(function() {
91 var checked = $('.mastercheck').is(':checked');
92 $('input[type=checkbox]').each(function() {
93 $(this).prop('checked', checked);
94 });
95 });
96 var mastersection = $('input[data-section-master]');
97 mastersection.click(function() {
98 var checked = $(this).is(':checked');
99 var dataid = $(this).attr('data-section-master');
100 $('input[type=checkbox][data-section=\'' + dataid + '\']').each(function() {
101 $(this).prop('checked', checked);
102 });
103 });
0b620801
AG
104});
105{{/js}}