| 1 |
efrain |
1 |
{{!
|
| 1441 |
ariadna |
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
4 |
it under the terms of the GNU General Public License as published by
|
|
|
5 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
6 |
(at your option) any later version.
|
|
|
7 |
Moodle is distributed in the hope that it will be useful,
|
|
|
8 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
GNU General Public License for more details.
|
|
|
11 |
You should have received a copy of the GNU General Public License
|
|
|
12 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13 |
}}
|
|
|
14 |
{{!
|
| 1 |
efrain |
15 |
@template core/block
|
|
|
16 |
|
|
|
17 |
Example context (json):
|
|
|
18 |
{
|
|
|
19 |
"id": "block0",
|
|
|
20 |
"class": "block block_html",
|
|
|
21 |
"showskiplink": true,
|
|
|
22 |
"type": "html",
|
| 1441 |
ariadna |
23 |
"ariarole": "",
|
|
|
24 |
"showtitle": true,
|
| 1 |
efrain |
25 |
"title": "Test block",
|
|
|
26 |
"blockinstanceid": 1,
|
|
|
27 |
"content": "<p>Hello block world!</p>"
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
}}
|
|
|
31 |
{{! Block Skip Link }}
|
|
|
32 |
{{#showskiplink}}
|
| 1441 |
ariadna |
33 |
<a href="#sb-{{skipid}}" class="visually-hidden-focusable">{{#str}}skipa, access, {{{title}}}{{/str}}</a>
|
| 1 |
efrain |
34 |
{{/showskiplink}}
|
|
|
35 |
|
|
|
36 |
{{! Start Block Container }}
|
|
|
37 |
<section id="{{id}}"
|
|
|
38 |
class="{{#hidden}}hidden{{/hidden}} {{class}} {{#hascontrols}}block_with_controls{{/hascontrols}} card mb-3"
|
| 1441 |
ariadna |
39 |
{{#ariarole}}role="{{.}}"{{/ariarole}}
|
| 1 |
efrain |
40 |
data-block="{{type}}"
|
|
|
41 |
data-instance-id="{{blockinstanceid}}"
|
|
|
42 |
{{#arialabel}}
|
|
|
43 |
aria-label="{{arialabel}}"
|
|
|
44 |
{{/arialabel}}
|
|
|
45 |
{{^arialabel}}
|
| 1441 |
ariadna |
46 |
{{#showtitle}}
|
| 1 |
efrain |
47 |
aria-labelledby="instance-{{blockinstanceid}}-header"
|
| 1441 |
ariadna |
48 |
{{/showtitle}}
|
| 1 |
efrain |
49 |
{{/arialabel}}>
|
|
|
50 |
|
|
|
51 |
{{! Block contents }}
|
|
|
52 |
<div class="card-body p-3">
|
|
|
53 |
|
|
|
54 |
{{! Block header }}
|
| 1441 |
ariadna |
55 |
{{#showtitle}}
|
| 1 |
efrain |
56 |
<h3 id="instance-{{blockinstanceid}}-header" class="h5 card-title d-inline">{{{title}}}</h3>
|
| 1441 |
ariadna |
57 |
{{/showtitle}}
|
| 1 |
efrain |
58 |
|
|
|
59 |
{{#hascontrols}}
|
| 1441 |
ariadna |
60 |
<div class="block-controls float-end header">
|
| 1 |
efrain |
61 |
{{{controls}}}
|
|
|
62 |
</div>
|
|
|
63 |
{{/hascontrols}}
|
|
|
64 |
|
|
|
65 |
<div class="card-text content mt-3">
|
|
|
66 |
{{{content}}}
|
|
|
67 |
<div class="footer">{{{footer}}}</div>
|
|
|
68 |
{{{annotation}}}
|
|
|
69 |
</div>
|
|
|
70 |
|
|
|
71 |
</div>
|
|
|
72 |
|
|
|
73 |
{{! End Block Container }}
|
|
|
74 |
</section>
|
|
|
75 |
|
|
|
76 |
{{! Block Skip Link Target }}
|
|
|
77 |
{{#showskiplink}}
|
|
|
78 |
<span id="sb-{{skipid}}"></span>
|
|
|
79 |
{{/showskiplink}}
|