Skip to content

Commit

Permalink
Merge pull request #260 from euphorie/scrum-2369-adapt-widgets
Browse files Browse the repository at this point in the history
Adapt some z3cform widgets
  • Loading branch information
ale-rt committed Jul 9, 2024
2 parents 57456a5 + ec85de9 commit 6f5a15e
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 75 deletions.
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>

0 comments on commit 6f5a15e

Please sign in to comment.