MDL-69549 core: Add context export API
[moodle.git] / lib / templates / content / export / course_index.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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/content/export/course_index
20     Renders content for a course index.
21     This template is not for use within moodle.
23     Classes required for JS:
24     * none
26     Data attributes required for JS:
27     * none
29     Context variables required for this template:
30     * global
32     Example context (json):
33     {
34         "global": {
35             "righttoleft": 0,
36             "language": "en",
37             "sitename": "Kevin's Emporium of fine course material",
38             "siteurl": "https://kevin.example.com",
39             "pathtotop": "./",
40             "contentexportfooter": "This file is part of the content downloaded from <a href='https://example.com'>Kevin's Emporium of fine course material</a> by Jennifer Collins on Tuesday, 24th February 2021, 12:21 am.",
41             "contentexportsummary": "This file is part of the content downloaded from <a href='https://example.com/course/view.php?id=4'>Kevin's Emporium of fine course material</a> on Tuesday, 24th February 2021, 12:21 am.",
42             "coursename": "Marketing 101",
43             "courseshortname": "MKT101",
44             "courselink": "https://example.com/course/view.php?id=4",
45             "exportdate": "Tuesday, 24th February 2021, 12:21 am",
46             "maxfilesize": "40MB"
47         },
48         "aboutpagelink": "./about.html",
49         "sections": [
50             {
51                 "title": "Welcome",
52                 "summary": "<p>Welcome to my <em>awesome</em> course.</p>",
53                 "activities": [
54                     {
55                         "title": "Data Structures - Arrays and Objects",
56                         "modname": "Assignment",
57                         "link": "./dsao_.1/index.html"
58                     },
59                     {
60                         "title": "Data Structures - Discussion",
61                         "modname": "Forum",
62                         "link": "./dsao_.2/index.html"
63                     },
64                     {
65                         "title": "Data Structures - Lecture Notes",
66                         "modname": "Folder",
67                         "link": "./dsao_.3/index.html"
68                     }
69                 ]
70             }
71         ]
72     }
73 }}
74 {{<core/content/export/external_page}}
75 {{$pagecontent}}
76     <div class="alert alert-info alert-block">
77         {{{global.contentexportsummary}}}
78     </div>
79     {{#aboutpagelink}}
80     <div>
81         <a href="{{{aboutpagelink}}}">{{#str}}contentexport_aboutthiscourse, core{{/str}}</a>
82     </div>
83     {{/aboutpagelink}}
85     {{#sections.0}}
86     <div>
87         {{#sections}}
88         <h3>{{{title}}}</h3>
89         {{#summary}}
90         <div>
91             {{{summary}}}
92         </div>
93         {{/summary}}
94         {{#activities.0}}
95         <ul>
96         {{#activities}}
97             <li><a href="{{{link}}}">{{{title}}} ({{{modname}}})</a></li>
98         {{/activities}}
99         </ul>
100         {{/activities.0}}
101         <hr>
102         {{/sections}}
103     </div>
104     {{/sections.0}}
105 {{/pagecontent}}
106 {{/core/content/export/external_page}}