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/content
19
 
20
    Displays the complete course format.
21
 
22
    Example context (json):
23
    {
24
        "initialsection": {
25
                "num": 0,
26
                "id": 34,
27
                "cmlist": {
28
                    "cms": [
29
                        {
30
                            "cmitem": {
31
                                "cmformat": {
32
                                    "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Forum example</span></a>",
33
                                    "hasname": "true"
34
                                },
35
                                "id": 3,
36
                                "cmid": 3,
37
                                "module": "forum",
38
                                "extraclasses": "newmessages",
39
                                "anchor": "module-3"
40
                            }
41
                        }
42
                    ],
43
                    "hascms": true
44
                },
45
                "iscurrent": true,
46
                "summary": {
47
                    "summarytext": "Summary text!"
48
                }
49
            },
50
        "sections": [
51
            {
52
                "num": 1,
53
                "id": 35,
54
                "header": {
55
                    "name": "Section title",
1441 ariadna 56
                    "url": "#",
57
                    "headinglevel": 3
1 efrain 58
                },
59
                "cmlist": {
60
                    "cms": [
61
                        {
62
                            "cmitem": {
63
                                "cmformat": {
64
                                    "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Another forum</span></a>",
65
                                    "hasname": "true"
66
                                },
67
                                "id": 4,
68
                                "cmid": 4,
69
                                "module": "forum",
70
                                "extraclasses": "newmessages",
71
                                "anchor": "module-4"
72
                            }
73
                        }
74
                    ],
75
                    "hascms": true
76
                },
77
                "iscurrent": true,
78
                "summary": {
79
                    "summarytext": "Summary text!"
80
                }
81
            },
82
            {
83
                "num": 4,
84
                "id": 36,
85
                "header": {
86
                    "name": "Section 2 title",
1441 ariadna 87
                    "url": "#",
88
                    "headinglevel": 3
1 efrain 89
                },
90
                "cmlist": {
91
                    "cms": [
92
                        {
93
                            "cmitem": {
94
                                "cmformat": {
95
                                    "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Forum example</span></a>",
96
                                    "hasname": "true"
97
                                },
98
                                "id": 5,
99
                                "cmid": 5,
100
                                "module": "forum",
101
                                "extraclasses": "newmessages",
102
                                "anchor": "module-5"
103
                            }
104
                        }
105
                    ],
106
                    "hascms": true
107
                },
108
                "iscurrent": true,
109
                "summary": {
110
                    "summarytext": "Summary text!"
111
                }
112
            }
113
        ],
114
        "format": "topics",
115
        "title": "Course title example",
116
            "hasnavigation": true,
117
            "sectionnavigation": {
118
            "hasprevious": true,
119
            "previousurl": "#",
120
            "larrow": "&#x25C4;",
121
            "previousname": "Section 3",
122
            "hasnext": true,
123
            "rarrow": "&#x25BA;",
124
            "nexturl": "#",
125
            "nextname": "Section 5"
126
        },
127
        "sectionselector": {
128
            "hasprevious": true,
129
            "previousurl": "#",
130
            "larrow": "&#x25C4;",
131
            "previousname": "Section 3",
132
            "hasnext": true,
133
            "rarrow": "&#x25BA;",
134
            "nexturl": "#",
135
            "nextname": "Section 5",
136
            "selector": "<select><option>Section 4</option></select>"
137
        },
138
        "sectionreturn": 1,
139
        "singlesection": {
140
            "num": 5,
141
            "id": 37,
142
            "header": {
143
                "name": "Single Section Example",
1441 ariadna 144
                "url": "#",
145
                "headinglevel": 3
1 efrain 146
            },
147
            "cmlist": {
148
                "cms": [
149
                    {
150
                        "cmitem": {
151
                            "cmformat": {
152
                                "cmname": "<a class=\"aalink\" href=\"#\"><span class=\"instancename\">Assign example</span></a>",
153
                                "hasname": "true"
154
                            },
155
                            "id": 6,
156
                            "cmid": 6,
157
                            "module": "assign",
158
                            "extraclasses": "",
159
                            "anchor": "module-6"
160
                        }
161
                    }
162
                ],
163
                "hascms": true
164
            },
165
            "iscurrent": true,
166
            "summary": {
167
                "summarytext": "Summary text!"
168
            }
169
        }
170
    }
171
}}
172
<div id="course-format-{{uniqid}}">
173
    <h2 class="accesshide">{{{title}}}</h2>
174
    {{{completionhelp}}}
1441 ariadna 175
    <ul class="{{format}} section-list" data-for="course_sectionlist">
1 efrain 176
        {{#initialsection}}
177
            {{$ core_courseformat/local/content/section }}
178
                {{> core_courseformat/local/content/section }}
179
            {{/ core_courseformat/local/content/section }}
180
        {{/initialsection}}
181
        {{#sections}}
182
            {{$ core_courseformat/local/content/section }}
183
                {{> core_courseformat/local/content/section }}
184
            {{/ core_courseformat/local/content/section }}
185
        {{/sections}}
186
    </ul>
187
    {{#hasnavigation}}
188
    <div class="single-section">
189
        {{#sectionnavigation}}
190
            {{$ core_courseformat/local/content/sectionnavigation }}
191
                {{> core_courseformat/local/content/sectionnavigation }}
192
            {{/ core_courseformat/local/content/sectionnavigation }}
193
        {{/sectionnavigation}}
1441 ariadna 194
        <ul class="{{format}} section-list">
1 efrain 195
        {{#singlesection}}
196
            {{$ core_courseformat/local/content/section }}
197
                {{> core_courseformat/local/content/section }}
198
            {{/ core_courseformat/local/content/section }}
199
        {{/singlesection}}
200
        </ul>
201
        {{#sectionselector}}
202
            {{$ core_courseformat/local/content/sectionselector }}
203
                {{> core_courseformat/local/content/sectionselector }}
204
            {{/ core_courseformat/local/content/sectionselector }}
205
        {{/sectionselector}}
206
    </div>
207
    {{/hasnavigation}}
208
    {{#numsections}}
209
        {{^singlesection}}
210
            {{$ core_courseformat/local/content/addsection}}
211
                {{> core_courseformat/local/content/addsection}}
212
            {{/ core_courseformat/local/content/addsection}}
213
        {{/singlesection}}
214
    {{/numsections}}
215
    {{#bulkedittools}}
216
        {{$ core_courseformat/local/content/bulkedittools}}
217
            {{> core_courseformat/local/content/bulkedittools}}
218
        {{/ core_courseformat/local/content/bulkedittools}}
219
    {{/bulkedittools}}
220
</div>
221
{{#js}}
222
require(['core_courseformat/local/content'], function(component) {
1441 ariadna 223
    component.init(
224
        '#page', {}, {{sectionreturn}}, {{#pagesectionid}}{{.}}{{/pagesectionid}}{{^pagesectionid}}null{{/pagesectionid}}
225
    );
1 efrain 226
});
227
{{/js}}