Proyectos de Subversion Moodle

Rev

Rev 938 | | Comparar con el anterior | 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_universe/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 }}}
937 ariadna 54
        {{{ output.cesa_navigation_course_menu_lateral_output }}}
1 efrain 55
 
520 ariadna 56
        {{> theme_universe_child/navbar }}
1 efrain 57
        <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">
58
 
939 ariadna 59
            <div class="drawer-toggles d-flex">
60
                    {{#courseindex}}
61
                        <div class="drawer-toggler drawer-left-toggle open-nav d-print-none">
62
                            <button
63
                                class="btn-drawer btn-drawer--left drawertoggle"
64
                                data-toggler="drawers"
65
                                data-action="toggle"
66
                                data-target="universe-drawers-courseindex"
67
                                data-toggle="tooltip"
68
                                data-placement="right"
69
                                title="{{#str}}opendrawerindex, core{{/str}}"
70
                            >
71
                                <span class="sr-only">{{#str}}opendrawerindex, core{{/str}}</span>
72
                                <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>
73
                            </button>
74
                        </div>
75
                    {{/courseindex}}
76
 
77
            </div>
78
 
1 efrain 79
            <div id="topofscroll" class="main-inner">
80
 
81
                <div id="page-content" class="page-content wrapper-fw">
82
 
83
                    <div id="region-main-box" class="region-main-wrapper">
84
 
85
                        <section id="region-main" aria-label="{{#str}}content{{/str}}">
86
                            <div class="rui-blocks-wrapper wrapper--with-margin wrapper-xl">
87
 
88
                                <div class="wrapper-course wrapper-page">
89
                                    {{{ output.breadcrumbs }}}
90
                                    {{{coursepageinformationbanners}}}
91
 
92
                                    {{#secondarymoremenu}}
93
                                    <div class="secondary-navigation d-print-none">
94
                                        {{> core/course-moremenu}}
95
                                    </div>
96
                                    {{/secondarymoremenu}}
97
 
98
                                    {{#courseimagecontent}}
99
                                        {{#output.course_hero}}
100
                                            <div class="rui-course-cover {{#courseimagefw}}rui-course-cover--fw{{/courseimagefw}} {{coursecoverstyle}} mb-3 d-print-none" style="background-image: url('{{{ output.course_hero }}}');" alt="{{#str}}courseoverviewfiles, moodle {{/str}}"></div>
101
                                        {{/output.course_hero}}
102
                                    {{/courseimagecontent}}
103
 
104
                                    {{#hasregionmainsettingsmenu}}
105
                                        <div class="region_main_settings_menu_proxy"></div>
106
                                    {{/hasregionmainsettingsmenu}}
107
                                    {{{ output.course_content_header }}}
108
                                    {{#headercontent}}
109
                                        {{> core/activity_header }}
110
                                    {{/headercontent}}
111
                                    {{#overflow}}
112
                                        <div class="container-fluid tertiary-navigation">
113
                                            <div class="navitem">
114
                                                {{> core/url_select}}
115
                                            </div>
116
                                        </div>
117
                                    {{/overflow}}
118
 
119
                                    {{#coursetablayout}}
120
                                        <div class="rui-course-nav-wrapper">
121
                                            <div class="moremenu navigation">
122
                                                <ul class="rui-course-nav nav nav-tabs" id="courseTab" role="tablist">
123
                                                    <li class="nav-item" role="presentation">
124
                                                        <a href="#courseTabContent"
125
                                                            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}}>
126
                                                            {{{titlecoursetab1}}}
127
                                                        </a>
128
                                                    </li>
129
                                                    <li class="nav-item" role="presentation">
130
                                                        <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}}>
131
                                                            {{{titlecoursetab2}}}
132
                                                        </a>
133
                                                    </li>
134
                                                    <li class="nav-item" role="presentation">
135
                                                        <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">
136
                                                            {{{titlecoursetab3}}}
137
                                                        </a>
138
                                                    </li>
139
                                                    <li class="nav-item" role="presentation">
140
                                                        <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">
141
                                                            {{{titlecoursetab4}}}
142
                                                        </a>
143
                                                    </li>
144
                                                    <li class="nav-item" role="presentation">
145
                                                        <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">
146
                                                            {{{titlecoursetab5}}}
147
                                                        </a>
148
                                                    </li>
149
                                                    <li role="none" class="dropdown dropdownmoremenu morebutton d-none" data-region="morebutton">
150
                                                        <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">
151
                                                            <svg width="24" height="24" fill="none" viewBox="0 0 24 24">
152
                                                                <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>
153
                                                                <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>
154
                                                                <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>
155
                                                            </svg>
156
                                                        </a>
157
                                                        <ul class="dropdown-menu dropdown-menu-left" data-region="moredropdown" aria-labelledby="moremenu-dropdown-topbar" role="menu">
158
                                                        </ul>
159
                                                    </li>
160
                                                </ul>
161
                                            </div>
162
                                        </div>
163
                                        {{#js}}
164
                                            require(['core/moremenu'], function(moremenu) {
165
                                            moremenu(document.querySelector('#courseTab'));
166
                                            });
167
                                        {{/js}}
168
 
169
                                        {{#hasctopbl}}
170
                                        <div class="wrapper-fw">
171
                                            <section id="ctopbl" data-region="tmpl-course-blocks" class="rui-blocks-area">
172
                                                {{{ ctopbl }}}
173
                                            </section>
174
                                        </div>
175
                                        {{/hasctopbl}}
176
 
177
                                        <div class="tab-content" id="courseTabContent">
178
                                            <div class="tab-pane fade {{^istab2active}}show active{{/istab2active}}" id="tab1" role="tabpanel" aria-labelledby="course-tab1">
179
                                                {{#ipcourseimage}}
180
                                                    {{#output.course_hero}}
181
                                                        <div class="rui-course-cover {{#courseimagefw}}rui-course-cover--fw{{/courseimagefw}} {{coursecoverstyle}} mb-3" style="background-image: url('{{{ output.course_hero }}}');"></div>
182
                                                    {{/output.course_hero}}
183
                                                {{/ipcourseimage}}
184
                                                {{{ output.full_header }}}
185
                                                {{{ coursetab-a }}}
186
                                                {{{ coursetab1content }}}
187
 
188
                                            </div>
189
                                            <div class="tab-pane fade {{#istab2active}}show active{{/istab2active}}"" id="tab2" role="tabpanel" aria-labelledby="course-tab2">
190
                                                <div class="wrapper-fw">
191
 
192
                                                    {{#hascstopbl}}
193
                                                        <section id="cstopbl" data-region="tmpl-course-blocks" class="rui-blocks-area wrapper-xl">
194
                                                            {{{ cstopbl }}}
195
                                                        </section>
196
                                                    {{/hascstopbl}}
197
 
198
                                                    {{{ coursetab2content }}}
199
 
200
                                                    {{{ output.main_content }}}
201
                                                    {{{ coursetab-b }}}
202
 
203
                                                    {{#hascsbottombl}}
204
                                                        <section id="csbottombl" data-region="tmpl-course-blocks" class="rui-blocks-area wrapper-xl">
205
                                                            {{{ csbottombl }}}
206
                                                        </section>
207
                                                    {{/hascsbottombl}}
208
                                                </div>
209
                                            </div>
210
                                            <div class="tab-pane fade" id="tab3" role="tabpanel" aria-labelledby="course-tab3">
211
                                                <div class="wrapper-fw">
212
                                                    {{{ coursetab3content }}}
213
                                                    {{{ coursetab-c }}}
214
                                                </div>
215
                                            </div>
216
                                            <div class="tab-pane fade" id="tab4" role="tabpanel" aria-labelledby="course-tab4">
217
                                                <div class="wrapper-fw">
218
                                                    {{{ coursetab4content }}}
219
                                                    {{{ coursetab-d }}}
220
                                                </div>
221
                                            </div>
222
                                            <div class="tab-pane fade" id="tab5" role="tabpanel" aria-labelledby="course-tab5">
223
                                                <div class="wrapper-fw {{# output.course_contacts }}rui-list--gap {{/ output.course_contacts }}">
224
                                                    {{{ coursetab5content }}}
225
                                                    {{{ coursetab-e }}}
226
 
227
                                                    {{#cccteacherslist}}{{{ output.course_contacts }}}{{/cccteacherslist}}
228
                                                </div>
229
                                            </div>
230
                                        </div>
231
 
232
                                    {{/coursetablayout}}
233
 
234
                                    {{^coursetablayout}}
235
 
236
                                        {{{ output.full_header }}}
237
 
238
                                        {{#ipcourseimage}}
239
                                            {{#output.course_hero}}
240
                                                <div class="rui-course-cover my-3" style="background-image: url('{{{ output.course_hero }}}');"></div>
241
                                            {{/output.course_hero}}
242
                                        {{/ipcourseimage}}
243
 
244
                                        {{#hascstopbl}}
245
                                            <section id="cstopbl" data-region="tmpl-course-blocks" class="rui-blocks-area mt-4">
246
                                                {{{ cstopbl }}}
247
                                            </section>
248
                                        {{/hascstopbl}}
249
 
250
                                        {{{ output.main_content }}}
251
 
252
                                        {{#hascsbottombl}}
253
                                            <div>
254
                                                <section id="csbottombl" data-region="tmpl-course-blocks" class="rui-blocks-area">
255
                                                    {{{ csbottombl }}}
256
                                                </section>
257
                                            </div>
258
                                        {{/hascsbottombl}}
259
 
260
                                    {{/coursetablayout}}
261
 
262
                                    {{{ output.activity_navigation }}}
263
                                    {{{ output.course_content_footer }}}
264
 
265
                                </div>
266
 
267
                            </div>
268
                        </section>
148 ariadna 269
 
270
                        {{#hasblocks}}
271
                            {{< theme_universe/drawer }}
272
                                {{$id}}universe-drawers-blocks{{/id}}
273
                                {{$drawerclasses}}drawer drawer-right{{#blockdraweropen}} show{{/blockdraweropen}}{{/drawerclasses}}
274
                                {{$drawercontent}}
275
                                    <section class="d-print-none" aria-label="{{#str}}blocks{{/str}}">
276
                                        {{{ addblockbutton }}}
277
                                        {{{ sidepreblocks }}}
278
                                    </section>
279
                                {{/drawercontent}}
280
                                {{$drawerpreferencename}}drawer-open-block{{/drawerpreferencename}}
281
                                {{$forceopen}}{{#forceblockdraweropen}}1{{/forceblockdraweropen}}{{/forceopen}}
282
                                {{$drawerstate}}show-drawer-right{{/drawerstate}}
283
                                {{$tooltipplacement}}left{{/tooltipplacement}}
284
                                {{$drawercloseonresize}}1{{/drawercloseonresize}}
285
                                {{$closebuttontext}}{{#str}}closeblockdrawer, core{{/str}}{{/closebuttontext}}
286
                            {{/ theme_universe/drawer}}
287
                        {{/hasblocks}}
1 efrain 288
                    </div>
289
 
290
                    {{#hascbottombl}}
291
                        <div class="wrapper-fw">
292
                            <section id="cbottombl" data-region="tmpl-course-blocks" class="rui-blocks-area wrapper--with-margin wrapper-xl">
293
                                {{{ cbottombl }}}
294
                            </section>
295
                        </div>
296
                    {{/hascbottombl}}
297
 
298
                </div>
299
 
300
            </div>
301
 
302
            {{> theme_universe/footer }}
303
 
304
        </div>
305
 
306
        {{{ output.standard_after_main_region_html }}}
307
 
308
    </div>
309
 
310
    <script>
311
        // Get all elements with class "rui-modprogress"
312
        var progressDivs = document.querySelectorAll('.rui-modprogress');
313
 
314
        // Iterate over each div element
315
        progressDivs.forEach(function(div) {
316
            // Extract the text content from the div
317
            var textContent = div.textContent.trim();
318
 
319
            // Extract only numbers using regular expression
320
            var numbers = textContent.match(/\d+/g);
321
 
322
            // Check if numbers are extracted successfully
323
            if (numbers && numbers.length === 2) {
324
                // Split the value before and after the "/" character
325
                var beforeSlash = numbers[0];
326
                var afterSlash = numbers[1];
327
 
328
                // Update count-completed-value and count-total-value
329
                var parentDiv = div.closest('.section-summary-activities');
330
                var completedSpan = parentDiv.querySelector('.count-completed-value');
331
                var totalSpan = parentDiv.querySelector('.count-total-value');
332
 
333
                // Calculate the percentage of completion
334
                var percentage = (beforeSlash / afterSlash) * 100;
335
 
336
                // Update aria-valuenow attribute
337
                var progressBar = parentDiv.querySelector('.rui-progress-bar');
338
                if (progressBar) {
339
                    progressBar.setAttribute('aria-valuenow', percentage);
340
                    progressBar.style.width = percentage + "%";
341
                }
342
 
343
                if (completedSpan && totalSpan) {
344
                    completedSpan.textContent = beforeSlash;
345
                    totalSpan.textContent = afterSlash;
346
                }
347
 
348
            } else {
349
                console.error("Error: Failed to extract numbers from the div with ID:", div.id);
350
            }
351
        });
352
    </script>
353
 
354
</body>
355
 
356
</html>
357
{{#js}}
358
    M.util.js_pending('theme_universe/loader');
359
    require(['theme_universe/loader', 'theme_universe/drawer'], function(Loader, Drawer) {
360
    Drawer.init();
361
    M.util.js_complete('theme_universe/loader');
362
    });
363
{{/js}}