--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_form/interfaces/templates/form.pt Fri May 18 15:54:52 2018 +0200
@@ -0,0 +1,180 @@
+<div class="modal-content">
+ <div class="modal-header"
+ tal:define="header provider:form_header">
+ <tal:if condition="header">
+ <tal:var replace="structure header" />
+ </tal:if>
+ <tal:if condition="not:header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
+ tal:condition="view.is_dialog">
+ <i class="fa fa-fw fa-times-circle"></i>
+ </button>
+ <h3 class="modal-title"
+ tal:define="config extension:configuration;">
+ <span class="title" tal:content="view.title | context.title | config.title">Title</span>
+ </h3>
+ <tal:var replace="structure provider:form_toolbar" />
+ </tal:if>
+ </div>
+ <div class="modal-body no-padding">
+ <div class="form-prefix"
+ tal:define="prefix provider:form_prefix"
+ tal:condition="prefix"
+ tal:content="structure prefix">Form prefix</div>
+ <form method="post"
+ data-async
+ tal:define="action view.get_form_action()"
+ tal:omit-tag="not:action"
+ tal:attributes="id view.id;
+ name view.name;
+ action action;
+ method view.method;
+ enctype view.enctype;
+ acceptCharset view.acceptCharset;
+ accept view.accept;
+ autocomplete view.autocomplete;
+ class view.css_class;
+ data-ams-data extension:object_data(view);
+ data-ams-form-handler view.get_ajax_handler() | nothing;
+ data-ams-form-options view.get_form_options() | nothing;
+ data-ams-form-submit-target view.form_target | nothing;
+ data-ams-form-download-target view.download_target | nothing;
+ data-ams-warn-on-change view.warn_on_change;">
+ <div class="modal-viewport"
+ tal:attributes="class 'modal-viewport {0}'.format(view.css_class if not action else '')">
+ <fieldset tal:attributes="class view.fieldset_class | default">
+ <legend tal:define="legend view.legend"
+ tal:condition="legend">
+ <i tal:attributes="class view.icon_css_class | nothing"></i>
+ <tal:var content="legend">Legend</tal:var>
+ <tal:var condition="python:getattr(view, 'show_widget_title', False)"
+ content="structure provider:pyams.widget_title" />
+ </legend>
+ <tal:var content="structure provider:form_help" />
+ <div class="widgets-prefix"
+ tal:omit-tag="getattr(view, 'hide_widgets_prefix_div', False)"
+ tal:define="prefix provider:widgets_prefix"
+ tal:condition="prefix"
+ tal:content="structure prefix">Widgets prefix</div>
+ <div class="clearfix"></div>
+ <tal:loop repeat="group view.groups">
+ <fieldset tal:define="legend group.legend"
+ tal:omit-tag="not:legend"
+ tal:attributes="class (group.fieldset_class or '') + (' bordered' if group.bordered else '')">
+ <tal:if condition="group.checkbox_switch">
+ <legend data-ams-checker-value="selected"
+ tal:condition="legend"
+ tal:attributes="class group.css_class;
+ data-ams-checker-fieldname '{0}:list'.format(group.checkbox_widget.name);
+ data-ams-checker-readonly 'readonly' if group.checkbox_widget.mode == 'display' else None;
+ data-ams-checker-mode 'disable' if group.checkbox_mode == 'disable' else None;
+ data-ams-checker-marker '{0}-empty-marker'.format(group.checkbox_widget.name);
+ data-ams-checker-state group.checker_state;">
+ <label tal:content="legend">Legend</label>
+ </legend>
+ </tal:if>
+ <tal:if condition="not:group.checkbox_switch">
+ <legend tal:condition="legend"
+ tal:content="legend"
+ tal:attributes="class group.css_class;
+ data-ams-switcher-state group.switcher_state;">Legend</legend>
+ </tal:if>
+ <tal:var define="help group.help" condition="help">
+ <div class="alert alert-info padding-5"
+ tal:define="i18n_help request.localizer.translate(help);"
+ tal:content="structure extension:html(i18n_help)"></div>
+ </tal:var>
+ <tal:loop repeat="widget group.visible_widgets">
+ <input type="hidden"
+ tal:condition="widget.mode == 'hidden'"
+ tal:replace="structure widget.render()" />
+ <tal:if condition="widget.mode != 'hidden'">
+ <div tal:define="required 'required-field' if widget.required and widget.label and (widget.mode != 'display') else ''"
+ tal:attributes="class string:${widget.group_css_class | group.group_css_class | view.group_css_class | 'form-group'} ${required}">
+ <label tal:attributes="class widget.label_css_class | group.label_css_class | view.label_css_class">
+ <span>
+ <tal:var content="widget.label" />
+ <i class="fa fa-question-circle hint" title="Input hint"
+ tal:define="description getattr(widget, 'description', widget.field.description)"
+ tal:condition="description"
+ tal:attributes="title description;
+ data-ams-hint-html '<' in description;"></i>
+ </span>
+ </label>
+ <div tal:attributes="class widget.input_css_class | group.input_css_class | view.input_css_class">
+ <label class="input"
+ tal:attributes="class widget.widget_css_class | default;
+ data-ams-data extension:object_data(widget);
+ data-ams-form-validator view.get_widget_callback(widget.field.getName())">
+ <div tal:define="notice widget.before_widget_notice | nothing"
+ tal:condition="notice"
+ tal:content="structure notice">Notice</div>
+ <input tal:replace="structure widget.render()" />
+ <div tal:define="notice widget.after_widget_notice | nothing"
+ tal:condition="notice"
+ tal:content="structure notice">Notice</div>
+ </label>
+ </div>
+ </div>
+ </tal:if>
+ </tal:loop>
+ </fieldset>
+ <div class="subforms"
+ tal:condition="group.subforms">
+ <fieldset tal:define="title group.subforms_legend"
+ tal:omit-tag="not:title">
+ <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+ <tal:loop repeat="subform group.subforms">
+ <tal:var replace="structure subform.render()" />
+ </tal:loop>
+ </fieldset>
+ </div>
+ </tal:loop>
+ <div class="widgets-suffix"
+ tal:omit-tag="getattr(view, 'hide_widgets_suffix_div', False)"
+ tal:define="suffix provider:widgets_suffix"
+ tal:condition="suffix"
+ tal:content="structure suffix">Widgets suffix</div>
+ <div class="subforms"
+ tal:condition="view.subforms">
+ <fieldset tal:define="title view.subforms_legend"
+ tal:omit-tag="not:title">
+ <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+ <tal:loop repeat="subform view.subforms">
+ <tal:var replace="structure subform.render()" />
+ </tal:loop>
+ </fieldset>
+ </div>
+ <div class="tabforms"
+ tal:condition="view.tabforms">
+ <ul class="nav nav-tabs">
+ <li tal:repeat="tabform view.tabforms"
+ tal:attributes="class 'small {active} {errors}'.format(active='active' if repeat['tabform'].start() else '',
+ errors='state-error' if tabform.widgets.errors else '')">
+ <a data-toggle="tab"
+ tal:attributes="href string:#${tabform.id};
+ data-ams-url python:getattr(tabform, 'tab_target', None);"
+ tal:content="tabform.tab_label" i18n:translate="">Tab label</a>
+ </li>
+ </ul>
+ <div class="tab-content bordered padding-x-10">
+ <div class="tab-pane fade in"
+ tal:repeat="tabform view.tabforms"
+ tal:attributes="id tabform.id;
+ class 'tab-pane {active} fade in'.format(active='active' if repeat['tabform'].start() else '');"
+ tal:content="structure tabform.render()"></div>
+ </div>
+ </div>
+ </fieldset>
+ </div>
+ <footer tal:condition="view.actions and (view.is_dialog or (view.mode == 'input'))">
+ <button tal:repeat="action view.actions.values()"
+ tal:replace="structure action.render()">Action</button>
+ </footer>
+ </form>
+ <div class="form-suffix"
+ tal:define="suffix provider:form_suffix"
+ tal:condition="suffix"
+ tal:content="structure suffix">Form suffix</div>
+ </div>
+</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_form/interfaces/templates/inner-form.pt Fri May 18 15:54:52 2018 +0200
@@ -0,0 +1,161 @@
+<div class="no-padding"
+ tal:attributes="class string:${view.css_class} ${view.padding_class | default};
+ id view.id;">
+ <div tal:define="prefix provider:form_prefix"
+ tal:replace="structure prefix">Form prefix</div>
+ <form method="post"
+ data-async
+ tal:define="action view.get_form_action()"
+ tal:omit-tag="not:action"
+ tal:attributes="id view.id;
+ name view.name;
+ action action;
+ method view.method;
+ enctype view.enctype;
+ acceptCharset view.acceptCharset;
+ accept view.accept;
+ autocomplete view.autocomplete;
+ class view.css_class;
+ data-ams-data extension:object_data(view);
+ data-ams-form-handler view.get_ajax_handler() | nothing;
+ data-ams-form-options view.get_form_options() | nothing;
+ data-ams-form-submit-target view.form_target | nothing;
+ data-ams-form-download-target view.download_target | nothing;
+ data-ams-warn-on-change view.warn_on_change;">
+ <fieldset tal:define="legend view.legend"
+ tal:attributes="class view.fieldset_class | nothing"
+ tal:omit-tag="not:legend">
+ <legend class="inner" tal:condition="legend"
+ tal:define="legend_class view.legend_class | nothing"
+ tal:attributes="class string:inner ${legend_class};
+ data-ams-switcher-state view.switcher_state | nothing;">
+ <i tal:attributes="class view.icon_css_class | nothing"></i>
+ <tal:var content="legend">Legend</tal:var>
+ <tal:var condition="python:getattr(view, 'show_widget_title', False)"
+ content="structure provider:pyams.widget_title" />
+ </legend>
+ <tal:var content="structure provider:form_help" />
+ <div class="widgets-prefix"
+ tal:omit-tag="getattr(view, 'hide_widgets_prefix_div', False)"
+ tal:define="prefix provider:widgets_prefix"
+ tal:condition="prefix"
+ tal:content="structure prefix">Widgets prefix</div>
+ <div class="clearfix"></div>
+ <tal:loop repeat="group view.groups">
+ <fieldset tal:define="legend group.legend"
+ tal:omit-tag="not:legend"
+ tal:attributes="class (group.fieldset_class or '') + (' bordered' if group.bordered else '')">
+ <tal:if condition="group.checkbox_switch">
+ <legend data-ams-checker-value="selected"
+ tal:condition="legend"
+ tal:attributes="class group.css_class;
+ data-ams-checker-fieldname '{0}:list'.format(group.checkbox_widget.name);
+ data-ams-checker-readonly 'readonly' if group.checkbox_widget.mode == 'display' else None;
+ data-ams-checker-mode 'disable' if group.checkbox_mode == 'disable' else None;
+ data-ams-checker-marker '{0}-empty-marker'.format(group.checkbox_widget.name);
+ data-ams-checker-state group.checker_state;">
+ <label tal:content="legend">Legend</label>
+ </legend>
+ </tal:if>
+ <tal:if condition="not:group.checkbox_switch">
+ <legend tal:condition="legend"
+ tal:content="legend"
+ tal:attributes="class group.css_class;
+ data-ams-switcher-state group.switcher_state;">Legend</legend>
+ </tal:if>
+ <tal:var define="help group.help" condition="help">
+ <div class="alert alert-info padding-5"
+ tal:define="i18n_help request.localizer.translate(help);"
+ tal:content="structure extension:html(i18n_help)"></div>
+ </tal:var>
+ <tal:loop repeat="widget group.visible_widgets">
+ <input type="hidden"
+ tal:condition="widget.mode == 'hidden'"
+ tal:replace="structure widget.render()" />
+ <tal:if condition="widget.mode != 'hidden'">
+ <div tal:define="required 'required-field' if widget.required and widget.label and (widget.mode != 'display') else ''"
+ tal:attributes="class string:${widget.group_css_class | group.group_css_class | view.group_css_class | 'form-group'} ${required}">
+ <label tal:attributes="class widget.label_css_class | group.label_css_class | view.label_css_class">
+ <span>
+ <tal:var content="widget.label" />
+ <i class="fa fa-question-circle hint" title="Input hint"
+ tal:define="description getattr(widget, 'description', widget.field.description)"
+ tal:condition="description"
+ tal:attributes="title description;
+ data-ams-hint-html '<' in description;"></i>
+ </span>
+ </label>
+ <div tal:attributes="class widget.input_css_class | group.input_css_class | view.input_css_class">
+ <label class="input"
+ tal:attributes="class widget.widget_css_class | default;
+ data-ams-form-validator view.get_widget_callback(widget.field.getName())">
+ <div tal:define="notice widget.before_widget_notice | nothing"
+ tal:condition="notice"
+ tal:content="structure notice">Notice</div>
+ <input tal:replace="structure widget.render()" />
+ <div tal:define="notice widget.after_widget_notice | nothing"
+ tal:condition="notice"
+ tal:content="structure notice">Notice</div>
+ </label>
+ </div>
+ </div>
+ </tal:if>
+ </tal:loop>
+ </fieldset>
+ <div class="subforms"
+ tal:condition="group.subforms">
+ <fieldset tal:define="title group.subforms_legend"
+ tal:omit-tag="not:title">
+ <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+ <tal:loop repeat="subform group.subforms">
+ <tal:var replace="structure subform.render()" />
+ </tal:loop>
+ </fieldset>
+ </div>
+ </tal:loop>
+ <div class="widgets-suffix"
+ tal:omit-tag="getattr(view, 'hide_widgets_suffix_div', False)"
+ tal:define="suffix provider:widgets_suffix"
+ tal:condition="suffix"
+ tal:content="structure suffix">Widgets suffix</div>
+ <div class="subforms"
+ tal:condition="view.subforms">
+ <fieldset tal:define="title view.subforms_legend"
+ tal:omit-tag="not:title">
+ <legend tal:condition="title" tal:content="title" i18n:translate="">legend</legend>
+ <tal:loop repeat="subform view.subforms">
+ <tal:var replace="structure subform.render()" />
+ </tal:loop>
+ </fieldset>
+ </div>
+ <div class="tabforms"
+ tal:condition="view.tabforms">
+ <ul class="nav nav-tabs">
+ <li tal:repeat="tabform view.tabforms"
+ tal:attributes="class '{active} {errors}'.format(active='active' if repeat['tabform'].start() else '',
+ errors='state-error' if tabform.widgets.errors else '')">
+ <a data-toggle="tab"
+ tal:attributes="href string:#${tabform.id};
+ data-ams-url python:getattr(tabform, 'tab_target', None);"
+ tal:content="tabform.tab_label" i18n:translate="">Tab label</a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane fade in"
+ tal:repeat="tabform view.tabforms"
+ tal:attributes="id tabform.id;
+ class 'tab-pane {active} fade in'.format(active='active' if repeat['tabform'].start() else '');"
+ tal:content="structure tabform.render()"></div>
+ </div>
+ </div>
+ </fieldset>
+ <footer tal:condition="view.actions and (view.is_dialog or (view.mode == 'input'))">
+ <button tal:repeat="action view.actions.values()"
+ tal:replace="structure action.render()">Action</button>
+ </footer>
+ </form>
+ <div class="form-suffix"
+ tal:define="suffix provider:form_suffix"
+ tal:condition="suffix"
+ tal:content="structure suffix">Form suffix</div>
+</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_form/interfaces/templates/widget-form.pt Fri May 18 15:54:52 2018 +0200
@@ -0,0 +1,156 @@
+<div class="ams-widget">
+ <header>
+ <span tal:condition="view.widget_icon_class | nothing"
+ class="widget-icon"><i tal:attributes="class view.widget_icon_class"></i>
+ </span>
+ <h2 tal:content="view.legend"></h2>
+ <tal:var content="structure provider:pyams.widget_title" />
+ <tal:var content="structure provider:pyams.toolbar" />
+ </header>
+ <div class="widget-body no-padding">
+ <div tal:define="prefix provider:form_prefix"
+ tal:replace="structure prefix">Form prefix</div>
+ <tal:var content="structure provider:form_help" />
+ <form method="post"
+ data-async
+ tal:attributes="id view.id;
+ name view.name;
+ action view.get_form_action();
+ method view.method;
+ enctype view.enctype;
+ acceptCharset view.acceptCharset;
+ accept view.accept;
+ autocomplete view.autocomplete;
+ class view.css_class;
+ data-ams-data extension:object_data(view);
+ data-ams-form-handler view.get_ajax_handler() | nothing;
+ data-ams-form-options view.get_form_options() | nothing;
+ data-ams-form-submit-target view.form_target | nothing;
+ data-ams-form-download-target view.download_target | nothing;
+ data-ams-warn-on-change view.warn_on_change;">
+ <div class="modal-viewport">
+ <fieldset>
+ <div class="widgets-prefix"
+ tal:omit-tag="getattr(view, 'hide_widgets_prefix_div', False)"
+ tal:define="prefix provider:widgets_prefix"
+ tal:condition="prefix"
+ tal:content="structure prefix">Widgets prefix</div>
+ <div class="clearfix"></div>
+ <tal:loop repeat="group view.groups">
+ <fieldset tal:define="legend group.legend"
+ tal:omit-tag="not:legend"
+ tal:attributes="class (group.fieldset_class or '') + (' bordered' if group.bordered else '')">
+ <tal:if condition="group.checkbox_switch">
+ <legend data-ams-checker-value="selected"
+ tal:condition="legend"
+ tal:attributes="class group.css_class;
+ data-ams-checker-fieldname '{0}:list'.format(group.checkbox_widget.name);
+ data-ams-checker-readonly 'readonly' if group.checkbox_widget.mode == 'display' else None;
+ data-ams-checker-mode 'disable' if group.checkbox_mode == 'disable' else None;
+ data-ams-checker-marker '{0}-empty-marker'.format(group.checkbox_widget.name);
+ data-ams-checker-state group.checker_state;">
+ <label tal:content="legend">Legend</label>
+ </legend>
+ </tal:if>
+ <tal:if condition="not:group.checkbox_switch">
+ <legend tal:condition="legend"
+ tal:content="legend"
+ tal:attributes="class group.css_class;
+ data-ams-switcher-state group.switcher_state;">Legend</legend>
+ </tal:if>
+ <tal:var define="help group.help" condition="help">
+ <div class="alert alert-info padding-5"
+ tal:define="i18n_help request.localizer.translate(help);"
+ tal:content="structure extension:html(i18n_help)"></div>
+ </tal:var>
+ <tal:loop repeat="widget group.visible_widgets">
+ <input type="hidden"
+ tal:condition="widget.mode == 'hidden'"
+ tal:replace="structure widget.render()" />
+ <tal:if condition="widget.mode != 'hidden'">
+ <div tal:define="required 'required-field' if widget.required and widget.label and (widget.mode != 'display') else ''"
+ tal:attributes="class string:${widget.group_css_class | group.group_css_class | view.group_css_class | 'form-group'} ${required}">
+ <label tal:attributes="class widget.label_css_class | group.label_css_class | view.label_css_class">
+ <span>
+ <tal:var content="widget.label" />
+ <i class="fa fa-question-circle hint" title="Input hint"
+ tal:define="description getattr(widget, 'description', widget.field.description)"
+ tal:condition="description"
+ tal:attributes="title description;
+ data-ams-hint-html '<' in description;"></i>
+ </span>
+ </label>
+ <div tal:attributes="class widget.input_css_class | group.input_css_class | view.input_css_class">
+ <label class="input"
+ tal:attributes="class widget.widget_css_class | default;
+ data-ams-form-validator view.get_widget_callback(widget.field.getName())">
+ <div tal:define="notice widget.before_widget_notice | nothing"
+ tal:condition="notice"
+ tal:content="structure notice">Notice</div>
+ <input tal:replace="structure widget.render()" />
+ <div tal:define="notice widget.after_widget_notice | nothing"
+ tal:condition="notice"
+ tal:content="structure notice">Notice</div>
+ </label>
+ </div>
+ </div>
+ </tal:if>
+ </tal:loop>
+ <div class="subforms"
+ tal:condition="group.subforms">
+ <fieldset tal:define="title group.subforms_legend"
+ tal:omit-tag="not:title">
+ <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+ <tal:loop repeat="subform group.subforms">
+ <tal:var replace="structure subform.render()" />
+ </tal:loop>
+ </fieldset>
+ </div>
+ </fieldset>
+ </tal:loop>
+ <div class="widgets-suffix"
+ tal:omit-tag="getattr(view, 'hide_widgets_suffix_div', False)"
+ tal:define="suffix provider:widgets_suffix"
+ tal:condition="suffix"
+ tal:content="structure suffix">Widgets suffix</div>
+ <div class="subforms"
+ tal:condition="view.subforms">
+ <fieldset tal:define="title view.subforms_legend"
+ tal:omit-tag="not:title">
+ <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
+ <tal:loop repeat="subform view.subforms">
+ <tal:var replace="structure subform.render()" />
+ </tal:loop>
+ </fieldset>
+ </div>
+ <div class="tabforms"
+ tal:condition="view.tabforms">
+ <ul class="nav nav-tabs">
+ <li tal:repeat="tabform view.tabforms"
+ tal:attributes="class 'small {active} {errors}'.format(active='active' if repeat['tabform'].start() else '',
+ errors='state-error' if tabform.widgets.errors else '')">
+ <a data-toggle="tab"
+ tal:attributes="href string:#${tabform.id};
+ data-ams-url python:getattr(tabform, 'tab_target', None);"
+ tal:content="tabform.tab_label" i18n:translate="">Tab label</a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane fade in"
+ tal:repeat="tabform view.tabforms"
+ tal:attributes="id tabform.id;
+ class 'tab-pane {active} fade in'.format(active='active' if repeat['tabform'].start() else '');"
+ tal:content="structure tabform.render()"></div>
+ </div>
+ </div>
+ </fieldset>
+ </div>
+ <footer tal:condition="view.actions and (view.is_dialog or (view.mode == 'input'))">
+ <button tal:repeat="action view.actions.values()"
+ tal:replace="structure action.render()">Action</button>
+ </footer>
+ </form>
+ <div tal:define="prefix provider:form_suffix"
+ tal:replace="structure prefix">Form suffix</div>
+ </div>
+</div>
--- a/src/pyams_form/templates/form.pt Thu May 03 11:34:51 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-<div class="modal-content">
- <div class="modal-header"
- tal:define="header provider:form_header">
- <tal:if condition="header">
- <tal:var replace="structure header" />
- </tal:if>
- <tal:if condition="not:header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true"
- tal:condition="view.is_dialog">
- <i class="fa fa-fw fa-times-circle"></i>
- </button>
- <h3 class="modal-title"
- tal:define="config extension:configuration;">
- <span class="title" tal:content="view.title | context.title | config.title">Title</span>
- </h3>
- <tal:var replace="structure provider:form_toolbar" />
- </tal:if>
- </div>
- <div class="modal-body no-padding">
- <div class="form-prefix"
- tal:define="prefix provider:form_prefix"
- tal:condition="prefix"
- tal:content="structure prefix">Form prefix</div>
- <form method="post"
- data-async
- tal:define="action view.get_form_action()"
- tal:omit-tag="not:action"
- tal:attributes="id view.id;
- name view.name;
- action action;
- method view.method;
- enctype view.enctype;
- acceptCharset view.acceptCharset;
- accept view.accept;
- autocomplete view.autocomplete;
- class view.css_class;
- data-ams-data extension:object_data(view);
- data-ams-form-handler view.get_ajax_handler() | nothing;
- data-ams-form-options view.get_form_options() | nothing;
- data-ams-form-submit-target view.form_target | nothing;
- data-ams-form-download-target view.download_target | nothing;
- data-ams-warn-on-change view.warn_on_change;">
- <div class="modal-viewport"
- tal:attributes="class 'modal-viewport {0}'.format(view.css_class if not action else '')">
- <fieldset tal:attributes="class view.fieldset_class | default">
- <legend tal:define="legend view.legend"
- tal:condition="legend">
- <i tal:attributes="class view.icon_css_class | nothing"></i>
- <tal:var content="legend">Legend</tal:var>
- <tal:var condition="python:getattr(view, 'show_widget_title', False)"
- content="structure provider:pyams.widget_title" />
- </legend>
- <tal:var content="structure provider:form_help" />
- <div class="widgets-prefix"
- tal:omit-tag="getattr(view, 'hide_widgets_prefix_div', False)"
- tal:define="prefix provider:widgets_prefix"
- tal:condition="prefix"
- tal:content="structure prefix">Widgets prefix</div>
- <div class="clearfix"></div>
- <tal:loop repeat="group view.groups">
- <fieldset tal:define="legend group.legend"
- tal:omit-tag="not:legend"
- tal:attributes="class (group.fieldset_class or '') + (' bordered' if group.bordered else '')">
- <tal:if condition="group.checkbox_switch">
- <legend data-ams-checker-value="selected"
- tal:condition="legend"
- tal:attributes="class group.css_class;
- data-ams-checker-fieldname '{0}:list'.format(group.checkbox_widget.name);
- data-ams-checker-readonly 'readonly' if group.checkbox_widget.mode == 'display' else None;
- data-ams-checker-mode 'disable' if group.checkbox_mode == 'disable' else None;
- data-ams-checker-marker '{0}-empty-marker'.format(group.checkbox_widget.name);
- data-ams-checker-state group.checker_state;">
- <label tal:content="legend">Legend</label>
- </legend>
- </tal:if>
- <tal:if condition="not:group.checkbox_switch">
- <legend tal:condition="legend"
- tal:content="legend"
- tal:attributes="class group.css_class;
- data-ams-switcher-state group.switcher_state;">Legend</legend>
- </tal:if>
- <tal:var define="help group.help" condition="help">
- <div class="alert alert-info padding-5"
- tal:define="i18n_help request.localizer.translate(help);"
- tal:content="structure extension:html(i18n_help)"></div>
- </tal:var>
- <tal:loop repeat="widget group.visible_widgets">
- <input type="hidden"
- tal:condition="widget.mode == 'hidden'"
- tal:replace="structure widget.render()" />
- <tal:if condition="widget.mode != 'hidden'">
- <div tal:define="required 'required-field' if widget.required and widget.label and (widget.mode != 'display') else ''"
- tal:attributes="class string:${widget.group_css_class | group.group_css_class | view.group_css_class | 'form-group'} ${required}">
- <label tal:attributes="class widget.label_css_class | group.label_css_class | view.label_css_class">
- <span>
- <tal:var content="widget.label" />
- <i class="fa fa-question-circle hint" title="Input hint"
- tal:define="description getattr(widget, 'description', widget.field.description)"
- tal:condition="description"
- tal:attributes="title description;
- data-ams-hint-html '<' in description;"></i>
- </span>
- </label>
- <div tal:attributes="class widget.input_css_class | group.input_css_class | view.input_css_class">
- <label class="input"
- tal:attributes="class widget.widget_css_class | default;
- data-ams-data extension:object_data(widget);
- data-ams-form-validator view.get_widget_callback(widget.field.getName())">
- <div tal:define="notice widget.before_widget_notice | nothing"
- tal:condition="notice"
- tal:content="structure notice">Notice</div>
- <input tal:replace="structure widget.render()" />
- <div tal:define="notice widget.after_widget_notice | nothing"
- tal:condition="notice"
- tal:content="structure notice">Notice</div>
- </label>
- </div>
- </div>
- </tal:if>
- </tal:loop>
- </fieldset>
- <div class="subforms"
- tal:condition="group.subforms">
- <fieldset tal:define="title group.subforms_legend"
- tal:omit-tag="not:title">
- <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
- <tal:loop repeat="subform group.subforms">
- <tal:var replace="structure subform.render()" />
- </tal:loop>
- </fieldset>
- </div>
- </tal:loop>
- <div class="widgets-suffix"
- tal:omit-tag="getattr(view, 'hide_widgets_suffix_div', False)"
- tal:define="suffix provider:widgets_suffix"
- tal:condition="suffix"
- tal:content="structure suffix">Widgets suffix</div>
- <div class="subforms"
- tal:condition="view.subforms">
- <fieldset tal:define="title view.subforms_legend"
- tal:omit-tag="not:title">
- <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
- <tal:loop repeat="subform view.subforms">
- <tal:var replace="structure subform.render()" />
- </tal:loop>
- </fieldset>
- </div>
- <div class="tabforms"
- tal:condition="view.tabforms">
- <ul class="nav nav-tabs">
- <li tal:repeat="tabform view.tabforms"
- tal:attributes="class 'small {active} {errors}'.format(active='active' if repeat['tabform'].start() else '',
- errors='state-error' if tabform.widgets.errors else '')">
- <a data-toggle="tab"
- tal:attributes="href string:#${tabform.id};
- data-ams-url python:getattr(tabform, 'tab_target', None);"
- tal:content="tabform.tab_label" i18n:translate="">Tab label</a>
- </li>
- </ul>
- <div class="tab-content bordered padding-x-10">
- <div class="tab-pane fade in"
- tal:repeat="tabform view.tabforms"
- tal:attributes="id tabform.id;
- class 'tab-pane {active} fade in'.format(active='active' if repeat['tabform'].start() else '');"
- tal:content="structure tabform.render()"></div>
- </div>
- </div>
- </fieldset>
- </div>
- <footer tal:condition="view.actions and (view.is_dialog or (view.mode == 'input'))">
- <button tal:repeat="action view.actions.values()"
- tal:replace="structure action.render()">Action</button>
- </footer>
- </form>
- <div class="form-suffix"
- tal:define="suffix provider:form_suffix"
- tal:condition="suffix"
- tal:content="structure suffix">Form suffix</div>
- </div>
-</div>
--- a/src/pyams_form/templates/inner-form.pt Thu May 03 11:34:51 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-<div class="no-padding"
- tal:attributes="class string:${view.css_class} ${view.padding_class | default};
- id view.id;">
- <div tal:define="prefix provider:form_prefix"
- tal:replace="structure prefix">Form prefix</div>
- <form method="post"
- data-async
- tal:define="action view.get_form_action()"
- tal:omit-tag="not:action"
- tal:attributes="id view.id;
- name view.name;
- action action;
- method view.method;
- enctype view.enctype;
- acceptCharset view.acceptCharset;
- accept view.accept;
- autocomplete view.autocomplete;
- class view.css_class;
- data-ams-data extension:object_data(view);
- data-ams-form-handler view.get_ajax_handler() | nothing;
- data-ams-form-options view.get_form_options() | nothing;
- data-ams-form-submit-target view.form_target | nothing;
- data-ams-form-download-target view.download_target | nothing;
- data-ams-warn-on-change view.warn_on_change;">
- <fieldset tal:define="legend view.legend"
- tal:attributes="class view.fieldset_class | nothing"
- tal:omit-tag="not:legend">
- <legend class="inner" tal:condition="legend"
- tal:define="legend_class view.legend_class | nothing"
- tal:attributes="class string:inner ${legend_class};
- data-ams-switcher-state view.switcher_state | nothing;">
- <i tal:attributes="class view.icon_css_class | nothing"></i>
- <tal:var content="legend">Legend</tal:var>
- <tal:var condition="python:getattr(view, 'show_widget_title', False)"
- content="structure provider:pyams.widget_title" />
- </legend>
- <tal:var content="structure provider:form_help" />
- <div class="widgets-prefix"
- tal:omit-tag="getattr(view, 'hide_widgets_prefix_div', False)"
- tal:define="prefix provider:widgets_prefix"
- tal:condition="prefix"
- tal:content="structure prefix">Widgets prefix</div>
- <div class="clearfix"></div>
- <tal:loop repeat="group view.groups">
- <fieldset tal:define="legend group.legend"
- tal:omit-tag="not:legend"
- tal:attributes="class (group.fieldset_class or '') + (' bordered' if group.bordered else '')">
- <tal:if condition="group.checkbox_switch">
- <legend data-ams-checker-value="selected"
- tal:condition="legend"
- tal:attributes="class group.css_class;
- data-ams-checker-fieldname '{0}:list'.format(group.checkbox_widget.name);
- data-ams-checker-readonly 'readonly' if group.checkbox_widget.mode == 'display' else None;
- data-ams-checker-mode 'disable' if group.checkbox_mode == 'disable' else None;
- data-ams-checker-marker '{0}-empty-marker'.format(group.checkbox_widget.name);
- data-ams-checker-state group.checker_state;">
- <label tal:content="legend">Legend</label>
- </legend>
- </tal:if>
- <tal:if condition="not:group.checkbox_switch">
- <legend tal:condition="legend"
- tal:content="legend"
- tal:attributes="class group.css_class;
- data-ams-switcher-state group.switcher_state;">Legend</legend>
- </tal:if>
- <tal:var define="help group.help" condition="help">
- <div class="alert alert-info padding-5"
- tal:define="i18n_help request.localizer.translate(help);"
- tal:content="structure extension:html(i18n_help)"></div>
- </tal:var>
- <tal:loop repeat="widget group.visible_widgets">
- <input type="hidden"
- tal:condition="widget.mode == 'hidden'"
- tal:replace="structure widget.render()" />
- <tal:if condition="widget.mode != 'hidden'">
- <div tal:define="required 'required-field' if widget.required and widget.label and (widget.mode != 'display') else ''"
- tal:attributes="class string:${widget.group_css_class | group.group_css_class | view.group_css_class | 'form-group'} ${required}">
- <label tal:attributes="class widget.label_css_class | group.label_css_class | view.label_css_class">
- <span>
- <tal:var content="widget.label" />
- <i class="fa fa-question-circle hint" title="Input hint"
- tal:define="description getattr(widget, 'description', widget.field.description)"
- tal:condition="description"
- tal:attributes="title description;
- data-ams-hint-html '<' in description;"></i>
- </span>
- </label>
- <div tal:attributes="class widget.input_css_class | group.input_css_class | view.input_css_class">
- <label class="input"
- tal:attributes="class widget.widget_css_class | default;
- data-ams-form-validator view.get_widget_callback(widget.field.getName())">
- <div tal:define="notice widget.before_widget_notice | nothing"
- tal:condition="notice"
- tal:content="structure notice">Notice</div>
- <input tal:replace="structure widget.render()" />
- <div tal:define="notice widget.after_widget_notice | nothing"
- tal:condition="notice"
- tal:content="structure notice">Notice</div>
- </label>
- </div>
- </div>
- </tal:if>
- </tal:loop>
- </fieldset>
- <div class="subforms"
- tal:condition="group.subforms">
- <fieldset tal:define="title group.subforms_legend"
- tal:omit-tag="not:title">
- <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
- <tal:loop repeat="subform group.subforms">
- <tal:var replace="structure subform.render()" />
- </tal:loop>
- </fieldset>
- </div>
- </tal:loop>
- <div class="widgets-suffix"
- tal:omit-tag="getattr(view, 'hide_widgets_suffix_div', False)"
- tal:define="suffix provider:widgets_suffix"
- tal:condition="suffix"
- tal:content="structure suffix">Widgets suffix</div>
- <div class="subforms"
- tal:condition="view.subforms">
- <fieldset tal:define="title view.subforms_legend"
- tal:omit-tag="not:title">
- <legend tal:condition="title" tal:content="title" i18n:translate="">legend</legend>
- <tal:loop repeat="subform view.subforms">
- <tal:var replace="structure subform.render()" />
- </tal:loop>
- </fieldset>
- </div>
- <div class="tabforms"
- tal:condition="view.tabforms">
- <ul class="nav nav-tabs">
- <li tal:repeat="tabform view.tabforms"
- tal:attributes="class '{active} {errors}'.format(active='active' if repeat['tabform'].start() else '',
- errors='state-error' if tabform.widgets.errors else '')">
- <a data-toggle="tab"
- tal:attributes="href string:#${tabform.id};
- data-ams-url python:getattr(tabform, 'tab_target', None);"
- tal:content="tabform.tab_label" i18n:translate="">Tab label</a>
- </li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane fade in"
- tal:repeat="tabform view.tabforms"
- tal:attributes="id tabform.id;
- class 'tab-pane {active} fade in'.format(active='active' if repeat['tabform'].start() else '');"
- tal:content="structure tabform.render()"></div>
- </div>
- </div>
- </fieldset>
- <footer tal:condition="view.actions and (view.is_dialog or (view.mode == 'input'))">
- <button tal:repeat="action view.actions.values()"
- tal:replace="structure action.render()">Action</button>
- </footer>
- </form>
- <div class="form-suffix"
- tal:define="suffix provider:form_suffix"
- tal:condition="suffix"
- tal:content="structure suffix">Form suffix</div>
-</div>
--- a/src/pyams_form/templates/widget-form.pt Thu May 03 11:34:51 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-<div class="ams-widget">
- <header>
- <span tal:condition="view.widget_icon_class | nothing"
- class="widget-icon"><i tal:attributes="class view.widget_icon_class"></i>
- </span>
- <h2 tal:content="view.legend"></h2>
- <tal:var content="structure provider:pyams.widget_title" />
- <tal:var content="structure provider:pyams.toolbar" />
- </header>
- <div class="widget-body no-padding">
- <div tal:define="prefix provider:form_prefix"
- tal:replace="structure prefix">Form prefix</div>
- <tal:var content="structure provider:form_help" />
- <form method="post"
- data-async
- tal:attributes="id view.id;
- name view.name;
- action view.get_form_action();
- method view.method;
- enctype view.enctype;
- acceptCharset view.acceptCharset;
- accept view.accept;
- autocomplete view.autocomplete;
- class view.css_class;
- data-ams-data extension:object_data(view);
- data-ams-form-handler view.get_ajax_handler() | nothing;
- data-ams-form-options view.get_form_options() | nothing;
- data-ams-form-submit-target view.form_target | nothing;
- data-ams-form-download-target view.download_target | nothing;
- data-ams-warn-on-change view.warn_on_change;">
- <div class="modal-viewport">
- <fieldset>
- <div class="widgets-prefix"
- tal:omit-tag="getattr(view, 'hide_widgets_prefix_div', False)"
- tal:define="prefix provider:widgets_prefix"
- tal:condition="prefix"
- tal:content="structure prefix">Widgets prefix</div>
- <div class="clearfix"></div>
- <tal:loop repeat="group view.groups">
- <fieldset tal:define="legend group.legend"
- tal:omit-tag="not:legend"
- tal:attributes="class (group.fieldset_class or '') + (' bordered' if group.bordered else '')">
- <tal:if condition="group.checkbox_switch">
- <legend data-ams-checker-value="selected"
- tal:condition="legend"
- tal:attributes="class group.css_class;
- data-ams-checker-fieldname '{0}:list'.format(group.checkbox_widget.name);
- data-ams-checker-readonly 'readonly' if group.checkbox_widget.mode == 'display' else None;
- data-ams-checker-mode 'disable' if group.checkbox_mode == 'disable' else None;
- data-ams-checker-marker '{0}-empty-marker'.format(group.checkbox_widget.name);
- data-ams-checker-state group.checker_state;">
- <label tal:content="legend">Legend</label>
- </legend>
- </tal:if>
- <tal:if condition="not:group.checkbox_switch">
- <legend tal:condition="legend"
- tal:content="legend"
- tal:attributes="class group.css_class;
- data-ams-switcher-state group.switcher_state;">Legend</legend>
- </tal:if>
- <tal:var define="help group.help" condition="help">
- <div class="alert alert-info padding-5"
- tal:define="i18n_help request.localizer.translate(help);"
- tal:content="structure extension:html(i18n_help)"></div>
- </tal:var>
- <tal:loop repeat="widget group.visible_widgets">
- <input type="hidden"
- tal:condition="widget.mode == 'hidden'"
- tal:replace="structure widget.render()" />
- <tal:if condition="widget.mode != 'hidden'">
- <div tal:define="required 'required-field' if widget.required and widget.label and (widget.mode != 'display') else ''"
- tal:attributes="class string:${widget.group_css_class | group.group_css_class | view.group_css_class | 'form-group'} ${required}">
- <label tal:attributes="class widget.label_css_class | group.label_css_class | view.label_css_class">
- <span>
- <tal:var content="widget.label" />
- <i class="fa fa-question-circle hint" title="Input hint"
- tal:define="description getattr(widget, 'description', widget.field.description)"
- tal:condition="description"
- tal:attributes="title description;
- data-ams-hint-html '<' in description;"></i>
- </span>
- </label>
- <div tal:attributes="class widget.input_css_class | group.input_css_class | view.input_css_class">
- <label class="input"
- tal:attributes="class widget.widget_css_class | default;
- data-ams-form-validator view.get_widget_callback(widget.field.getName())">
- <div tal:define="notice widget.before_widget_notice | nothing"
- tal:condition="notice"
- tal:content="structure notice">Notice</div>
- <input tal:replace="structure widget.render()" />
- <div tal:define="notice widget.after_widget_notice | nothing"
- tal:condition="notice"
- tal:content="structure notice">Notice</div>
- </label>
- </div>
- </div>
- </tal:if>
- </tal:loop>
- <div class="subforms"
- tal:condition="group.subforms">
- <fieldset tal:define="title group.subforms_legend"
- tal:omit-tag="not:title">
- <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
- <tal:loop repeat="subform group.subforms">
- <tal:var replace="structure subform.render()" />
- </tal:loop>
- </fieldset>
- </div>
- </fieldset>
- </tal:loop>
- <div class="widgets-suffix"
- tal:omit-tag="getattr(view, 'hide_widgets_suffix_div', False)"
- tal:define="suffix provider:widgets_suffix"
- tal:condition="suffix"
- tal:content="structure suffix">Widgets suffix</div>
- <div class="subforms"
- tal:condition="view.subforms">
- <fieldset tal:define="title view.subforms_legend"
- tal:omit-tag="not:title">
- <legend tal:condition="title" tal:content="title" i18n:translate="">Title</legend>
- <tal:loop repeat="subform view.subforms">
- <tal:var replace="structure subform.render()" />
- </tal:loop>
- </fieldset>
- </div>
- <div class="tabforms"
- tal:condition="view.tabforms">
- <ul class="nav nav-tabs">
- <li tal:repeat="tabform view.tabforms"
- tal:attributes="class 'small {active} {errors}'.format(active='active' if repeat['tabform'].start() else '',
- errors='state-error' if tabform.widgets.errors else '')">
- <a data-toggle="tab"
- tal:attributes="href string:#${tabform.id};
- data-ams-url python:getattr(tabform, 'tab_target', None);"
- tal:content="tabform.tab_label" i18n:translate="">Tab label</a>
- </li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane fade in"
- tal:repeat="tabform view.tabforms"
- tal:attributes="id tabform.id;
- class 'tab-pane {active} fade in'.format(active='active' if repeat['tabform'].start() else '');"
- tal:content="structure tabform.render()"></div>
- </div>
- </div>
- </fieldset>
- </div>
- <footer tal:condition="view.actions and (view.is_dialog or (view.mode == 'input'))">
- <button tal:repeat="action view.actions.values()"
- tal:replace="structure action.render()">Action</button>
- </footer>
- </form>
- <div tal:define="prefix provider:form_suffix"
- tal:replace="structure prefix">Form suffix</div>
- </div>
-</div>