MDL-58140 completion: Added bulk activity completion page.
[moodle.git] / course / templates / activityinstance.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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/activityinstance
20     Activity completion selector.
22     Example context (json):
23     {
24         "activities": [{
25             "cmid": "4",
26             "modname": "Test activity",
27             "icon": {
28                 "attributes": [
29                     {"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
30                     {"name": "alt", "value": "Activity icon"}
31                 ]
32             },
33             "completionstatus": {
34                 "string": "Manual",
35                 "icon": {
36                     "attributes": [
37                         {"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
38                         {"name": "alt", "value": "Completion icon"}
39                     ]
40                 }
41             }
42         }]
43     }
44 }}
45 {{#activities}}
46 <div class="row m-b-1">
47     <div class="activityinstance col-sm-6 span6">
48         <div class="mod-indent-outer"></div>
49         <div>
50                 <input type="checkbox" class="m-r-1" name="cmid[]" data-section="{{sectionnumber}}" value="{{cmid}}" aria-label="{{#str}}checkactivity, completion, {{modname}}{{/str}}">
51                 <a href={{url}}>
52                 <img src="{{icon}}" class="iconlarge activityicon" alt=" " role="presentation" />
53                 <span class="instancename">{{modname}}</span>
54                 </a>
55         </div>
56     </div>
57     <div class="activity-completionstatus col-sm-6">
58         <div class="col-sm-1">
59             {{#completionstatus.icon}}
60                 <img src="{{completionstatus.icon}}" class="m-r-2">
61             {{/completionstatus.icon}}
62             {{^completionstatus.icon}}
63                 <span class="m-r-3"></span>
64             {{/completionstatus.icon}}
65         </div>
66         <div class="col-sm-11">
67             <span class="text-muted muted">{{{completionstatus.string}}}</span>
68         </div>
69     </div>
70 </div>
71 {{/activities}}