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/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
|
|
|
33 |
* get_content - string
|
|
|
34 |
* is_hidden - boolean
|
|
|
35 |
|
|
|
36 |
Example context (json):
|
|
|
37 |
{
|
|
|
38 |
"get_items": [
|
|
|
39 |
{
|
|
|
40 |
"has_action": true,
|
|
|
41 |
"action": "#",
|
|
|
42 |
"get_title": "Test title",
|
|
|
43 |
"get_content": "First & fresh",
|
|
|
44 |
"is_hidden": false
|
|
|
45 |
},
|
|
|
46 |
{
|
|
|
47 |
"has_action": true,
|
|
|
48 |
"action": "#",
|
|
|
49 |
"get_title": "Second item & a title",
|
|
|
50 |
"get_content": "Second item",
|
|
|
51 |
"is_hidden": false
|
|
|
52 |
},
|
|
|
53 |
{
|
|
|
54 |
"has_action": false,
|
|
|
55 |
"get_content": "Third item",
|
|
|
56 |
"is_hidden": false
|
|
|
57 |
},
|
|
|
58 |
{
|
|
|
59 |
"has_action": false,
|
|
|
60 |
"get_content": "Fourth & last",
|
|
|
61 |
"is_hidden": true
|
|
|
62 |
}
|
|
|
63 |
]
|
|
|
64 |
}
|
|
|
65 |
}}
|
|
|
66 |
<nav aria-label="{{#str}}breadcrumb, access{{/str}}">
|
|
|
67 |
<ol class="breadcrumb">{{!
|
|
|
68 |
}}{{#get_items}}
|
|
|
69 |
{{#has_action}}
|
|
|
70 |
<li class="breadcrumb-item{{#is_hidden}} dimmed_text{{/is_hidden}} {{#is_last}}breadcrumb-item--last{{/is_last}}">
|
|
|
71 |
<a href="{{{action}}}" {{#is_last}}aria-current="page"{{/is_last}} {{#get_title}}title="{{get_title}}"{{/get_title}}><span class="text-truncate">{{{get_content}}}</span></a>
|
|
|
72 |
</li>
|
|
|
73 |
{{/has_action}}
|
|
|
74 |
{{^has_action}}
|
|
|
75 |
<li class="breadcrumb-item{{#is_hidden}} dimmed_text{{/is_hidden}}"><span class="breadcrumbs-textonly"><span class="text-truncate">{{{text}}}</span></span></li>
|
|
|
76 |
{{/has_action}}
|
|
|
77 |
{{/get_items}}{{!
|
|
|
78 |
}}</ol>
|
|
|
79 |
</nav>
|