Proyectos de Subversion Moodle

Rev

| 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,
30
        "current": 1,
31
        "visible": 1,
32
        "hasrestrictions": 0,
33
        "cms": [
34
            {
35
                "id": 10,
36
                "name": "Glossary of characters",
37
                "url": "#",
38
                "visible": 1,
39
                "isactive": 0
40
            },
41
            {
42
                "id": 11,
43
                "name": "World Cinema forum",
44
                "url": "#",
45
                "visible": 1,
46
                "isactive": 0
47
            },
48
            {
49
                "id": 12,
50
                "name": "Announcements",
51
                "url": "#",
52
                "visible": 0,
53
                "isactive": 1
54
            }
55
        ]
56
    }
57
}}
58
<div
59
    class="courseindex-section {{#current}}current{{/current}}"
60
    id="course-index-section-{{id}}"
61
    data-for="section"
62
    data-id="{{id}}"
63
    data-number="{{number}}"
64
    role="treeitem"
65
    aria-owns="courseindexcollapse{{number}}"
66
>
67
    <div class="courseindex-item d-flex
68
            {{^visible}}dimmed{{/visible}}
69
            {{#hasrestrictions}}restrictions{{/hasrestrictions}}
70
            courseindex-section-title"
71
        id="courseindexsection{{number}}"
72
        data-for="section_item"
73
    >
74
        <a data-toggle="collapse"
75
            href="#courseindexcollapse{{number}}"
76
            class="courseindex-chevron icons-collapse-expand {{#indexcollapsed}}collapsed{{/indexcollapsed}}"
77
            aria-expanded="{{^indexcollapsed}}true{{/indexcollapsed}}{{#indexcollapsed}}false{{/indexcollapsed}}"
78
            aria-controls="courseindexcollapse{{number}}"
79
            tabindex="-1"
80
        >
81
            <span class="collapsed-icon icon-no-margin mr-3"
82
                title="{{#str}} expand, core {{/str}}">
83
                <span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core {{/pix}}</span>
84
                <span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core {{/pix}}</span>
85
                <span class="sr-only">{{#str}} expand, core {{/str}}</span>
86
            </span>
87
            <span class="expanded-icon icon-no-margin mr-3"
88
                title="{{#str}} collapse, core {{/str}}">
89
                {{#pix}} t/expandedchevron, core {{/pix}}
90
                <span class="sr-only">{{#str}} collapse, core {{/str}}</span>
91
            </span>
92
        </a>
93
        <a href="{{{sectionurl}}}"
94
            class="courseindex-link"
95
            data-action="togglecourseindexsection"
96
            data-for="section_title"
97
            tabindex="-1"
98
        >
99
            {{{title}}}
100
        </a>
101
        <span class="current-badge badge badge-xs badge-primary ml-2">
102
            {{highlighted}}
103
        </span>
104
        <span class="courseindex-locked ml-1" data-for="cm_name">
105
            {{#pix}} t/locked, core {{/pix}}
106
        </span>
107
        <span class="dragicon ml-auto">{{#pix}}i/dragdrop{{/pix}}</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) {
122
    component.init('course-index-section-{{id}}');
123
});
124
{{/js}}