Merge branch 'MDL-80259-main' of https://github.com/roland04/moodle
[moodle.git] / course / format / templates / local / content / section / content.mustache
blobeebf34008900eddd765109668ea58dfb3f523185
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/>.
17 {{!
18     @template core_courseformat/local/content/section/content
20     The internal content of a section.
22     Example context (json):
23     {
24         "num": 3,
25         "id": 35,
26         "controlmenu": "[tools menu]",
27         "header": {
28             "name": "Section title",
29             "title": "<a href=\"http://moodle/course/view.php?id=5#section-0\">Section title</a>",
30             "url": "#",
31             "ishidden": true
32         },
33         "cmlist": {
34             "cms": [
35                 {
36                     "cmitem": {
37                         "cmformat": {
38                             "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Forum example</span></a>",
39                             "hasname": "true"
40                         },
41                         "id": 3,
42                         "cmid": 3,
43                         "module": "forum",
44                         "anchor": "activity-3",
45                         "extraclasses": "newmessages"
46                     }
47                 },
48                 {
49                     "cmitem": {
50                         "cmformat": {
51                             "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Assign example</span></a>",
52                             "hasname": "true"
53                         },
54                         "id": 4,
55                         "cmid": 4,
56                         "anchor": "activity-4",
57                         "module": "assign",
58                         "extraclasses": ""
59                     }
60                 }
61             ],
62             "hascms": true
63         },
64         "ishidden": false,
65         "iscurrent": true,
66         "currentlink": "<span class=\"accesshide\">This topic</span>",
67         "availability": {
68             "info": "<span class=\"badge bg-info\">Hidden from students</span>",
69             "hasavailability": true
70         },
71         "summary": {
72             "summarytext": "Summary text!"
73         },
74         "controlmenu": {
75             "menu": "<a href=\"#\" class=\"d-inline-block dropdown-toggle icon-no-margin\">Edit<b class=\"caret\"></b></a>",
76             "hasmenu": true
77         },
78         "cmcontrols": "[Add an activity or resource]",
79         "iscoursedisplaymultipage": true,
80         "sectionreturnid": 0,
81         "contentcollapsed": false,
82         "insertafter": true,
83         "numsections": 42,
84         "sitehome": false,
85         "highlightedlabel" : "Highlighted"
86     }
88 {{#singleheader}}
89 {{$ core_courseformat/local/content/section/header }}
90     {{> core_courseformat/local/content/section/header }}
91 {{/ core_courseformat/local/content/section/header }}
92 {{/singleheader}}
93 {{#header}}
94 {{$ core_courseformat/local/content/section/header }}
95     {{> core_courseformat/local/content/section/header }}
96 {{/ core_courseformat/local/content/section/header }}
97 {{/header}}
98 {{#restrictionlock}}
99     <div class="align-self-center ml-2">
100         {{#pix}}t/unlock, core{{/pix}}
101     </div>
102 {{/restrictionlock}}
103 <div data-region="sectionbadges" class="sectionbadges d-flex align-items-center">
104     {{$ core_courseformat/local/content/section/badges }}
105         {{> core_courseformat/local/content/section/badges }}
106     {{/ core_courseformat/local/content/section/badges }}
107 </div>
108 {{#collapsemenu}}
109     {{^displayonesection}}
110     <div class="flex-fill d-flex justify-content-end mr-2 align-self-start mt-2">
111         <a
112             id="collapsesections"
113             class="section-collapsemenu"
114             href="#"
115             aria-expanded="true"
116             role="button"
117             data-toggle="toggleall"
118         >
119             <span class="collapseall text-nowrap">{{#str}}collapseall{{/str}}</span>
120             <span class="expandall text-nowrap">{{#str}}expandall{{/str}}</span>
121         </a>
122     </div>
123     {{/displayonesection}}
124 {{/collapsemenu}}
125 {{#controlmenu}}
126     {{$ core_courseformat/local/content/section/controlmenu }}
127         {{> core_courseformat/local/content/section/controlmenu }}
128     {{/ core_courseformat/local/content/section/controlmenu }}
129 {{/controlmenu}}
130 {{#header}}
131     {{#headerdisplaymultipage}}
132         {{^controlmenu}}
133             <div class="section_goto bulk-hidden ml-auto" data-sectionid="{{id}}">
134                 <a href="{{{url}}}"
135                    class="btn btn-icon d-flex align-items-center justify-content-center icon-no-margin"
136                    title="{{#str}}gotosection, course, {{name}}{{/str}}">
137                         <span class="dir-rtl-hide">
138                             {{#pix}}t/right, moodle{{/pix}}
139                         </span>
140                         <span class="dir-ltr-hide">
141                             {{#pix}}t/left, moodle, {{#str}}gotosection, course, {{name}}{{/str}}{{/pix}}
142                         </span>
143                         <span class="sr-only">
144                             {{#str}}gotosection, course, {{name}}{{/str}}
145                         </span>
146                 </a>
147             </div>
148         {{/controlmenu}}
149     {{/headerdisplaymultipage}}
150 {{/header}}
151 </div>
152 <div id="coursecontentcollapse{{num}}"
153     class="content {{^iscoursedisplaymultipage}}{{^sitehome}}{{^displayonesection}}course-content-item-content collapse {{^contentcollapsed}}show{{/contentcollapsed}}{{/displayonesection}}{{/sitehome}}{{/iscoursedisplaymultipage}}">
154     <div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo">
155     {{#summary}}
156         {{$ core_courseformat/local/content/section/summary }}
157             {{> core_courseformat/local/content/section/summary }}
158         {{/ core_courseformat/local/content/section/summary }}
159     {{/summary}}
160     {{#availability}}
161         {{$ core_courseformat/local/content/section/availability }}
162             {{> core_courseformat/local/content/section/availability }}
163         {{/ core_courseformat/local/content/section/availability }}
164     {{/availability}}
165 </div>
166 {{#cmsummary}}
167     {{$ core_courseformat/local/content/section/cmsummary }}
168         {{> core_courseformat/local/content/section/cmsummary }}
169     {{/ core_courseformat/local/content/section/cmsummary }}
170 {{/cmsummary}}
171 {{#cmlist}}
172     {{$ core_courseformat/local/content/section/cmlist }}
173         {{> core_courseformat/local/content/section/cmlist }}
174     {{/ core_courseformat/local/content/section/cmlist }}
175 {{/cmlist}}
176 {{{cmcontrols}}}
177 {{#insertafter}}
178     {{#numsections}}
179         {{$ core_courseformat/local/content/addsection}}
180             {{> core_courseformat/local/content/addsection}}
181         {{/ core_courseformat/local/content/addsection}}
182     {{/numsections}}
183 {{/insertafter}}