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_grid/grid
|
|
|
19 |
Template to show a bootstrap modal dialog.
|
|
|
20 |
|
|
|
21 |
Example context (json):
|
|
|
22 |
{
|
|
|
23 |
"showintro": false,
|
|
|
24 |
"intro": "",
|
|
|
25 |
"columnssmall": 1,
|
|
|
26 |
"height": "300",
|
|
|
27 |
"autoheight": false,
|
|
|
28 |
"tiles": [
|
|
|
29 |
{
|
|
|
30 |
"id": "1",
|
|
|
31 |
"gridid": "1",
|
|
|
32 |
"title": "Title 1",
|
|
|
33 |
"url": "https://example.com",
|
|
|
34 |
"newwindow": 1,
|
|
|
35 |
"content": "<p>fdsafsdf<br><\/p>",
|
|
|
36 |
"imageurl": "https://url-to-image",
|
|
|
37 |
"imagemobileurl": "",
|
|
|
38 |
"nr": 0
|
|
|
39 |
},
|
|
|
40 |
{
|
|
|
41 |
"id": "2",
|
|
|
42 |
"gridid": "1",
|
|
|
43 |
"title": "Title 2",
|
|
|
44 |
"url": "",
|
|
|
45 |
"newwindow": 1,
|
|
|
46 |
"content": "<p>fdfdfdfdf<br><\/p>",
|
|
|
47 |
"imageurl": "https://url-to-image",
|
|
|
48 |
"imagemobileurl": "",
|
|
|
49 |
"nr": 1
|
|
|
50 |
}
|
|
|
51 |
],
|
|
|
52 |
"hastiles": true,
|
|
|
53 |
"cmid": "55",
|
|
|
54 |
"colclasses": "col-lg-3 col-md-6 col-sm-12"
|
|
|
55 |
}
|
|
|
56 |
}}
|
|
|
57 |
|
|
|
58 |
{{#showintro}}
|
|
|
59 |
{{{intro}}}
|
|
|
60 |
{{/showintro}}
|
|
|
61 |
{{#hastiles}}
|
|
|
62 |
<div class="row mx-0">
|
|
|
63 |
{{#tiles}}
|
|
|
64 |
<div class="text-center {{{colclasses}}} py-4">
|
|
|
65 |
<!-- The overlay is used as button to show the modal dialog -->
|
|
|
66 |
{{#url}}
|
|
|
67 |
<a href="{{{url}}}"{{#newwindow}} target="_blank"{{/newwindow}}>
|
|
|
68 |
<div class="unilabel-overlay-effect bg-primary h-100 w-100"></div>
|
|
|
69 |
</a>
|
|
|
70 |
{{/url}}
|
|
|
71 |
{{^url}}
|
|
|
72 |
<a href="#" data-toggle="modal" data-target="#grid-modal-{{cmid}}-{{nr}}">
|
|
|
73 |
<div class="unilabel-overlay-effect bg-primary h-100 w-100"></div>
|
|
|
74 |
</a>
|
|
|
75 |
{{/url}}
|
|
|
76 |
{{^autoheight}}<div style="height:{{{height}}}px;width:100%;">{{/autoheight}}
|
|
|
77 |
|
|
|
78 |
{{#imagemobileurl}}
|
|
|
79 |
{{#imageurl}}
|
|
|
80 |
<img class="img-fluid d-none d-md-inline" alt="{{title}}" src="{{{imageurl}}}"{{^autoheight}} style="height:100%;object-fit:contain;"{{/autoheight}}>
|
|
|
81 |
{{/imageurl}}
|
|
|
82 |
<img class="img-fluid d-inline d-md-none" alt="{{title}}" src="{{{imagemobileurl}}}"{{^autoheight}} style="height:100%;object-fit:contain;"{{/autoheight}}>
|
|
|
83 |
{{/imagemobileurl}}
|
|
|
84 |
{{^imagemobileurl}}
|
|
|
85 |
{{#imageurl}}
|
|
|
86 |
<img class="img-fluid" alt="{{title}}" src="{{{imageurl}}}"{{^autoheight}} style="height:100%;object-fit:contain;"{{/autoheight}}>
|
|
|
87 |
{{/imageurl}}
|
|
|
88 |
{{/imagemobileurl}}
|
|
|
89 |
|
|
|
90 |
{{^autoheight}}</div>{{/autoheight}}
|
|
|
91 |
<h5 class="unilabel-hyphens">{{title}}</h5>
|
|
|
92 |
</div>
|
|
|
93 |
{{/tiles}}
|
|
|
94 |
</div>
|
|
|
95 |
|
|
|
96 |
{{#tiles}}
|
|
|
97 |
{{^url}}
|
|
|
98 |
{{> unilabeltype_grid/dialog }}
|
|
|
99 |
{{/url}}
|
|
|
100 |
{{/tiles}}
|
|
|
101 |
{{/hastiles}}
|
|
|
102 |
{{^hastiles}}
|
|
|
103 |
<span>{{#str}} nocontent , unilabeltype_grid {{/str}}</span>
|
|
|
104 |
{{/hastiles}}
|