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 unilabeltype_collapsedtext/dialog
|
|
|
19 |
Template to show a bootstrap modal dialog.
|
|
|
20 |
|
|
|
21 |
Example context (json):
|
|
|
22 |
{
|
|
|
23 |
"title": "fdsfsdf",
|
|
|
24 |
"content": "<div><p>...</p></div>",
|
|
|
25 |
"useanimation": true
|
|
|
26 |
}
|
|
|
27 |
}}
|
|
|
28 |
|
|
|
29 |
<!-- Link to Open the Modal -->
|
|
|
30 |
<span class="unilabeltype-collapsed-dialog-button">
|
|
|
31 |
<a href="" data-toggle="modal" data-target="#unilabeltype-collapsed-dialog-{{uniqid}}">
|
|
|
32 |
{{title}}
|
|
|
33 |
</a>
|
|
|
34 |
</span>
|
|
|
35 |
<!-- The Modal -->
|
|
|
36 |
<div class="modal{{#useanimation}} fade{{/useanimation}}" tabindex="-1" id="unilabeltype-collapsed-dialog-{{uniqid}}">
|
|
|
37 |
<div class="modal-dialog modal-lg">
|
|
|
38 |
<div class="modal-content">
|
|
|
39 |
|
|
|
40 |
<!-- Modal Header -->
|
|
|
41 |
<div class="modal-header">
|
|
|
42 |
<h4 class="modal-title">{{title}}</h4>
|
|
|
43 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
44 |
</div>
|
|
|
45 |
|
|
|
46 |
<!-- Modal body -->
|
|
|
47 |
<div class="modal-body">
|
|
|
48 |
{{{content}}}
|
|
|
49 |
</div>
|
|
|
50 |
<!-- Modal footer -->
|
|
|
51 |
<div class="modal-footer">
|
|
|
52 |
<button type="button" class="btn btn-primary" data-dismiss="modal">{{#str}} closebuttontitle {{/str}}</button>
|
|
|
53 |
</div>
|
|
|
54 |
</div>
|
|
|
55 |
</div>
|
|
|
56 |
</div>
|
|
|
57 |
{{#js}}
|
|
|
58 |
require(['mod_unilabel/modal_helper'], function(modalhelper) {
|
|
|
59 |
modalhelper.init('#unilabeltype-collapsed-dialog-{{uniqid}}');
|
|
|
60 |
{{#openonstart}}
|
|
|
61 |
modalhelper.show('#unilabeltype-collapsed-dialog-{{uniqid}}');
|
|
|
62 |
{{/openonstart}}
|
|
|
63 |
});
|
|
|
64 |
{{/js}}
|