-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate-image-text-table.html
59 lines (56 loc) · 2.99 KB
/
template-image-text-table.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$def with (slide)
$# This file belongs to the ICTV project, written by Nicolas Detienne,
$# Francois Michel, Maxime Piraux, Pierre Reinbold and Ludovic Taffin
$# at Université catholique de Louvain.
$#
$# Copyright (C) 2016-2018 Université catholique de Louvain (UCL, Belgium)
$#
$# ICTV is free software: you can redistribute it and/or modify
$# it under the terms of the GNU Affero General Public License as published
$# by the Free Software Foundation, either version 3 of the License, or
$# (at your option) any later version.
$#
$# ICTV is distributed in the hope that it will be useful,
$# but WITHOUT ANY WARRANTY; without even the implied warranty of
$# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
$# GNU Affero General Public License for more details.
$#
$# You should have received a copy of the GNU Affero General Public License
$# along with ICTV. If not, see <http://www.gnu.org/licenses/>.
$var name: Table with image and text
$var description: Adaptive template with a table containing images and texts
$var bg: $:background(content=slide, number=1, editor_default="/static/plugins/editor/images/beach.jpg")
$code:
def get_number_of_cells(slide_content):
slide_content = slide_content or {}
number = 1
while ('text-{}'.format(number)) in slide_content:
if ('image-{}'.format(number)) in slide_content:
number += 1
else:
break
return number - 1
$code:
template_id = get_template_id()
<style>
.content.$template_id table td img {
max-width: 128px;
}
</style>
<div class="logo logo-ucl">
$:logo(content=slide, number=1, editor_type="image", editor_placeholder="Choose a logo", editor_default="/static/plugins/editor/placeholders/270x350.png", editor_label="Logo", editor_order="5")
</div>
<div class="logo logo-fac">
$:logo(content=slide, number=2, editor_type="image", editor_placeholder="Choose a logo", editor_default="/static/plugins/editor/placeholders/270x350.png", editor_label="Logo", editor_order="5")
</div>
<div class="content bg-dark $template_id">
$:title(content=slide, number=1, max_chars=25, editor_type="text", editor_placeholder="Title", editor_label="Title", editor_default="Title", editor_order="1")
$:subtitle(content=slide, number=1, max_chars=130, editor_type="text", editor_placeholder="Subtitle", editor_label="Subtitle", editor_default="Subtitle", editor_order="2")
<table>
$for i in range(1, get_number_of_cells(slide) + 1):
<tr>
<td style="vertical-align: middle;">$:img(content=slide, number=i, editor_type="image", editor_placeholder="Choose an image", editor_label="Image", editor_default="/static/plugins/editor/placeholders/270x350.png", editor_order="4")</td>
<td>$:text(content=slide, number=i, max_chars=640, editor_type="textarea", editor_placeholder="Text",editor_label="Text", editor_default="Text", editor_order="3")</td>
</tr>
</table>
</div>