Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | 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
    @template theme_universe/columns2
19
 
20
    Admin time setting template.
21
 
22
    universe 2 column layout template.
23
 
24
    Context variables required for this template:
25
    * sitename - The name of the site
26
    * output - The core renderer for the page
27
    * bodyattributes - attributes for the body tag as a string of html attributes
28
    * sidepreblocks - HTML for the blocks
29
    * hasblocks - true if there are blocks on this page
30
    * navdraweropen - true if the nav drawer should be open on page load
31
    * regionmainsettingsmenu - HTML for the region main settings menu
32
    * hasregionmainsettingsmenu - There is a region main settings menu on this page.
33
 
34
    Example context (json):
35
    {
36
        "sitename": "Moodle",
37
        "output": {
38
            "doctype": "<!DOCTYPE html>",
39
            "page_title": "Test page",
40
            "favicon": "favicon.ico",
41
            "main_content": "<h1>Headings make html validators happier</h1>"
42
         },
43
        "bodyattributes":"",
44
        "sidepreblocks": "<h2>Blocks html goes here</h2>",
45
        "hasblocks":true,
46
        "navdraweropen":true,
47
        "regionmainsettingsmenu": "",
48
        "hasregionmainsettingsmenu": false
49
    }
50
}}
51
{{> theme_universe/head }}
52
 
53
<body {{{ bodyattributes }}}>
54
{{> core/local/toast/wrapper}}
55
 
56
<div id="page-wrapper" class="d-print-block {{#output.courseheadermenu}}rui--course-with-nav{{/output.courseheadermenu}} {{^output.courseheadermenu}}rui--course-witout-nav{{/output.courseheadermenu}}">
57
 
58
    {{{ output.standard_top_of_body_html }}}
59
    {{> theme_universe/hasblocks-tmpl }}
60
 
61
    {{> theme_universe/navbar }}
62
    <div id="page" data-region="mainpage" data-usertour="scroller" class="drawers {{#topbarcustomhtml}}topbar--ext{{/topbarcustomhtml}} {{#blockdraweropen}}show-hidden-drawer show-drawer-right{{/blockdraweropen}} drag-container">
63
 
64
        <div id="topofscroll" class="main-inner">
65
            <div id="page-content" class="page-content wrapper-fw">
66
 
67
                <div id="region-main-box" class="region-main-course-wrapper">
68
 
69
                <section id="region-main" aria-label="{{#str}}content{{/str}}">
70
 
71
                    <div class="rui-blocks-wrapper wrapper--with-margin wrapper-xl">
72
 
73
                            <div class="wrapper-page-withblocks">
74
                                {{{ output.breadcrumbs }}}
75
                                {{{coursepageinformationbanners}}}
76
 
77
                                <div class="wrapper-header">
