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