MDL-62142 navigation: accessibility
[moodle.git] / theme / boost / templates / core / navbar.mustache
CommitLineData
cf2bc269
JP
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/navbar
19
20 Navbar template.
21
22 Classes required for JS:
23 * none
24
25 Data attributes required for JS:
26 * none
27
28 Context variables required for this template:
29 * get_items - array of items
30 * has_action - boolean
31 * action - string
32 * get_title - string
f468f6d0 33 * get_content - string
8665cc33 34 * is_hidden - boolean
cf2bc269
JP
35
36 Example context (json):
37 {
38 "get_items": [
39 {
40 "has_action": true,
41 "action": "#",
42 "get_title": "Test title",
8665cc33
FS
43 "get_content": "First & fresh",
44 "is_hidden": false
cf2bc269
JP
45 },
46 {
47 "has_action": true,
48 "action": "#",
49 "get_title": "Second item & a title",
8665cc33
FS
50 "get_content": "Second item",
51 "is_hidden": false
cf2bc269
JP
52 },
53 {
54 "has_action": false,
8665cc33
FS
55 "get_content": "Third item",
56 "is_hidden": false
cf2bc269
JP
57 },
58 {
59 "has_action": false,
8665cc33
FS
60 "get_content": "Fourth & last",
61 "is_hidden": true
cf2bc269
JP
62 }
63 ]
64 }
65}}
9df03b19 66<nav role="navigation" aria-label="{{#str}}breadcrumb, access{{/str}}">
a4e2d645
DP
67 <ol class="breadcrumb">
68 {{#get_items}}
69 {{#has_action}}
8665cc33
FS
70 <li class="breadcrumb-item{{#is_hidden}} dimmed_text{{/is_hidden}}">
71 <a href="{{{action}}}" {{#get_title}}title="{{get_title}}"{{/get_title}}>{{{get_content}}}</a>
72 </li>
a4e2d645
DP
73 {{/has_action}}
74 {{^has_action}}
8665cc33 75 <li class="breadcrumb-item{{#is_hidden}} dimmed_text{{/is_hidden}}">{{{text}}}</li>
a4e2d645
DP
76 {{/has_action}}
77 {{/get_items}}
78 </ol>
79</nav>