Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt some z3cform widgets #260

Merged
merged 6 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions src/osha/oira/ploneintranet/z3cform/templates/checkbox_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
tal:omit-tag=""
i18n:domain="nuplone"
>
<fieldset class="group ${view/@@dependencies}">
<legend>${python: view.items[0]['label']}</legend>
<label class="pat-checklist"
tal:repeat="item view/items"
><input class="${view/klass}"
<fieldset class="pat-toggle-switch group ${view/@@dependencies}">
<p class="legend">
${python: view.items[0]['label']}
</p>
<label tal:repeat="item view/items">${view/field/label_content|nothing}<input class="${view/klass}"
id="${view/id}"
checked="${python:'checked' if checked else None}"
disabled="${view/disabled}"
Expand All @@ -27,5 +27,18 @@
type="hidden"
value="1"
/>
<dfn class="help-icon pat-tooltip tooltip-inactive"
aria-expanded="false"
data-pat-tooltip="class: info; trigger: click; source: content; position-list: tl"
tal:define="
hidden python:view.mode == 'hidden';
description view/field/description;
"
tal:condition="python:description and not hidden"
tal:content="description"
>
</dfn>

</fieldset>

</html>
61 changes: 34 additions & 27 deletions src/osha/oira/ploneintranet/z3cform/templates/checkboxlist_input.pt
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:omit-tag=""
i18n:domain="nuplone"
tal:define="
dependencies nocall:view/@@dependencies;
data_pat_depends python:dependencies.data_pat_depends;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<fieldset class="group ${python: dependencies.ploneintranet_classes}"
data-pat-depends="${data_pat_depends}"
>
<legend>${view/label}</legend>
<label class="pat-checklist"
tal:repeat="item view/items"
><input class="${view/klass}"
id="${view/id}"
checked="${python:'checked' if checked else None}"
disabled="${view/disabled}"
name="${item/name}"
readonly="${view/readonly}"
type="checkbox"
value="${item/value}"
tal:define="
checked item/checked;
"
/><tal:label replace="item/label"
i18n:domain="plone"
i18n:translate=""
/></label>
<tal:error condition="view/error"
replace="structure view/error/render|nothing"
/>
<input name="${view/name}-empty-marker"
type="hidden"
value="1"
/>
<p class="legend">${view/label}</p>
<div class="pat-checklist">
<label tal:repeat="item view/items">
${item/label}
<input id="${item/id}"
checked="${python:'checked' if checked else None}"
disabled="${view/disabled}"
name="${item/name}"
readonly="${view/readonly}"
type="checkbox"
value="${item/value}"
tal:define="
checked item/checked;
"
/>
</label>
<tal:error condition="view/error"
replace="structure view/error/render|nothing"
/>
<input name="${view/name}-empty-marker"
type="hidden"
value="1"
/>
</div>
<dfn class="infoPanel"
title="Information"
tal:define="
description view/field/description;
"
tal:condition="description"
i18n:attributes="title"
>${description}</dfn>
</fieldset>
</html>
52 changes: 25 additions & 27 deletions src/osha/oira/ploneintranet/z3cform/templates/radio_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,30 @@
i18n:domain="nuplone"
>
<fieldset class="group ${view/@@dependencies}${python:' error' if view.error is not None else ''}">
<legend>${view/label}
<sup class="required"
tal:condition="view/required"
>*</sup></legend>
<p class="legend">${view/label}</p>
<div class="pat-checklist">
<label tal:repeat="item view/items">
${item/label}
<input id="${item/id}"
checked="${python:'checked' if checked else None}"
disabled="${view/disabled}"
name="${item/name}"
readonly="${view/readonly}"
type="radio"
value="${item/value}"
tal:define="
checked item/checked;
"
/>
</label>
<tal:error condition="view/error"
replace="structure view/error/render|nothing"
/>
<input name="${view/name}-empty-marker"
type="hidden"
value="1"
/>
</div>
<dfn class="infoPanel"
title="Information"
tal:define="
Expand All @@ -17,28 +37,6 @@
tal:condition="description"
i18n:attributes="title"
>${description}</dfn>
<label class="pat-checklist"
tal:repeat="item view/items"
><input id="${item/id}"
checked="${python:'checked' if checked else None}"
disabled="${view/disabled}"
name="${item/name}"
readonly="${view/readonly}"
type="radio"
value="${item/value}"
tal:define="
checked item/checked;
"
/><tal:label replace="item/label"
i18n:domain="plone"
i18n:translate=""
/></label>
<tal:error condition="view/error"
replace="structure view/error/render|nothing"
/>
<input name="${view/name}-empty-marker"
type="hidden"
value="1"
/>

</fieldset>
</html>
21 changes: 13 additions & 8 deletions src/osha/oira/ploneintranet/z3cform/templates/text_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>

<label title="${view/field/description}">
<span tal:replace="view/label"></span>
${view/label}
<input class="${view/klass}"
id="${view/id}"
disabled="${view/disabled}"
Expand All @@ -18,12 +18,17 @@
type="${view/type|string:text}"
value="${view/value}"
/>
<dfn class="help-icon pat-tooltip tooltip-inactive"
aria-expanded="false"
data-pat-tooltip="class: info; trigger: click; source: content; position-list: tl"
tal:define="
hidden python:view.mode == 'hidden';
description view/field/description;
"
tal:condition="python:description and not hidden"
tal:content="description"
>
</dfn>

</label>
<section class="help"
tal:condition="view/error"
>
<div class="pat-message warning"
tal:content="structure view/error/render"
></div>
</section>
</html>
21 changes: 13 additions & 8 deletions src/osha/oira/ploneintranet/z3cform/templates/textarea_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
i18n:domain="nuplone"
>
<label title="${view/field/description}">
<span tal:replace="view/label"></span>
${view/label}
<textarea class="${view/klass}"
id="${view/id}"
cols="${view/cols}"
Expand All @@ -16,13 +16,18 @@
readonly="${view/readonly}"
rows="${view/rows}"
>${view/value}</textarea>
<dfn class="help-icon pat-tooltip tooltip-inactive"
aria-expanded="false"
data-pat-tooltip="class: info; trigger: click; source: content; position-list: tl"
tal:define="
hidden python:view.mode == 'hidden';
description view/field/description;
"
tal:condition="python:description and not hidden"
tal:content="description"
>
</dfn>

</label>
<section class="help"
tal:condition="view/error"
>
<div class="pat-message warning"
tal:content="structure view/error/render"
></div>
</section>

</html>
Loading