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

Implement dependencies for all the widgets #275

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<fieldset class="pat-toggle-switch group ${view/@@dependencies}">
<fieldset class="pat-toggle-switch group ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<p class="legend">
${python: view.items[0]['label']}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
xmlns:tal="http://xml.zope.org/namespaces/tal"
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}"
<fieldset class="group ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<p class="legend">${view/label}</p>
<div class="pat-checklist">
Expand Down
7 changes: 6 additions & 1 deletion src/osha/oira/ploneintranet/z3cform/templates/date_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<label class="${view/@@dependencies}${python:' error' if view.error is not None else ''}">
<label class="${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
${view/label}
<input id="${view/id}"
name="${view/name}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<label class="${view/@@dependencies}{python:' error' if view.error is not None else ''}">
<label class="${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
${view/label}
<input id="${view/id}"
name="${view/name}"
Expand Down
7 changes: 6 additions & 1 deletion src/osha/oira/ploneintranet/z3cform/templates/multi_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<fieldset class="concise multiWidget ${view/@@dependencies}">
<fieldset class="concise multiWidget ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<legend>${view/label}
<sup class="required"
tal:condition="view/required"
Expand Down
47 changes: 26 additions & 21 deletions src/osha/oira/ploneintranet/z3cform/templates/namedfile_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,33 @@
class="group ${view/@@dependencies}"
tal:define="
download_url view/download_url;
dependencies nocall:view/@@dependencies;
"
i18n:domain="nuplone"
>
<p class="legend">${view/label}</p>
<metal:help use-macro="view/@@quaive_form_macros/help_tooltip" />
<tal:has-file condition="view/allow_nochange">
<p class="floatAfter"><a href="${view/download_url}">${view/filename}</a>
(${view/file_size})</p>
<label><input name="${view/name}.action"
type="checkbox"
value="remove"
/>
<tal:span i18n:translate="">Remove file</tal:span></label>
</tal:has-file>
<input class="${view/klass}"
id="${view/id}"
disabled="${view/disabled}"
name="${view/name}"
readonly="${view/readonly}"
type="file"
/>
<tal:error condition="view/error"
replace="structure view/error/render|nothing"
/>
<div class="${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<p class="legend">${view/label}</p>
<metal:help use-macro="view/@@quaive_form_macros/help_tooltip" />
<tal:has-file condition="view/allow_nochange">
<p class="floatAfter"><a href="${view/download_url}">${view/filename}</a>
(${view/file_size})</p>
<label><input name="${view/name}.action"
type="checkbox"
value="remove"
/>
<tal:span i18n:translate="">Remove file</tal:span></label>
</tal:has-file>
<input class="${view/klass}"
id="${view/id}"
disabled="${view/disabled}"
name="${view/name}"
readonly="${view/readonly}"
type="file"
/>
<tal:error condition="view/error"
replace="structure view/error/render|nothing"
/>
</div>
</fieldset>
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
meta:interpolation="true"
tal:define="
download_url view/download_url;
dependencies nocall:view/@@dependencies;
"
i18n:domain="nuplone"
>
<fieldset class="group ${view/@@dependencies}">
<fieldset class="group ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<legend>${view/label}</legend>
<metal:help use-macro="view/@@quaive_form_macros/help_tooltip" />
<input class="${view/klass}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<fieldset class="concise ${view/@@dependencies}">
<fieldset class="concise ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<legend>${view/label}
<sup class="required"
tal:condition="view/required"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
>
<script src="++resource++orderedselect_input.js"
type="text/javascript"
></script>

