Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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
    Context variables required for this template:
19
    * sitename - The name of the site
20
    * output - The core renderer for the page
21
    * bodyattributes - attributes for the body tag as a string of html attributes
22
    * sidepreblocks - HTML for the blocks
23
    * hasblocks - true if there are blocks on this page
24
    * navdraweropen - true if the nav drawer should be open on page load
25
    * regionmainsettingsmenu - HTML for the region main settings menu
26
    * hasregionmainsettingsmenu - There is a region main settings menu on this page.
27
 
28
    Example context (json):
29
    {
30
        "sitename": "Moodle",
31
        "output": {
32
            "doctype": "<!DOCTYPE html>",
33
            "page_title": "Test page",
34
            "favicon": "favicon.ico",
35
            "main_content": "<h1>Headings make html validators happier</h1>"
36
         },
37
        "bodyattributes":"",
38
        "sidepreblocks": "<h2>Blocks html goes here</h2>",
39
        "hasblocks":true,
40
        "navdraweropen":true,
41
        "regionmainsettingsmenu": "",
42
        "hasregionmainsettingsmenu": false
43
    }
44
}}
45
{{> theme_monocolor/head }}
46
 
47
<body {{{ bodyattributes }}}>
48
 
49
    {{> core/local/toast/wrapper}}
50
 
51
    <div id="page-wrapper" class="d-print-block {{#output.courseheadermenu}}rui--course-with-nav{{/output.courseheadermenu}} {{^output.courseheadermenu}}rui--course-witout-nav{{/output.courseheadermenu}}">
52
 
53
        {{{ output.standard_top_of_body_html }}}
54
        {{^hidecourseindexnav}}
