Merge branch 'MDL-69251-311' of https://github.com/snake/moodle into MOODLE_311_STABLE
[moodle.git] / lib / templates / block.mustache
blob5215b480984343ba296a4958f47c51f919e21c66
1 {{!
2     @template core/block
4     Example context (json):
5     {
6         "id": "block0",
7         "class": "block block_html",
8         "showskiplink": true,
9         "type": "html",
10         "ariarole": "complementary",
11         "title": "Test block",
12         "blockinstanceid": 1,
13         "content": "<p>Hello block world!</p>"
14     }
17 {{! Block Skip Link }}
18 {{#showskiplink}}
19   <a href="#sb-{{skipid}}" class="sr-only sr-only-focusable">{{#str}}skipa, access, {{{title}}}{{/str}}</a>
20 {{/showskiplink}}
22 {{! Start Block Container }}
23 <section id="{{id}}"
24      class="{{#hidden}}hidden{{/hidden}} {{class}} {{#hascontrols}}block_with_controls{{/hascontrols}} card mb-3"
25      role="{{ariarole}}"
26      data-block="{{type}}"
27      {{#arialabel}}
28         aria-label="{{arialabel}}"
29      {{/arialabel}}
30      {{^arialabel}}
31         {{#title}}
32           aria-labelledby="instance-{{blockinstanceid}}-header"
33         {{/title}}
34      {{/arialabel}}>
36     {{! Block contents }}
37     <div class="card-body p-3">
39         {{! Block header }}
40         {{#title}}
41             <h5 id="instance-{{blockinstanceid}}-header" class="card-title d-inline">{{{title}}}</h5>
42         {{/title}}
44         {{#hascontrols}}
45             <div class="block-controls float-right header">
46                 {{{controls}}}
47             </div>
48         {{/hascontrols}}
50         <div class="card-text content mt-3">
51             {{{content}}}
52             <div class="footer">{{{footer}}}</div>
53             {{{annotation}}}
54         </div>
56     </div>
58 {{! End Block Container }}
59 </section>
61 {{! Block Skip Link Target }}
62 {{#showskiplink}}
63   <span id="sb-{{skipid}}"></span>
64 {{/showskiplink}}