Skip to content

Commit 57022d5

Browse files
feat(#2): 🚧 add unmodified widget.pt from plone.app.z3cform
1 parent c567e3f commit 57022d5

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div
2+
metal:define-macro="widget-wrapper"
3+
i18n:domain="plone"
4+
tal:define="widget nocall:context;
5+
error python:widget.error;
6+
error_class python:error and ' error' or '';
7+
empty_values python: (None, '', [], ('', '', '', '00', '00', ''), ('', '', ''));
8+
empty_class python: (widget.value in empty_values) and ' empty' or '';
9+
"
10+
id="formfield-${python:widget.id}"
11+
class="mb-3 field pat-inlinevalidation fieldname-${python:widget.name}} widget-mode-${python:widget.mode}${error_class}${empty_class} ${python:getattr(widget, 'wrapper_css_class', False) or False}"
12+
data-fieldname="${widget/name}"
13+
data-pat-inlinevalidation='{"type":"z3c.form"}'>
14+
<label for="${python:widget.id}"
15+
class="form-label"
16+
tal:condition="python: widget.mode == 'input' and widget.label">
17+
<span i18n:translate="" tal:replace="python:widget.label">label</span>
18+
19+
<span class="required" title="Required"
20+
tal:condition="python:widget.required"
21+
i18n:attributes="title title_required;"></span>
22+
</label>
23+
<b class="widget-label form-label d-block"
24+
tal:condition="python: widget.mode == 'display' and widget.label">
25+
<span i18n:translate="" tal:replace="python:widget.label">label</span>
26+
</b>
27+
28+
<input type="text" tal:replace="structure python:widget.render()"
29+
metal:define-slot="widget" />
30+
31+
<div tal:define="description python: getattr(widget, 'description', widget.field.description)"
32+
i18n:translate=""
33+
tal:content="structure description"
34+
tal:condition="python:description and widget.mode == 'input'"
35+
class="form-text">
36+
help text
37+
</div>
38+
39+
<div tal:condition="error"
40+
tal:replace="structure python:error.render() or False">
41+
Error
42+
</div>
43+
44+
</div>

0 commit comments

Comments
 (0)