Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 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 block_site_main_menu/mainsection
19
 
20
    This mustache emulates a course single section structure inside a block.
21
 
22
    It requires to include several divs to emulate the structure of a course format.
23
 
24
    Example context (json):
25
    {
26
        "cmlist": "Sample",
27
        "siteid": 1,
28
        "sectionid": 1,
29
        "sectionname": "Sample",
30
        "sectionnum": 1,
31
        "editing": true
32
    }
33
}}
34
<div
35
    id="block_site_main_menu_section"
36
    class="course-content"
37
>
38
    {{! The section list is used by the content module to init the sections.}}
39
    <div
40
        data-for="course_sectionlist"
41
    >
42
        {{! The section need some bottom padding and margin for the dropzone.
43
        Otherwise the activities will cover the area. }}
44
        <div
45
            class="mainsection section pb-3"
46
            data-for="section"
47
            data-sectionid="{{sectionid}}"
48
            data-id="{{sectionid}}"
49
            data-number="{{sectionnum}}"
50
            data-sectionname="{{sectionname}}"
51
        >
52
            {{#editing}}
53
            {{! The section header is used as a dropzone when the section is empty.}}
54
            <div
55
                class="section-header"
56
                data-for="section_title"
57
                data-id="{{sectionid}}"
58
                data-number="{{sectionnum}}"
59
            >&nbsp;</div>
60
            {{/editing}}
61
            {{{cmlist}}}
62
        </div>
63
    </div>
64
</div>
65
{{#js}}
66
{{! The block should be fast to load, we only load the editor when needed.}}
67
{{#editing}}
68
require(
69
    [
70
        'core_courseformat/local/content',
71
        'core_courseformat/courseeditor'
72
    ],
73
    function(
74
        Component,
75
        Courseeditor
76
    ) {
77
        {{! The block could be included static in other courses so we use Courseeditor.getCourseEditor. }}
78
        new Component({
79
            element: document.getElementById('block_site_main_menu_section'),
80
            reactive: Courseeditor.getCourseEditor({{siteid}}),
81
        });
82
    }
83
);
84
{{/editing}}
85
{{/js}}