Proyectos de Subversion Moodle

Rev

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