-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#2): 🚧 add unmodified widget.pt from plone.app.z3cform
- Loading branch information
1 parent
c567e3f
commit 57022d5
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/spirit/plone/forms/browser/overrides/plone.app.z3cform.templates.widget.pt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<div | ||
metal:define-macro="widget-wrapper" | ||
i18n:domain="plone" | ||
tal:define="widget nocall:context; | ||
error python:widget.error; | ||
error_class python:error and ' error' or ''; | ||
empty_values python: (None, '', [], ('', '', '', '00', '00', ''), ('', '', '')); | ||
empty_class python: (widget.value in empty_values) and ' empty' or ''; | ||
" | ||
id="formfield-${python:widget.id}" | ||
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}" | ||
data-fieldname="${widget/name}" | ||
data-pat-inlinevalidation='{"type":"z3c.form"}'> | ||
<label for="${python:widget.id}" | ||
class="form-label" | ||
tal:condition="python: widget.mode == 'input' and widget.label"> | ||
<span i18n:translate="" tal:replace="python:widget.label">label</span> | ||
|
||
<span class="required" title="Required" | ||
tal:condition="python:widget.required" | ||
i18n:attributes="title title_required;"></span> | ||
</label> | ||
<b class="widget-label form-label d-block" | ||
tal:condition="python: widget.mode == 'display' and widget.label"> | ||
<span i18n:translate="" tal:replace="python:widget.label">label</span> | ||
</b> | ||
|
||
<input type="text" tal:replace="structure python:widget.render()" | ||
metal:define-slot="widget" /> | ||
|
||
<div tal:define="description python: getattr(widget, 'description', widget.field.description)" | ||
i18n:translate="" | ||
tal:content="structure description" | ||
tal:condition="python:description and widget.mode == 'input'" | ||
class="form-text"> | ||
help text | ||
</div> | ||
|
||
<div tal:condition="error" | ||
tal:replace="structure python:error.render() or False"> | ||
Error | ||
</div> | ||
|
||
</div> |