| 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/context_header
|
|
|
19 |
|
|
|
20 |
Context header template.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"heading": "<h2>Page title</h2>",
|
|
|
25 |
"prefix": "Page prefix",
|
|
|
26 |
"hasadditionalbuttons": true,
|
|
|
27 |
"additionalbuttons": [
|
|
|
28 |
{
|
|
|
29 |
"url": "http://example.com",
|
|
|
30 |
"title": "Button title",
|
|
|
31 |
"formattedimage": "http://example.com/image.jpg",
|
|
|
32 |
"attributes": [
|
|
|
33 |
{
|
|
|
34 |
"name": "data-attribute",
|
|
|
35 |
"value": "attribute value"
|
|
|
36 |
},
|
|
|
37 |
{
|
|
|
38 |
"name": "class",
|
|
|
39 |
"value": "btn btn-primary"
|
|
|
40 |
}
|
|
|
41 |
]
|
|
|
42 |
}
|
|
|
43 |
]
|
|
|
44 |
}
|
|
|
45 |
}}
|
|
|
46 |
<div class="page-context-header d-flex align-items-center mb-2">
|
|
|
47 |
{{#imagedata}}
|
|
|
48 |
<div class="page-header-image">
|
|
|
49 |
{{{imagedata}}}
|
|
|
50 |
</div>
|
|
|
51 |
{{/imagedata}}
|
|
|
52 |
<div class="page-header-headings">
|
|
|
53 |
{{#prefix}}
|
|
|
54 |
<div class="text-muted text-uppercase small line-height-3">
|
|
|
55 |
{{{prefix}}}
|
|
|
56 |
</div>
|
|
|
57 |
{{/prefix}}
|
|
|
58 |
{{{heading}}}
|
|
|
59 |
</div>
|
|
|
60 |
{{#hasadditionalbuttons}}
|
|
|
61 |
<div class="btn-group header-button-group mx-3">
|
|
|
62 |
{{#additionalbuttons}}
|
|
|
63 |
<a href="{{url}}" {{#attributes}} {{name}}="{{value}}" {{/attributes}}>
|
|
|
64 |
{{#page}}
|
|
|
65 |
{{#pix}}{{formattedimage}}{{/pix}}
|
|
|
66 |
<span class="header-button-title">{{title}}</span>
|
|
|
67 |
{{/page}}
|
|
|
68 |
{{^page}}
|
|
|
69 |
<img src="{{formattedimage}}" alt="{{title}}">
|
|
|
70 |
{{/page}}
|
|
|
71 |
</a>
|
|
|
72 |
{{/additionalbuttons}}
|
|
|
73 |
</div>
|
|
|
74 |
{{/hasadditionalbuttons}}
|
|
|
75 |
</div>
|