MDL-59613 course: Add dropdown menu for activity list
[moodle.git] / course / templates / activity_navigation.mustache
CommitLineData
d8cb4615
MN
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_course/activity_navigation
19
20 Displays the activity navigation
21
22 Context variables required for this template:
ed765cfa
JP
23 * prevlink Object - The action link data for the previous activity link. Corresponds with the core/action_link context.
24 * nextlink Object - The action link data for the next activity link. Corresponds with the core/action_link context.
4698e169 25 * activitylist Object - The data for the activity selector menu. Corresponds with the core/url_select context.
d8cb4615
MN
26
27 Example context (json):
28 {
ed765cfa
JP
29 "prevlink": {
30 "disabled": false,
31 "url": "#",
32 "id": "test-id-1",
33 "classes": "btn btn-link",
34 "attributes": [
35 {
36 "name": "title",
37 "value": "Activity A"
38 }
39 ],
40 "text": "◄ Activity A"
41 },
42 "nextlink": {
43 "disabled": false,
44 "url": "#",
45 "id": "test-id-2",
46 "classes": "btn btn-link",
47 "attributes": [
48 {
49 "name": "title",
50 "value": "Activity C"
51 }
52 ],
53 "text": "Activity C ►"
4698e169
JP
54 },
55 "activitylist": {
56 "id": "url_select_test",
57 "action": "#",
58 "options": [
59 {"name": "Jump to...", "value": "#0"},
60 {"name": "Activity A", "value": "#1"},
61 {"name": "Activity B", "value": "#2"},
62 {"name": "Activity C", "value": "#3"}
63 ]
ed765cfa 64 }
d8cb4615
MN
65 }
66}}
4698e169 67<div class="m-t-2 m-b-1">
d8cb4615
MN
68{{< core/columns-1to1to1}}
69 {{$column1}}
70 <div class="pull-left">
ed765cfa 71 {{#prevlink}}{{> core/action_link }}{{/prevlink}}
d8cb4615
MN
72 </div>
73 {{/column1}}
4698e169
JP
74 {{$column2}}
75 <div class="mdl-align">
76 {{#activitylist}}{{> core/url_select }}{{/activitylist}}
77 </div>
78 {{/column2}}
d8cb4615
MN
79 {{$column3}}
80 <div class="pull-right">
ed765cfa 81 {{#nextlink}}{{> core/action_link }}{{/nextlink}}
d8cb4615
MN
82 </div>
83 {{/column3}}
84{{/ core/columns-1to1to1}}
85</div>