MDL-67883 core: Make core ready for MoodleNet.
[moodle.git] / course / templates / activity_list.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/activity_list
20     Displays a list of activities to recommend in the activity chooser.
22     No example given as the js will fire and create records from the template library page.
23 }}
24 {{#search}}
25     <form class="row">
26         <div class="input-group pt-4 pb-1 col-md-6">
27             <label for="search">
28                 <span class="sr-only">{{#str}} searchactivitiesbyname, course {{/str}}</span>
29             </label>
30             <input type="text" name="search" id="search" class="form-control rounded-left" autocomplete="off"
31                    placeholder="{{#str}}search, core {{/str}}" {{#query}} value="{{query}}" autofocus {{/query}}
32             >
33             <div class="input-group-append">
34                 <button type="submit" class="btn btn-outline-secondary rounded-right" type="button">
35                     <i class="icon fa fa-search fa-fw m-0" aria-hidden="true"></i>
36                     <span class="sr-only">{{#str}}submitsearch, course {{/str}}</span>
37                 </button>
38           </div>
39         </div>
40     </form>
41     {{#query}}
42         <div class="pt-1 pb-1">
43             <span role="alert">{{#str}} searchresults, course, {{searchresultsnumber}} {{/str}}</span>
44         </div>
45     {{/query}}
46 {{/search}}
47 {{#categories}}
48     {{#hascategorydata}}
49         <h3 class="pt-4">{{categoryname}}</h3>
50         <table class="table table-striped table-hover">
51             <thead>
52                 <tr class="d-flex">
53                     <th scope="col" class="col-7 c0">{{#str}}module, course{{/str}}</th>
54                     <th scope="col" class="col-5 c1">{{#str}}recommend, course{{/str}}</th>
55                 </tr>
56             </thead>
57             <tbody>
58                 {{#categorydata}}
59                 <tr class="d-flex">
60                     <td class="col-7 c0"><span>{{{icon}}}</span>{{name}}</td>
61                     {{#id}}
62                     <td class="col-5 c1 colselect">
63                     <input class="activity-recommend-checkbox" type="checkbox" aria-label="{{#str}}recommendcheckbox, course, {{name}}{{/str}}" data-area="{{componentname}}" data-id="{{id}}" {{#recommended}}checked="checked"{{/recommended}}  />
64                     </td>
65                     {{/id}}
66                     {{^id}}
67                     <td class="col-5"></td>
68                     {{/id}}
69                 </tr>
70                 {{/categorydata}}
71             </tbody>
72         </table>
73     {{/hascategorydata}}
74 {{/categories}}
75 {{#js}}
76 require([
77     'core_course/recommendations',
78 ], function(Recommendations) {
79     Recommendations.init();
80 });
81 {{/js}}