78
                                {{#secondarymoremenu}}
79
                                    <div class="secondary-navigation d-print-none">
80
                                        {{> core/moremenu}}
81
                                    </div>
82
                                {{/secondarymoremenu}}
83
                                {{{ output.simple_header }}}
84
                                </div>
85
 
86
                                {{#hasregionmainsettingsmenu}}
87
                                    <div class="region_main_settings_menu_proxy"></div>
88
                                {{/hasregionmainsettingsmenu}}
89
                                {{{ output.course_content_header }}}
90
                                {{#headercontent}}
91
                                    {{> core/activity_header }}
92
                                {{/headercontent}}
93
                                {{#overflow}}
94
                                    <div class="tertiary-navigation d-inline-flex flex-wrap w-100">
95
                                        <div class="navitem">
96
                                            {{> core/url_select}}
97
                                            </div>
98
                                        </div>
99
                                    </div>
100
                                {{/overflow}}
101
 
102
                                <div class="wrapper-fw">
103
                                {{{ output.main_content }}}
104
                                </div>
105
 
106
 
107
                        </div>
108
 
109
                        {{{ output.activity_navigation }}}
110
                        {{{ output.course_content_footer }}}
111
                    </section>
112
                </div>
113
            </div>
114
            {{> theme_universe/footer }}
115
        </div>
116
    </div>
117
 
118
    {{{ output.standard_after_main_region_html }}}
119
 
120
</div>
121
 
122
{{#js}}
123
    $(document).ready(function(){
124
        $("#page-admin-setting-themesettinguniverse .tab-pane .rui-setting-heading-wrapper").nextUntil("#page-admin-setting-themesettinguniverse .tab-pane .rui-setting-heading-wrapper").addClass("hidden");
125
    });
126
    $("#page-admin-setting-themesettinguniverse .tab-pane .rui-setting-heading-wrapper").click(function() {
127
        $(this).nextUntil("#page-admin-setting-themesettinguniverse .rui-setting-heading-wrapper").toggleClass("hidden");
128
        $(this).toggleClass("active");
129
    });
130
{{/js}}
131
 
132
<script>
133
        if (document.getElementsByTagName("body")[0].id.match(/page-admin-setting-themesettinguniverse/)) {
134
            for (let i = 1; i <= 22; i++) {
135
                var tempID = 'id_s_theme_universe_displayblock' + i; // Checkboxes.
136
                var tempItemID = '[data-settings-name="theme_universe_block' + i + '"]'; // Navigation items.
137
                var tempFCBID = 'admin-block' + i; // Content Builder Items.
138
                var checkBox = document.getElementById(tempID);
139
                var navItem = document.querySelector(tempItemID);
140
                var fcbItem = document.getElementById(tempFCBID);
141
                if (checkBox.checked == true) {
142
                    navItem.classList.add("rui--turnedon");
143
                    fcbItem.classList.add("rui--turnedon");
144
                } else {
145
                    navItem.style.opacity = "0.3";
146
                    fcbItem.style.opacity = "0.3";
147
                }
148
            }
149
 
150
            for (let i = 0; i <= 22; i++) {
151
                var selectID = 'id_s_theme_universe_block' + i; // Select value.
152
                var tempFCBID = 'admin-block' + i; // Content Builder Items.
153
                var fcbItem = document.getElementById(tempFCBID);
154
                var selectValue = document.getElementById(selectID).value;
155
 
156
                fcbItem.dataset.blockPosition = selectValue;
157
                fcbItem.dataset.blockIndex = i;
158
                document.getElementById(selectID).dataset.blockIndex = i;
159
            }
160
 
161
            const buttons = document.getElementsByTagName("select");
162
            const buttonPressed = e => {
163
                var selectID = e.target.id; // Get ID of clicked element -> select
164
                var selectByID = document.getElementById(selectID).value; // Get ID of clicked element -> select
165
                var blIndex = document.getElementById(selectID).dataset.blockIndex; // Block number
166
                var wrapperID = 'admin-block' + blIndex; // Wrapper ID
167
                var wrapperByID = document.getElementById(wrapperID);
168
                var selectValue = document.getElementById(selectID).value; // Get value - select
169
                wrapperByID.dataset.blockPosition = selectByID;
170
            }
171
 
172
            for (let button of buttons) {
173
                button.addEventListener("change", buttonPressed);
174
            }
175
        }
176
    </script>
177
{{#js}}
178
        var $wrapper = $('#theme_universe_scb');
179
        $wrapper.find('.rui-settings-item').sort(function (a, b) {
180
        return +a.dataset.blockPosition - +b.dataset.blockPosition;
181
        }).appendTo( $wrapper );
182
 
183
 
184
        $( '[id^="id_s_theme_universe_block"]' ).on( "change", function() {
185
        var $wrapper = $('#theme_universe_scb');
186
        $wrapper.find('.rui-settings-item').sort(function (a, b) {
187
        return +a.dataset.blockPosition - +b.dataset.blockPosition;
188
        }).appendTo( $wrapper );
189
        });
190
    {{/js}}
191
</body>
192
</html>
193
{{#js}}
194
M.util.js_pending('theme_universe/loader');
195
require(['theme_universe/loader', 'theme_universe/drawer'], function(Loader, Drawer) {
196
    Drawer.init();
197
    M.util.js_complete('theme_universe/loader');
198
});
199
{{/js}}