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/>.
18 @template core_courseformat/local/courseindex/cm
20 Displays a course index course-module entry.
22 Example context (json):
25 "name": "Announcements",
31 "hascmrestrictions": 0
34 <li class="courseindex-item
35 {{#isactive}}active{{/isactive}}
36 {{#hascmrestrictions}}restrictions{{/hascmrestrictions}}
37 {{^accessvisible}}dimmed{{/accessvisible}}
38 {{#url}} d-flex {{/url}} {{^url}} d-flex-noedit {{/url}}"
39 id="{{uniqid}}-course-index-cm-{{id}}"
44 <span class="completioninfo" data-for="cm_completion" data-value="NaN"></span>
47 <a class="courseindex-link text-truncate" href="{{{url}}}" data-for="cm_name" tabindex="-1">
52 <a class="courseindex-link text-truncate" href="#{{{anchor}}}" data-for="cm_name" tabindex="-1" data-anchor="true">
58 <span class="courseindex-name text-truncate" data-for="cm_name">
62 <span class="courseindex-locked ml-1" data-for="cm_name">
63 {{#pix}} t/locked, core {{/pix}}
65 <span class="dragicon ml-auto">{{#pix}}i/dragdrop{{/pix}}</span>
68 require(['core_courseformat/local/courseindex/cm'], function(component) {
69 component.init('{{uniqid}}-course-index-cm-{{id}}');