Proyectos de Subversion Moodle

Rev

Rev 1 | | 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
    @template core_courseformat/local/courseindex/section
19
 
20
    Displays a course index section entry.
21
 
22
    Example context (json):
23
    {
24
        "title": "General",
25
        "id": 23,
26
        "uniqid": "0",
27
        "number": 1,
28
        "sectionurl": "#",
29
        "indexcollapsed": 0,
1441 ariadna 30
        "component": null,
1 efrain 31
        "current": 1,
32
        "visible": 1,
33
        "hasrestrictions": 0,
34
        "cms": [
35
            {
36
                "id": 10,
37
                "name": "Glossary of characters",
38
                "url": "#",
39
                "visible": 1,
40
                "isactive": 0
41
            },
42
            {
43
                "id": 11,
44
                "name": "World Cinema forum",
45
                "url": "#",
46
                "visible": 1,
47
                "isactive": 0
48
            },
49
            {
50
                "id": 12,
51
                "name": "Announcements",
52
                "url": "#",
53
                "visible": 0,
54
                "isactive": 1
55
            }
56
        ]
57
    }
58
}}
59
<div
1441 ariadna 60
    class="courseindex-section {{#current}}current{{/current}} {{#component}}delegated-section{{/component}}"
1 efrain 61
    id="course-index-section-{{id}}"
62
    data-for="section"
63
    data-id="{{id}}"
64
    data-number="{{number}}"
65
    role="treeitem"
66
    aria-owns="courseindexcollapse{{number}}"
67
>
68
    <div class="courseindex-item d-flex
69
            {{^visible}}dimmed{{/visible}}
70
            {{#hasrestrictions}}restrictions{{/hasrestrictions}}
71
            courseindex-section-title"
72
        id="courseindexsection{{number}}"
73
        data-for="section_item"
74
    >
1441 ariadna 75
        <a data-bs-toggle="collapse"
1 efrain 76
            href="#courseindexcollapse{{number}}"
77
            class="courseindex-chevron icons-collapse-expand {{#indexcollapsed}}collapsed{{/indexcollapsed}}"
78
            aria-expanded="{{^indexcollapsed}}true{{/indexcollapsed}}{{#indexcollapsed}}false{{/indexcollapsed}}"
79
            aria-controls="courseindexcollapse{{number}}"
80
            tabindex="-1"
81
        >
1441 ariadna 82
            <span class="collapsed-icon icon-no-margin me-1"
1 efrain 83
                title="{{#str}} expand, core {{/str}}">
84
                <span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
85
                <span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
1441 ariadna 86
                <span class="visually-hidden">{{#str}} expand, core {{/str}}</span>
1 efrain 87
            </span>
1441 ariadna 88
            <span class="expanded-icon icon-no-margin me-1"
1 efrain 89
                title="{{#str}} collapse, core {{/str}}">
90
                {{#pix}} t/expandedchevron, core {{/pix}}
1441 ariadna 91
                <span class="visually-hidden">{{#str}} collapse, core {{/str}}</span>
1 efrain 92
            </span>
93
        </a>
94
        <a href="{{{sectionurl}}}"
95
            class="courseindex-link text-truncate"
96
            data-action="togglecourseindexsection"
97
            data-for="section_title"
98
            tabindex="-1"
99
        >
100
            {{{title}}}
101
        </a>
1441 ariadna 102
        <span class="current-badge badge bg-primary text-white ms-2 px-2 rounded-pill">
1 efrain 103
            {{highlighted}}
104
        </span>
1441 ariadna 105
        <span class="courseindex-locked ms-1" data-for="cm_name">
1 efrain 106
            {{#pix}} t/locked, core {{/pix}}
107
        </span>
108
    </div>
109
    <div id="courseindexcollapse{{number}}"
110
        class="courseindex-item-content collapse {{^indexcollapsed}}show{{/indexcollapsed}}"
111
        aria-labelledby="courseindexsection{{number}}" role="group"
112
    >
113
        <ul class="courseindex-sectioncontent unlist" data-for="cmlist" data-id="{{id}}" role="group">
114
            {{#cms}}
115
            {{> core_courseformat/local/courseindex/cm }}
116
            {{/cms}}
117
        </ul>
118
    </div>
119
</div>
120
{{#js}}
121
require(['core_courseformat/local/courseindex/section'], function(component) {
1441 ariadna 122
    component.init('#course-index-section-{{id}}');
1 efrain 123
});
124
{{/js}}