<fieldset class="concicse ${view/@@dependencies}${python:' error' if view.error is not None else ''}">
<fieldset class="concicse ${dependencies/ploneintranet_classes}"
ale-rt marked this conversation as resolved.
Show resolved Hide resolved
data-pat-depends="${dependencies/data_pat_depends}"
>
<legend>${view/label}
<sup class="required"
tal:condition="view/required"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<span class="${view/@@dependencies}"
<span class="${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
tal:omit-tag="not:view/@@dependencies"
>
<label class="${python:'error' if view.error is not None else None}">${view/label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<span class="${view/@@dependencies}"
<span class="${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
tal:omit-tag="not:view/@@dependencies"
>
<label class="${python:'error' if view.error is not None else None}">${view/label}
Expand Down
26 changes: 13 additions & 13 deletions src/osha/oira/ploneintranet/z3cform/templates/quaive_form_macros.pt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
i18n:domain="nuplone"
>

<metal:dfn define-macro="help_tooltip">
<dfn class="help-icon pat-tooltip tooltip-inactive"
aria-expanded="false"
title="Information"
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"
i18n:attributes="title"
>${description}</dfn>
</metal:dfn>
<metal:dfn define-macro="help_tooltip">
<dfn class="help-icon pat-tooltip tooltip-inactive"
aria-expanded="false"
title="Information"
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"
i18n:attributes="title"
>${description}</dfn>
</metal:dfn>

</html>
7 changes: 6 additions & 1 deletion src/osha/oira/ploneintranet/z3cform/templates/radio_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<fieldset class="group ${view/@@dependencies}${python:' error' if view.error is not None else ''}">
<fieldset class="group ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<p class="legend">${view/label}</p>
<div class="pat-checklist">
<label tal:repeat="item view/items">
Expand Down
11 changes: 6 additions & 5 deletions src/osha/oira/ploneintranet/z3cform/templates/select_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<label class="pat-select has-value ${view/@@dependencies}${python:' error' if view.error is not None else ''}"
data-option="English"
data-option-value
data-value
<label class="pat-select ${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
${view/label}
${view/label}
<select class="has-value"
name="${view/name}"
data-value
Expand Down
9 changes: 7 additions & 2 deletions src/osha/oira/ploneintranet/z3cform/templates/text_input.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>

<label title="${view/field/description}">
<label class="${dependencies/ploneintranet_classes}"
title="${view/field/description}"
data-pat-depends="${dependencies/data_pat_depends}"
>
${view/label}
<input class="${view/klass}"
id="${view/id}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
i18n:domain="nuplone"
>
<label title="${view/field/description}">
<label class="${dependencies/ploneintranet_classes}"
title="${view/field/description}"
data-pat-depends="${dependencies/data_pat_depends}"
>
${view/label}
<textarea class="${view/klass}"
id="${view/id}"
Expand Down
53 changes: 30 additions & 23 deletions src/osha/oira/ploneintranet/z3cform/templates/textlines_display.pt
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:define="
dependencies nocall:view/@@dependencies;
"
tal:omit-tag=""
>
<legend>${view/label}</legend>
<span class=""
id=""
tal:attributes="
id view/id;
class view/klass;
style view/style;
title view/title;
lang view/lang;
onclick view/onclick;
ondblclick view/ondblclick;
onmousedown view/onmousedown;
onmouseup view/onmouseup;
onmouseover view/onmouseover;
onmousemove view/onmousemove;
onmouseout view/onmouseout;
onkeypress view/onkeypress;
onkeydown view/onkeydown;
onkeyup view/onkeyup;
"
><tal:block condition="view/value"
content="structure python:view.value.replace('\r\n', '<br/>')"
/></span>
<div class="${dependencies/ploneintranet_classes}"
data-pat-depends="${dependencies/data_pat_depends}"
>
<legend>${view/label}</legend>
<span class=""
id=""
tal:attributes="
id view/id;
class view/klass;
style view/style;
title view/title;
lang view/lang;
onclick view/onclick;
ondblclick view/ondblclick;
onmousedown view/onmousedown;
onmouseup view/onmouseup;
onmouseover view/onmouseover;
onmousemove view/onmousemove;
onmouseout view/onmouseout;
onkeypress view/onkeypress;
onkeydown view/onkeydown;
onkeyup view/onkeyup;
"
><tal:block condition="view/value"
content="structure python:view.value.replace('\r\n', '<br/>')"
/></span>
</div>
</html>
Loading
Loading