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 block_multiblock/accordion-bootstrap3
|
|
|
19 |
|
|
|
20 |
This template shows the multiple blocks in an accordion
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"multiblockid": 28,
|
|
|
25 |
"multiblock": [
|
|
|
26 |
{
|
|
|
27 |
"id": 1,
|
|
|
28 |
"title": "Block 1",
|
|
|
29 |
"content": "<p>Block 1</p>",
|
|
|
30 |
"footer": "My footer",
|
|
|
31 |
"active": true
|
|
|
32 |
},
|
|
|
33 |
{
|
|
|
34 |
"id": 2,
|
|
|
35 |
"title": "Block 2",
|
|
|
36 |
"content": "<p>Block 2</p>",
|
|
|
37 |
"footer": "",
|
|
|
38 |
"active": false
|
|
|
39 |
}
|
|
|
40 |
]
|
|
|
41 |
}
|
|
|
42 |
}}
|
|
|
43 |
<div class="multiblock multiblock-accordion panel-group" role="tablist" id="multiblock-{{multiblockid}}">
|
|
|
44 |
{{#multiblock}}
|
|
|
45 |
<div class="panel panel-default">
|
|
|
46 |
<div class="panel-heading" id="multiblock-container-{{multiblockid}}-{{id}}" role="tab">
|
|
|
47 |
<h5 class="panel-title">
|
|
|
48 |
<a class="{{^active}} collapsed{{/active}}" data-toggle="collapse" data-target="#multiblock-content-{{multiblockid}}-{{id}}" aria-expanded="{{#active}}true{{/active}}{{^active}}false{{/active}}" aria-controls="multiblock-content-{{multiblockid}}-{{id}}" role="button">{{{title}}}</a>
|
|
|
49 |
</h5>
|
|
|
50 |
</div>
|
|
|
51 |
<div id="multiblock-content-{{multiblockid}}-{{id}}" class="panel-collapse collapse{{#active}} in{{/active}}" role="tabpanel" aria-labelledby="multiblock-container-{{multiblockid}}-{{id}}" data-parent="#multiblock-{{multiblockid}}">
|
|
|
52 |
<div class="panel-body {{class}}">
|
|
|
53 |
{{{content}}}
|
|
|
54 |
<div class="footer">{{{footer}}}</div>
|
|
|
55 |
{{{annotation}}}
|
|
|
56 |
</div>
|
|
|
57 |
</div>
|
|
|
58 |
</div>
|
|
|
59 |
{{/multiblock}}
|
|
|
60 |
</div>
|