mapping_accordion.pt
1.63 KB
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
<tal:def tal:define="title title|field.title;
description description|field.description;
errormsg errormsg|field.errormsg;
open python:(field.widget.open or field.error) and True or False;
collapse_link_class python:open and '' or 'collapsed';
collapse_body_class python:open and 'in' or '';
item_template item_template|field.widget.item_template"
i18n:domain="deform">
<div class="panel panel-default" title="${description}">
<div class="panel-heading deform-collapse-heading">
<a
role="button"
data-toggle="collapse"
href="#collapse-${field.oid}"
tal:attributes="aria-expanded python:open and 'true' or None"
aria-controls="collapse-${field.oid}">
${title}
</a>
</div>
<div id="collapse-${field.oid}" class="panel-collapse deform-collapse-body collapse ${collapse_body_class}"
role="tabpanel" aria-labelledby="heading-${field.oid}">
<div class="panel-body">
<div tal:condition="errormsg"
class="clearfix alert alert-danger">
<p i18n:translate="">
There was a problem with this section
</p>
<p>${errormsg}</p>
</div>
<div tal:condition="description">
${description}
</div>
${field.start_mapping()}
<div tal:repeat="child field.children"
tal:replace="structure child.render_template(item_template)" >
</div>
${field.end_mapping()}
</div>
</div>
</div>
</tal:def>