mapping_item.pt
3.16 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<div
tal:define="error_class error_class|field.widget.error_class;
description description|field.description;
title title|field.title;
oid oid|field.oid;
hidden hidden|field.widget.hidden;
category category|field.widget.category;
structural hidden or category == 'structural';
required required|field.required;"
class="${field.error and 'has-error' or ''} ${field.widget.item_css_class or ''} ${field.default_item_css_class()}"
title="${description}"
id="item-${oid}"
tal:omit-tag="structural"
i18n:domain="deform"
>
<!-- <div class="row">
<div class="col-md-12 col-lg-12 col-sm-12"> -->
<div tal:condition="not field.children" class="relative mb-2">
<div
tal:define="input_prepend field.widget.input_prepend | None;
input_append field.widget.input_append | None"
tal:omit-tag="not (input_prepend or input_append)"
>
<span tal:condition="input_prepend">${input_prepend}</span>
<span tal:replace="structure field.serialize(cstruct).strip()" />
<span tal:condition="input_append">${input_append}</span>
<label
for="${oid}"
class="absolute top-0 start-0 p-2.5 h-full text-sm truncate pointer-events-none transition ease-in-out duration-100 border border-transparent dark:text-white peer-disabled:opacity-50 peer-disabled:pointer-events-none peer-focus:text-xs peer-focus:-translate-y-1.5 peer-focus:text-gray-500 peer-[:not(:placeholder-shown)]:text-xs peer-[:not(:placeholder-shown)]:-translate-y-1.5 peer-[:not(:placeholder-shown)]:text-gray-500"
tal:condition="not structural"
id="req-${oid}"
>${title}
</label>
</div>
<p
tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()"
i18n:translate=""
tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"
>
${msg}
</p>
<p tal:condition="field.description and not field.widget.hidden">
${field.description}
</p>
</div>
<div tal:condition="field.children">
<div
tal:define="input_prepend field.widget.input_prepend | None;
input_append field.widget.input_append | None"
tal:omit-tag="not (input_prepend or input_append)"
>
<span tal:condition="input_prepend">${input_prepend}</span>
<span tal:replace="structure field.serialize(cstruct).strip()" />
<span tal:condition="input_append">${input_append}</span>
</div>
<p
tal:define="errstr 'error-%s' % field.oid"
tal:repeat="msg field.error.messages()"
i18n:translate=""
tal:attributes="id repeat.msg.index==0 and errstr or
('%s-%s' % (errstr, repeat.msg.index))"
tal:condition="field.error and not field.widget.hidden and not field.typ.__class__.__name__=='Mapping'"
>
${msg}
</p>
<p tal:condition="field.description and not field.widget.hidden">
${field.description}
</p>
</div>
</div>
<!-- </div>
</div> -->