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_imageboard/image
|
|
|
19 |
Template to show an image on the imagebord.
|
|
|
20 |
|
|
|
21 |
Example context (json):
|
|
|
22 |
{
|
|
|
23 |
"title": "",
|
|
|
24 |
"url": "https://example.com",
|
|
|
25 |
"newwindow": 1,
|
|
|
26 |
"xposition": "400",
|
|
|
27 |
"yposition": "200",
|
|
|
28 |
"targetwidth": "0",
|
|
|
29 |
"targetheight": "0",
|
|
|
30 |
"fontsize": "12",
|
|
|
31 |
"titlecolor": "#00ff00",
|
|
|
32 |
"titlebackgroundcolor": "#0000ff",
|
|
|
33 |
"imageurl": "http://localhost/image.png",
|
|
|
34 |
"nr": 1,
|
|
|
35 |
"bordercolor": "#2D57FA",
|
|
|
36 |
"border": "4"
|
|
|
37 |
}
|
|
|
38 |
}}
|
|
|
39 |
|
|
|
40 |
<div id="imageid_{{nr}}" style="position: absolute;{{!
|
|
|
41 |
}}z-index: 5;{{!
|
|
|
42 |
}}left: {{xposition}}px;{{!
|
|
|
43 |
}}top: {{yposition}}px;{{!
|
|
|
44 |
}}{{#targetwidth}}width: {{.}}px;{{/targetwidth}}{{!
|
|
|
45 |
}}{{#targetheight}}height: {{.}}px;{{/targetheight}}{{!
|
|
|
46 |
}}">
|
|
|
47 |
{{#url}}<a href="{{{.}}}"{{#newwindow}} target="_blank"{{/newwindow}}>{{/url}}
|
|
|
48 |
{{#title}}
|
|
|
49 |
<div class="unilabel-imageboard-title rounded" style="position: absolute;{{!
|
|
|
50 |
}}z-index: 5;{{!
|
|
|
51 |
}}top: calc(-{{fontsize}}px - 10px);{{!
|
|
|
52 |
}}color: {{titlecolor}}; background-color: {{titlebackgroundcolor}};{{!
|
|
|
53 |
}}{{#fontsize}}font-size: {{.}}px;line-height: {{.}}px;padding: 5px;{{/fontsize}}{{!
|
|
|
54 |
}}white-space: nowrap;">
|
|
|
55 |
{{title}}
|
|
|
56 |
</div>
|
|
|
57 |
{{/title}}
|
|
|
58 |
{{#imageurl}}
|
|
|
59 |
<div class="unilabel-imageboard-image rounded" style="position: relative;{{!
|
|
|
60 |
}}z-index: 5;{{!
|
|
|
61 |
}}{{#targetwidth}}width: {{.}}px; {{/targetwidth}}{{!
|
|
|
62 |
}}{{#targetheight}}height: {{.}}px; {{/targetheight}}{{!
|
|
|
63 |
}}">
|
|
|
64 |
<img class="rounded" src="{{{.}}}" title="{{title}}" alt="{{title}}" style="width: 100%;{{!
|
|
|
65 |
}}height: 100%;{{!
|
|
|
66 |
}}{{#border}}border: solid {{.}}px {{titlebackgroundcolor}};{{/border}}{{!
|
|
|
67 |
}}">
|
|
|
68 |
</div>
|
|
|
69 |
{{/imageurl}}
|
|
|
70 |
{{#url}}</a>{{/url}}
|
|
|
71 |
</div>
|
|
|
72 |
|