55
        {{#courseindex}}
56
            {{< theme_monocolor/drawer }}
57
                {{$id}}monocolor-drawers-courseindex{{/id}}
58
                {{$drawerheadercontent}}
59
                    {{> theme_monocolor/courseindexdrawercontrols}}
60
                {{/drawerheadercontent}}
61
                {{$drawerclasses}}drawer drawer-left {{#courseindexopen}}show{{/courseindexopen}}{{/drawerclasses}}
62
                {{$drawercontent}}
63
                    {{{ output.display_course_progress }}}
64
                    {{{courseindex}}}
65
                {{/drawercontent}}
66
                {{$drawerpreferencename}}drawer-open-index{{/drawerpreferencename}}
67
                {{$drawerstate}}show-drawer-left{{/drawerstate}}
68
                {{$tooltipplacement}}right{{/tooltipplacement}}
69
                {{$closebuttontext}}{{#str}}closecourseindex, core{{/str}}{{/closebuttontext}}
70
            {{/ theme_monocolor/drawer}}
71
        {{/courseindex}}
72
        {{/hidecourseindexnav}}
73
        {{#hasblocks}}
74
            {{< theme_monocolor/drawer }}
75
                {{$id}}monocolor-drawers-blocks{{/id}}
76
                {{$drawerclasses}}drawer drawer-right{{#blockdraweropen}} show{{/blockdraweropen}}{{/drawerclasses}}
77
                {{$drawercontent}}
78
                    <section class="d-print-none" aria-label="{{#str}}blocks{{/str}}">
79
                        {{{ addblockbutton }}}
80
                        {{{ sidepreblocks }}}
81
                    </section>
82
                {{/drawercontent}}
83
                {{$drawerpreferencename}}drawer-open-block{{/drawerpreferencename}}
84
                {{$forceopen}}{{#forceblockdraweropen}}1{{/forceblockdraweropen}}{{/forceopen}}
85
                {{$drawerstate}}show-drawer-right{{/drawerstate}}
86
                {{$tooltipplacement}}left{{/tooltipplacement}}
87
                {{$drawercloseonresize}}1{{/drawercloseonresize}}
88
                {{$closebuttontext}}{{#str}}closeblockdrawer, core{{/str}}{{/closebuttontext}}
89
            {{/ theme_monocolor/drawer}}
90
        {{/hasblocks}}
91
 
92
        {{> theme_monocolor/navbar }}
93
        <div id="page" data-region="mainpage" data-usertour="scroller" class="drawers {{#topbarcustomhtml}}topbar--ext{{/topbarcustomhtml}} {{#courseindexopen}}show-drawer-left{{/courseindexopen}} {{#blockdraweropen}}show-hidden-drawer show-drawer-right{{/blockdraweropen}} {{#blockdraweropen}}show-drawer-right{{/blockdraweropen}}  drag-container">
94
 
95
            <div id="topofscroll" class="main-inner">
96
 
97
                <div class="drawer-toggles d-flex">
98
                    {{#courseindex}}
99
                        <div class="drawer-toggler drawer-left-toggle open-nav d-print-none">
100
                            <button
101
                                class="btn-drawer btn-drawer--left drawertoggle"
102
                                data-toggler="drawers"
103
                                data-action="toggle"
104
                                data-target="monocolor-drawers-courseindex"
105
                                data-toggle="tooltip"
106
                                data-placement="right"
107
                                title="{{#str}}opendrawerindex, core{{/str}}"
108
                            >
109
                                <span class="sr-only">{{#str}}opendrawerindex, core{{/str}}</span>
110
                                <svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 5.99519C2 5.44556 2.44556 5 2.99519 5H11.0048C11.5544 5 12 5.44556 12 5.99519C12 6.54482 11.5544 6.99039 11.0048 6.99039H2.99519C2.44556 6.99039 2 6.54482 2 5.99519Z" fill="currentColor" /><path d="M2 11.9998C2 11.4501 2.44556 11.0046 2.99519 11.0046H21.0048C21.5544 11.0046 22 11.4501 22 11.9998C22 12.5494 21.5544 12.9949 21.0048 12.9949H2.99519C2.44556 12.9949 2 12.5494 2 11.9998Z" fill="currentColor" /><path d="M2.99519 17.0096C2.44556 17.0096 2 17.4552 2 18.0048C2 18.5544 2.44556 19 2.99519 19H15.0048C15.5544 19 16 18.5544 16 18.0048C16 17.4552 15.5544 17.0096 15.0048 17.0096H2.99519Z" fill="currentColor" /></svg>
111
                            </button>
112
                        </div>
113
                    {{/courseindex}}
114
                    {{#hasblocks}}
115
                        <div id="sidepreopen-control" class="drawer-toggler drawer-right-toggle ml-auto d-print-none">
116
                            <button
117
                                class="btn border-0 icon-no-margin drawertoggle btn-close-drawer--right"
118
                                data-toggler="drawers"
119
                                data-action="toggle"
120
                                data-target="monocolor-drawers-blocks"
121
                                data-toggle="tooltip"
122
                                data-placement="right"
123
                                title="{{#str}}opendrawerblocks, core{{/str}}"
124
                            >
125
                                <span class="sr-only">{{#str}}opendrawerblocks, core{{/str}}</span>
126
                                <span class="dir-rtl-hide">
127
                                    <svg width="20" height="20" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;">
128
                                        <g transform="matrix(1,0,0,1,-2,0)">
129
                                            <path d="M18.333,15L18.333,5C18.333,3.629 17.205,2.5 15.833,2.5L14.167,2.5C12.795,2.5 11.667,3.629 11.667,5L11.667,15C11.667,16.371 12.795,17.5 14.167,17.5L15.833,17.5C17.205,17.5 18.333,16.371 18.333,15Z" style="fill:none;fill-rule:nonzero;stroke:currentColor;stroke-width:1.67px;" />
130
                                        </g>
131
                                        <g transform="matrix(1,0,0,1,-2,0)">
132
                                            <path d="M11.667,10L5,10M5,10L7.5,7.5M5,10L7.5,12.5" style="fill:none;fill-rule:nonzero;stroke:currentColor;stroke-width:1.25px;stroke-linecap:round;stroke-linejoin:round;" />
133
                                        </g>
134
                                    </svg>
135
                                </span>
136
                                <span class="dir-ltr-hide">
137
                                    <svg width="20" height="20" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;">
138
                                        <g transform="matrix(1,0,0,1,-2,0)">
139
                                            <path d="M18.333,15L18.333,5C18.333,3.629 17.205,2.5 15.833,2.5L14.167,2.5C12.795,2.5 11.667,3.629 11.667,5L11.667,15C11.667,16.371 12.795,17.5 14.167,17.5L15.833,17.5C17.205,17.5 18.333,16.371 18.333,15Z" style="fill:none;fill-rule:nonzero;stroke:currentColor;stroke-width:1.67px;" />
140
                                        </g>
141
                                        <g transform="matrix(1,0,0,1,-2,0)">
142
                                            <path d="M11.667,10L5,10M5,10L7.5,7.5M5,10L7.5,12.5" style="fill:none;fill-rule:nonzero;stroke:currentColor;stroke-width:1.25px;stroke-linecap:round;stroke-linejoin:round;" />
143
                                        </g>
144
                                    </svg>
145
                                </span>
146
                            </button>
147
                        </div>
148
                    {{/hasblocks}}
149
                </div>
150
 
151
                <div id="page-content" class="page-content wrapper-fw">
152
 
153
                    <div id="region-main-box" class="region-main-wrapper">
154
 
155
                        <section id="region-main" aria-label="{{#str}}content{{/str}}">
156
                            <div class="rui-blocks-wrapper wrapper--with-margin wrapper-xl">
157
 
158
                                <div class="wrapper-course wrapper-page">
159
                                    {{{ output.breadcrumbs }}}
160
                                    {{{coursepageinformationbanners}}}
161
 
162
                                    {{#secondarymoremenu}}
163
                                    <div class="secondary-navigation d-print-none">
164
                                        {{> core/course-moremenu}}
165
                                    </div>
166
                                    {{/secondarymoremenu}}
167
 
168
                                    {{#courseimagecontent}}
169
                                        <div class="rui-course-cover mb-4">{{{ output.course_hero }}}</div>
170
                                    {{/courseimagecontent}}
171
 
172
                                    {{#hasregionmainsettingsmenu}}
173
                                        <div class="region_main_settings_menu_proxy"></div>
174
                                    {{/hasregionmainsettingsmenu}}
175
                                    {{{ output.course_content_header }}}
176
                                    {{#headercontent}}
177
                                        {{> core/activity_header }}
178
                                    {{/headercontent}}
179
                                    {{#overflow}}
180
                                        <div class="container-fluid tertiary-navigation">
181
                                            <div class="navitem">
182
                                                {{> core/url_select}}
183
                                            </div>
184
                                        </div>
185
                                    {{/overflow}}
186
 
187
                                    {{#coursetablayout}}
188
                                        <div class="rui-course-nav-wrapper">
189
                                            <div class="moremenu navigation">
190
                                                <ul class="rui-course-nav nav nav-tabs" id="courseTab" role="tablist">
191
                                                    <li class="nav-item" role="presentation">
192
                                                        <a href="#courseTabContent"
193
                                                            class="nav-link {{^istab2active}}active active_tree_node{{/istab2active}}" id="course-tab1" data-toggle="tab" data-target="#tab1" type="button" role="tab" aria-controls="tab1" {{^istab2active}}aria-selected="true"{{/istab2active}} {{#istab2active}}aria-selected="false"{{/istab2active}}>
194
                                                            {{{titlecoursetab1}}}
195
                                                        </a>
196
                                                    </li>
197
                                                    <li class="nav-item" role="presentation">
198
                                                        <a href="#tab2" class="nav-link {{#istab2active}}active active_tree_node{{/istab2active}}" id="course-tab2" data-toggle="tab" data-target="#tab2" type="button" role="tab" aria-controls="tab2" {{#istab2active}}aria-selected="true"{{/istab2active}} {{^istab2active}}aria-selected="false"{{/istab2active}}>
199
                                                            {{{titlecoursetab2}}}
200
                                                        </a>
201
                                                    </li>
202
                                                    <li class="nav-item" role="presentation">
203
                                                        <a href="#tab3" class="nav-link" id="course-tab3" data-toggle="tab" data-target="#tab3" type="button" role="tab" aria-controls="tab3" aria-selected="false">
204
                                                            {{{titlecoursetab3}}}
205
                                                        </a>
206
                                                    </li>
207
                                                    <li class="nav-item" role="presentation">
208
                                                        <a href="#tab4" class="nav-link" id="course-tab4" data-toggle="tab" data-target="#tab4" type="button" role="tab" aria-controls="tab4" aria-selected="false">
209
                                                            {{{titlecoursetab4}}}
210
                                                        </a>
211
                                                    </li>
212
                                                    <li class="nav-item" role="presentation">
213
                                                        <a href="#tab5" class="nav-link" id="course-tab5" data-toggle="tab" data-target="#tab5" type="button" role="tab" aria-controls="tab5" aria-selected="false">
214
                                                            {{{titlecoursetab5}}}
215
                                                        </a>
216
                                                    </li>
217
                                                    <li role="none" class="dropdown dropdownmoremenu morebutton d-none" data-region="morebutton">
218
                                                        <a class="btn btn-icon btn--more nav-link p-0 {{#isactive}}active{{/isactive}}" href="#" id="moremenu-dropdown-topbar" role="{{#istablist}}tab{{/istablist}}{{^istablist}}menuitem{{/istablist}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" tabindex="-1">
219
                                                            <svg width="24" height="24" fill="none" viewBox="0 0 24 24">
220
                                                                <path fill="currentColor" d="M13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12Z"></path>
221
                                                                <path fill="currentColor" d="M13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7C12.5523 7 13 7.44772 13 8Z"></path>
222
                                                                <path fill="currentColor" d="M13 16C13 16.5523 12.5523 17 12 17C11.4477 17 11 16.5523 11 16C11 15.4477 11.4477 15 12 15C12.5523 15 13 15.4477 13 16Z"></path>
223
                                                            </svg>
224
                                                        </a>
225
                                                        <ul class="dropdown-menu dropdown-menu-left" data-region="moredropdown" aria-labelledby="moremenu-dropdown-topbar" role="menu">
226
                                                        </ul>
227
                                                    </li>
228
                                                </ul>
229
                                            </div>
230
                                        </div>
231
                                        {{#js}}
232
                                            require(['core/moremenu'], function(moremenu) {
233
                                            moremenu(document.querySelector('#courseTab'));
234
                                            });
235
                                        {{/js}}
236
 
237
                                        {{#hasctopbl}}
238
                                        <div class="mt-4 wrapper-xxl">
239
                                            <section id="ctopbl" data-region="tmpl-course-blocks" class="rui-blocks-area">
240
                                                {{{ ctopbl }}}
241
                                            </section>
242
                                        </div>
243
                                        {{/hasctopbl}}
244
 
245
                                        <div class="tab-content" id="courseTabContent">
246
 
247
                                            {{{ output.header_action_btn }}}
248
 
249
                                            <div class="tab-pane fade {{^istab2active}}show active{{/istab2active}}" id="tab1" role="tabpanel" aria-labelledby="course-tab1">
250
 
251
                                                {{{ output.fullcourse_header }}}
252
                                                {{{ coursetab-a }}}
253
                                                {{{ coursetab1content }}}
254
 
255
                                            </div>
256
                                            <div class="tab-pane fade {{#istab2active}}show active{{/istab2active}}"" id="tab2" role="tabpanel" aria-labelledby="course-tab2">
257
                                                <div class="wrapper-fw">
258
 
259
                                                    {{#hascstopbl}}
260
                                                        <section id="cstopbl" data-region="tmpl-course-blocks" class="rui-blocks-area wrapper-xl">
261
                                                            {{{ cstopbl }}}
262
                                                        </section>
263
                                                    {{/hascstopbl}}
264
 
265
                                                    {{{ coursetab2content }}}
266
 
267
                                                    {{{ output.main_content }}}
268
                                                    {{{ coursetab-b }}}
269
 
270
                                                    {{#hascsbottombl}}
271
                                                        <section id="csbottombl" data-region="tmpl-course-blocks" class="rui-blocks-area wrapper-xl">
272
                                                            {{{ csbottombl }}}
273
                                                        </section>
274
                                                    {{/hascsbottombl}}
275
                                                </div>
276
                                            </div>
277
                                            <div class="tab-pane fade" id="tab3" role="tabpanel" aria-labelledby="course-tab3">
278
                                                <div class="wrapper-fw">
279
                                                    {{{ coursetab3content }}}
280
                                                    {{{ coursetab-c }}}
281
                                                </div>
282
                                            </div>
283
                                            <div class="tab-pane fade" id="tab4" role="tabpanel" aria-labelledby="course-tab4">
284
                                                <div class="wrapper-fw">
285
                                                    {{{ coursetab4content }}}
286
                                                    {{{ coursetab-d }}}
287
                                                </div>
288
                                            </div>
289
                                            <div class="tab-pane fade" id="tab5" role="tabpanel" aria-labelledby="course-tab5">
290
                                                <div class="wrapper-fw {{# output.course_contacts }}rui-list--gap {{/ output.course_contacts }}">
291
                                                    {{{ coursetab5content }}}
292
                                                    {{{ coursetab-e }}}
293
 
294
                                                    {{#cccteacherslist}}{{{ output.course_contacts }}}{{/cccteacherslist}}
295
                                                </div>
296
                                            </div>
297
                                        </div>
298
 
299
                                    {{/coursetablayout}}
300
 
301
                                    {{^coursetablayout}}
302
 
303
                                        <div class="mt-5">
304
                                        {{{ output.full_header }}}
305
                                        </div>
306
 
307
                                        {{#hascstopbl}}
308
                                            <section id="cstopbl" data-region="tmpl-course-blocks" class="rui-blocks-area mt-4">
309
                                                {{{ cstopbl }}}
310
                                            </section>
311
                                        {{/hascstopbl}}
312
 
313
                                        {{{ output.main_content }}}
314
 
315
                                        {{#hascsbottombl}}
316
                                            <div>
317
                                                <section id="csbottombl" data-region="tmpl-course-blocks" class="rui-blocks-area">
318
                                                    {{{ csbottombl }}}
319
                                                </section>
320
                                            </div>
321
                                        {{/hascsbottombl}}
322
 
323
                                    {{/coursetablayout}}
324
 
325
                                    {{{ output.activity_navigation }}}
326
                                    {{{ output.course_content_footer }}}
327
 
328
                                </div>
329
 
330
                            </div>
331
                        </section>
332
 
333
                    </div>
334
 
335
                    {{#hascbottombl}}
336
                        <div class="mt-4 wrapper-xxl">
337
                            <section id="cbottombl" data-region="tmpl-course-blocks" class="rui-blocks-area wrapper--with-margin wrapper-xl">
338
                                {{{ cbottombl }}}
339
                            </section>
340
                        </div>
341
                    {{/hascbottombl}}
342
 
343
                </div>
344
 
345
                {{#coursetablayout}}
346
                    {{#ipcourseimage}}
347
                        {{#output.course_hero_url}}
348
                            <div class="wrapper--with-margin wrapper-xl rui-course-cover mt-5" style="background-image: url('{{ output.course_hero_url }}');"></div>
349
                        {{/output.course_hero_url}}
350
                    {{/ipcourseimage}}
351
                {{/coursetablayout}}
352
 
353
            </div>
354
 
355
            {{> theme_monocolor/footer }}
356
 
357
        </div>
358
 
359
        {{{ output.standard_after_main_region_html }}}
360
 
361
    </div>
362
 
363
    <script>
364
        // Get all elements with class "rui-modprogress"
365
        var progressDivs = document.querySelectorAll('.rui-modprogress');
366
 
367
        // Iterate over each div element
368
        progressDivs.forEach(function(div) {
369
            // Extract the text content from the div
370
            var textContent = div.textContent.trim();
371
 
372
            // Extract only numbers using regular expression
373
            var numbers = textContent.match(/\d+/g);
374
 
375
            // Check if numbers are extracted successfully
376
            if (numbers && numbers.length === 2) {
377
                // Split the value before and after the "/" character
378
                var beforeSlash = numbers[0];
379
                var afterSlash = numbers[1];
380
 
381
                // Update count-completed-value and count-total-value
382
                var parentDiv = div.closest('.section-summary-activities');
383
                var completedSpan = parentDiv.querySelector('.count-completed-value');
384
                var totalSpan = parentDiv.querySelector('.count-total-value');
385
 
386
                // Calculate the percentage of completion
387
                var percentage = (beforeSlash / afterSlash) * 100;
388
 
389
                // Update aria-valuenow attribute
390
                var progressBar = parentDiv.querySelector('.rui-progress-bar');
391
                if (progressBar) {
392
                    progressBar.setAttribute('aria-valuenow', percentage);
393
                    progressBar.style.width = percentage + "%";
394
                }
395
 
396
                if (completedSpan && totalSpan) {
397
                    completedSpan.textContent = beforeSlash;
398
                    totalSpan.textContent = afterSlash;
399
                }
400
 
401
            } else {
402
                console.error("Error: Failed to extract numbers from the div with ID:", div.id);
403
            }
404
        });
405
    </script>
406
 
407
</body>
408
 
409
</html>
410
{{#js}}
411
    M.util.js_pending('theme_monocolor/loader');
412
    require(['theme_monocolor/loader', 'theme_monocolor/drawer'], function(Loader, Drawer) {
413
    Drawer.init();
414
    M.util.js_complete('theme_monocolor/loader');
415
    });
416
{{/js}}