-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify a mustache template from Moodle core
- Loading branch information
Showing
2 changed files
with
77 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{{! | ||
@template core/block | ||
Example context (json): | ||
{ | ||
"id": "block0", | ||
"class": "block block_html", | ||
"showskiplink": true, | ||
"type": "html", | ||
"ariarole": "complementary", | ||
"title": "Test block", | ||
"blockinstanceid": 1, | ||
"content": "<p>Hello block world!</p>" | ||
} | ||
|
||
}} | ||
{{! | ||
This template is a modified version of core/block | ||
Modifications compared to the original template: | ||
* Moved the block controls into the block footer. | ||
}} | ||
{{! Block Skip Link }} | ||
{{#showskiplink}} | ||
<a href="#sb-{{skipid}}" class="sr-only sr-only-focusable">{{#str}}skipa, access, {{{title}}}{{/str}}</a> | ||
{{/showskiplink}} | ||
|
||
{{! Start Block Container }} | ||
<section id="{{id}}" | ||
class="{{#hidden}}hidden{{/hidden}} {{class}} {{#hascontrols}}block_with_controls{{/hascontrols}} card mb-3" | ||
role="{{ariarole}}" | ||
data-block="{{type}}" | ||
data-instance-id="{{blockinstanceid}}" | ||
{{#arialabel}} | ||
aria-label="{{arialabel}}" | ||
{{/arialabel}} | ||
{{^arialabel}} | ||
{{#title}} | ||
aria-labelledby="instance-{{blockinstanceid}}-header" | ||
{{/title}} | ||
{{/arialabel}}> | ||
|
||
{{! Block contents }} | ||
<div class="card-body p-3"> | ||
|
||
{{! Block header }} | ||
{{#title}} | ||
<h5 id="instance-{{blockinstanceid}}-header" class="card-title d-inline">{{{title}}}</h5> | ||
{{/title}} | ||
|
||
<div class="card-text content mt-3"> | ||
{{{content}}} | ||
<div class="footer"> | ||
{{{footer}}} | ||
{{#hascontrols}} | ||
<div class="block-controls pt-3 mt-3 border-top"> | ||
{{{controls}}} | ||
</div> | ||
{{/hascontrols}} | ||
</div> | ||
{{{annotation}}} | ||
</div> | ||
|
||
</div> | ||
|
||
{{! End Block Container }} | ||
</section> | ||
|
||
{{! Block Skip Link Target }} | ||
{{#showskiplink}} | ||
<span id="sb-{{skipid}}"></span> | ||
{{/showskiplink}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters