Commit 2c512e91 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Form/Formulator: Minimal support of Zope4's ZMI

Only the most used forms are updated
parent bde737cd
...@@ -93,6 +93,7 @@ class FormBoxWidget(Widget.Widget): ...@@ -93,6 +93,7 @@ class FormBoxWidget(Widget.Widget):
title='Form ID', title='Form ID',
description=( description=(
"ID of the form which must be rendered in this box."), "ID of the form which must be rendered in this box."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -101,6 +102,7 @@ class FormBoxWidget(Widget.Widget): ...@@ -101,6 +102,7 @@ class FormBoxWidget(Widget.Widget):
title='Context method ID', title='Context method ID',
description=( description=(
"ID of the method that returns a context for this box."), "ID of the method that returns a context for this box."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -109,6 +111,7 @@ class FormBoxWidget(Widget.Widget): ...@@ -109,6 +111,7 @@ class FormBoxWidget(Widget.Widget):
title='Default', title='Default',
description=( description=(
"A default value (not used)."), "A default value (not used)."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -179,6 +182,7 @@ class FormBoxValidator(Validator.Validator): ...@@ -179,6 +182,7 @@ class FormBoxValidator(Validator.Validator):
'validator_form_field_prefix', 'validator_form_field_prefix',
title='Validator Form Field Prefix', title='Validator Form Field Prefix',
description= "Field prefix value used when validating fields", description= "Field prefix value used when validating fields",
css_class="form-control",
default="my_", default="my_",
display_width=40, display_width=40,
required=1 required=1
......
...@@ -185,6 +185,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -185,6 +185,7 @@ class ListBoxWidget(Widget.Widget):
title='Lines', title='Lines',
description=( description=(
"The number of lines of this list. Required."), "The number of lines of this list. Required."),
css_class="form-control",
default=20, default=20,
required=1) required=1)
property_names.append('lines') property_names.append('lines')
...@@ -193,6 +194,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -193,6 +194,7 @@ class ListBoxWidget(Widget.Widget):
title="Columns", title="Columns",
description=( description=(
"A list of attributes names to display. Required."), "A list of attributes names to display. Required."),
css_class="form-control",
default=[], default=[],
required=1) required=1)
property_names.append('columns') property_names.append('columns')
...@@ -201,6 +203,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -201,6 +203,7 @@ class ListBoxWidget(Widget.Widget):
title="More Columns", title="More Columns",
description=( description=(
"An optional list of attributes names to display."), "An optional list of attributes names to display."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('all_columns') property_names.append('all_columns')
...@@ -209,6 +212,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -209,6 +212,7 @@ class ListBoxWidget(Widget.Widget):
title="List Style Columns", title="List Style Columns",
description=( description=(
"An optional list of list style columns to display."), "An optional list of list style columns to display."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('style_columns') property_names.append('style_columns')
...@@ -217,6 +221,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -217,6 +221,7 @@ class ListBoxWidget(Widget.Widget):
title="Searchable Columns", title="Searchable Columns",
description=( description=(
"An optional list of columns to search."), "An optional list of columns to search."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('search_columns') property_names.append('search_columns')
...@@ -225,6 +230,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -225,6 +230,7 @@ class ListBoxWidget(Widget.Widget):
title="Sortable Columns", title="Sortable Columns",
description=( description=(
"An optional list of columns to sort."), "An optional list of columns to sort."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('sort_columns') property_names.append('sort_columns')
...@@ -232,6 +238,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -232,6 +238,7 @@ class ListBoxWidget(Widget.Widget):
sort = fields.ListTextAreaField('sort', sort = fields.ListTextAreaField('sort',
title='Default Sort', title='Default Sort',
description=('The default sort keys and order'), description=('The default sort keys and order'),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('sort') property_names.append('sort')
...@@ -240,6 +247,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -240,6 +247,7 @@ class ListBoxWidget(Widget.Widget):
title='List Method', title='List Method',
description=('The method to use to list ' description=('The method to use to list '
'objects'), 'objects'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('list_method') property_names.append('list_method')
...@@ -248,6 +256,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -248,6 +256,7 @@ class ListBoxWidget(Widget.Widget):
title='Count Method', title='Count Method',
description=('The method to use to count ' description=('The method to use to count '
'objects'), 'objects'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('count_method') property_names.append('count_method')
...@@ -256,6 +265,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -256,6 +265,7 @@ class ListBoxWidget(Widget.Widget):
title='Stat Method', title='Stat Method',
description=('The method to use to stat ' description=('The method to use to stat '
'objects'), 'objects'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('stat_method') property_names.append('stat_method')
...@@ -264,6 +274,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -264,6 +274,7 @@ class ListBoxWidget(Widget.Widget):
title='Row CSS Method', title='Row CSS Method',
description=('The method to set the css ' description=('The method to set the css '
'class name of a row'), 'class name of a row'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('row_css_method') property_names.append('row_css_method')
...@@ -272,6 +283,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -272,6 +283,7 @@ class ListBoxWidget(Widget.Widget):
title='Selection Name', title='Selection Name',
description=('The name of the selection to ' description=('The name of the selection to '
'store selection parameters'), 'store selection parameters'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('selection_name') property_names.append('selection_name')
...@@ -280,6 +292,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -280,6 +292,7 @@ class ListBoxWidget(Widget.Widget):
title="Meta Types", title="Meta Types",
description=( description=(
"Meta Types of objects to list."), "Meta Types of objects to list."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('meta_types') property_names.append('meta_types')
...@@ -288,6 +301,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -288,6 +301,7 @@ class ListBoxWidget(Widget.Widget):
title="Portal Types", title="Portal Types",
description=( description=(
"Portal Types of objects to list."), "Portal Types of objects to list."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('portal_types') property_names.append('portal_types')
...@@ -296,6 +310,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -296,6 +310,7 @@ class ListBoxWidget(Widget.Widget):
title="Default Parameters", title="Default Parameters",
description=( description=(
"Default Parameters for the List Method."), "Default Parameters for the List Method."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('default_params') property_names.append('default_params')
...@@ -303,6 +318,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -303,6 +318,7 @@ class ListBoxWidget(Widget.Widget):
search = fields.CheckBoxField('search', search = fields.CheckBoxField('search',
title='Search Row', title='Search Row',
description=('Search Row'), description=('Search Row'),
css_class="form-check-input",
default=0, default=0,
required=0) required=0)
property_names.append('search') property_names.append('search')
...@@ -310,6 +326,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -310,6 +326,7 @@ class ListBoxWidget(Widget.Widget):
select = fields.CheckBoxField('select', select = fields.CheckBoxField('select',
title='Select Column', title='Select Column',
description=('Select Column'), description=('Select Column'),
css_class="form-check-input",
default=0, default=0,
required=0) required=0)
property_names.append('select') property_names.append('select')
...@@ -318,6 +335,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -318,6 +335,7 @@ class ListBoxWidget(Widget.Widget):
title='Anchor Column', title='Anchor Column',
description=( description=(
'An optional anchor column which can always clickable.'), 'An optional anchor column which can always clickable.'),
css_class="form-check-input",
default=0, default=0,
required=0) required=0)
property_names.append('anchor') property_names.append('anchor')
...@@ -327,6 +345,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -327,6 +345,7 @@ class ListBoxWidget(Widget.Widget):
title='Hide Rows (On No Search Criterion)', title='Hide Rows (On No Search Criterion)',
description=('Hide listbox rows if no search ' description=('Hide listbox rows if no search '
'criterion is provided by user'), 'criterion is provided by user'),
css_class="form-check-input",
default=0, default=0,
required=0) required=0)
property_names.append('hide_rows_on_no_search_criterion') property_names.append('hide_rows_on_no_search_criterion')
...@@ -335,6 +354,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -335,6 +354,7 @@ class ListBoxWidget(Widget.Widget):
title="Editable Columns", title="Editable Columns",
description=( description=(
"An optional list of columns which can be modified."), "An optional list of columns which can be modified."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('editable_columns') property_names.append('editable_columns')
...@@ -343,6 +363,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -343,6 +363,7 @@ class ListBoxWidget(Widget.Widget):
title="Stat Columns", title="Stat Columns",
description=( description=(
"An optional list of columns which can be used for statistics."), "An optional list of columns which can be used for statistics."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('stat_columns') property_names.append('stat_columns')
...@@ -351,6 +372,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -351,6 +372,7 @@ class ListBoxWidget(Widget.Widget):
title="URL Columns", title="URL Columns",
description=( description=(
"An optional list of columns which can provide a custom URL."), "An optional list of columns which can provide a custom URL."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('url_columns') property_names.append('url_columns')
...@@ -359,6 +381,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -359,6 +381,7 @@ class ListBoxWidget(Widget.Widget):
title="Untranslatable Columns", title="Untranslatable Columns",
description=( description=(
"An optional list of columns titles which should not be translated."), "An optional list of columns titles which should not be translated."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('untranslatable_columns') property_names.append('untranslatable_columns')
...@@ -369,6 +392,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -369,6 +392,7 @@ class ListBoxWidget(Widget.Widget):
description=( description=(
"An optional list of attributes which are set by hidden fields and " "An optional list of attributes which are set by hidden fields and "
"which are applied to each editable column."), "which are applied to each editable column."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('global_attributes') property_names.append('global_attributes')
...@@ -376,6 +400,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -376,6 +400,7 @@ class ListBoxWidget(Widget.Widget):
domain_tree = fields.CheckBoxField('domain_tree', domain_tree = fields.CheckBoxField('domain_tree',
title='Domain Tree', title='Domain Tree',
description=('Selection Tree'), description=('Selection Tree'),
css_class="form-check-input",
default=0, default=0,
required=0) required=0)
property_names.append('domain_tree') property_names.append('domain_tree')
...@@ -384,6 +409,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -384,6 +409,7 @@ class ListBoxWidget(Widget.Widget):
title="Domain Root", title="Domain Root",
description=( description=(
"A list of domains which define the possible root."), "A list of domains which define the possible root."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('domain_root_list') property_names.append('domain_root_list')
...@@ -391,6 +417,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -391,6 +417,7 @@ class ListBoxWidget(Widget.Widget):
report_tree = fields.CheckBoxField('report_tree', report_tree = fields.CheckBoxField('report_tree',
title='Report Tree', title='Report Tree',
description=('Report Tree'), description=('Report Tree'),
css_class="form-check-input",
default=0, default=0,
required=0) required=0)
property_names.append('report_tree') property_names.append('report_tree')
...@@ -399,6 +426,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -399,6 +426,7 @@ class ListBoxWidget(Widget.Widget):
title="Report Root", title="Report Root",
description=( description=(
"A list of domains which define the possible root."), "A list of domains which define the possible root."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('report_root_list') property_names.append('report_root_list')
...@@ -407,6 +435,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -407,6 +435,7 @@ class ListBoxWidget(Widget.Widget):
title="Display style", title="Display style",
description=( description=(
"A list of styles which change the listbox rendering."), "A list of styles which change the listbox rendering."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
property_names.append('display_style_list') property_names.append('display_style_list')
...@@ -415,6 +444,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -415,6 +444,7 @@ class ListBoxWidget(Widget.Widget):
title="Default display style", title="Default display style",
description=( description=(
"A default display style for listbox rendering."), "A default display style for listbox rendering."),
css_class="form-control",
default=DEFAULT_LISTBOX_DISPLAY_STYLE, default=DEFAULT_LISTBOX_DISPLAY_STYLE,
required=0) required=0)
property_names.append('default_display_style') property_names.append('default_display_style')
...@@ -422,6 +452,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -422,6 +452,7 @@ class ListBoxWidget(Widget.Widget):
global_search_column = fields.StringField('global_search_column', global_search_column = fields.StringField('global_search_column',
title="Global search column", title="Global search column",
description=("Global search column make query."), description=("Global search column make query."),
css_class="form-control",
default=None, default=None,
required=0) required=0)
property_names.append('global_search_column') property_names.append('global_search_column')
...@@ -429,6 +460,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -429,6 +460,7 @@ class ListBoxWidget(Widget.Widget):
page_navigation_template = fields.StringField('page_navigation_template', page_navigation_template = fields.StringField('page_navigation_template',
title="Page Navigation Template", title="Page Navigation Template",
description=("Page Navigation Template used to render listbox page navigation."), description=("Page Navigation Template used to render listbox page navigation."),
css_class="form-control",
default=DEFAULT_LISTBOX_PAGE_NAVIGATION_TEMPLATE, default=DEFAULT_LISTBOX_PAGE_NAVIGATION_TEMPLATE,
required=0) required=0)
property_names.append('page_navigation_template') property_names.append('page_navigation_template')
...@@ -437,6 +469,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -437,6 +469,7 @@ class ListBoxWidget(Widget.Widget):
title='List Action', title='List Action',
description=('The id of the object action' description=('The id of the object action'
' to display the current list'), ' to display the current list'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('list_action') property_names.append('list_action')
...@@ -445,6 +478,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -445,6 +478,7 @@ class ListBoxWidget(Widget.Widget):
title='Page Template', title='Page Template',
description=('The id of a Page Template' description=('The id of a Page Template'
' to render the ListBox'), ' to render the ListBox'),
css_class="form-control",
default='', default='',
required=0) required=0)
property_names.append('page_template') property_names.append('page_template')
......
...@@ -80,6 +80,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -80,6 +80,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Update Method', title='Update Method',
description=( description=(
"The method to call to set the relation. Required."), "The method to call to set the relation. Required."),
css_class="form-control",
default="Base_validateRelation", default="Base_validateRelation",
required=1) required=1)
...@@ -87,6 +88,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -87,6 +88,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Jump Method', title='Jump Method',
description=( description=(
"The method to call to jump to the relation. Required."), "The method to call to jump to the relation. Required."),
css_class="form-control",
default="Base_jumpToRelatedDocument", default="Base_jumpToRelatedDocument",
required=1) required=1)
...@@ -94,6 +96,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -94,6 +96,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Allow Jump', title='Allow Jump',
description=( description=(
"Do we allow to jump to the relation ?"), "Do we allow to jump to the relation ?"),
css_class="form-check-input",
default=1, default=1,
required=0) required=0)
...@@ -101,6 +104,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -101,6 +104,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Base Category', title='Base Category',
description=( description=(
"The method to call to set the relation. Required."), "The method to call to set the relation. Required."),
css_class="form-control",
default="", default="",
required=1) required=1)
...@@ -108,6 +112,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -108,6 +112,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Portal Type', title='Portal Type',
description=( description=(
"The method to call to set the relation. Required."), "The method to call to set the relation. Required."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -115,6 +120,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -115,6 +120,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Allow Creation', title='Allow Creation',
description=( description=(
"Do we allow to create new objects ?"), "Do we allow to create new objects ?"),
css_class="form-check-input",
default=1, default=1,
required=0) required=0)
...@@ -122,6 +128,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -122,6 +128,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Container Getter Method', title='Container Getter Method',
description=( description=(
"The method to call to get a container object."), "The method to call to get a container object."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -129,6 +136,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -129,6 +136,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Context Getter Method', title='Context Getter Method',
description=( description=(
"The method to call to get the context."), "The method to call to get the context."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -136,6 +144,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -136,6 +144,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Catalog Index', title='Catalog Index',
description=( description=(
"The method to call to set the relation. Required."), "The method to call to set the relation. Required."),
css_class="form-control",
default="", default="",
required=1) required=1)
...@@ -145,6 +154,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -145,6 +154,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Relation Update Method', title='Relation Update Method',
description=( description=(
"The method to invoke in order to update the relation"), "The method to invoke in order to update the relation"),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -152,6 +162,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -152,6 +162,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='Relation Form', title='Relation Form',
description=( description=(
"Form to display relation choices"), "Form to display relation choices"),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -161,6 +172,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -161,6 +172,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
"The display size in rows of the field. If set to 1, the " "The display size in rows of the field. If set to 1, the "
"widget will be displayed as a drop down box by many browsers, " "widget will be displayed as a drop down box by many browsers, "
"if set to something higher, a list will be shown. Required."), "if set to something higher, a list will be shown. Required."),
css_class="form-control",
default=1, default=1,
required=1) required=1)
...@@ -168,12 +180,14 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -168,12 +180,14 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title="Columns", title="Columns",
description=( description=(
"A list of attributes names to display."), "A list of attributes names to display."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
sort = fields.ListTextAreaField('sort', sort = fields.ListTextAreaField('sort',
title='Default Sort', title='Default Sort',
description=('The default sort keys and order'), description=('The default sort keys and order'),
css_class="form-control",
default=[], default=[],
required=0) required=0)
...@@ -181,6 +195,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -181,6 +195,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title="Parameter List", title="Parameter List",
description=( description=(
"A list of paramters used for the portal_catalog."), "A list of paramters used for the portal_catalog."),
css_class="form-control",
default=[], default=[],
required=0) required=0)
...@@ -188,12 +203,14 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, ...@@ -188,12 +203,14 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
title='List Method', title='List Method',
description=('The method to use to list' description=('The method to use to list'
'objects'), 'objects'),
css_class="form-control",
default='', default='',
required=0) required=0)
proxy_listbox_ids = fields.ListTextAreaField('proxy_listbox_ids', proxy_listbox_ids = fields.ListTextAreaField('proxy_listbox_ids',
title='Proxy Listbox IDs', title='Proxy Listbox IDs',
description=('A list of listbox that can be used as proxy'), description=('A list of listbox that can be used as proxy'),
css_class="form-control",
default='', default='',
required=0) required=0)
......
...@@ -90,6 +90,7 @@ class ProxyWidget(Widget.Widget): ...@@ -90,6 +90,7 @@ class ProxyWidget(Widget.Widget):
title='Form ID', title='Form ID',
description= \ description= \
"ID of the master form.", "ID of the master form.",
css_class="form-control",
default="", default="",
display_width=40, display_width=40,
required=1) required=1)
...@@ -99,6 +100,7 @@ class ProxyWidget(Widget.Widget): ...@@ -99,6 +100,7 @@ class ProxyWidget(Widget.Widget):
title='Field ID', title='Field ID',
description= \ description= \
"ID of the field in the master form.", "ID of the field in the master form.",
css_class="form-control",
default="", default="",
display_width=40, display_width=40,
required=1) required=1)
......
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<p class="form-help"> <main class="container-fluid">
<p class="form-help lead">
Change the display order and grouping of the fields in this form. Change the display order and grouping of the fields in this form.
</p> </p>
<table border="1" cellspacing="1" cellpadding="3"> <table class="table table-bordered">
<dtml-let all_groups="get_groups(include_empty=1)" <dtml-let all_groups="get_groups(include_empty=1)"
group_length="get_largest_group_length()" group_length="get_largest_group_length()"
first_group="all_groups and all_groups[0] or None"> first_group="all_groups and all_groups[0] or None">
<dtml-in "get_group_rows()"> <dtml-in "get_group_rows()">
...@@ -14,119 +15,91 @@ Change the display order and grouping of the fields in this form. ...@@ -14,119 +15,91 @@ Change the display order and grouping of the fields in this form.
<dtml-let groups=sequence-item> <dtml-let groups=sequence-item>
<dtml-in groups> <dtml-in groups>
<dtml-let group=sequence-item> <dtml-let group=sequence-item>
<td nowrap valign="top"> <td>
<table border="0" cellspacing="0" cellpadding="0"> <table class="table">
<form action="." method="POST"> <form action="." method="POST">
<input type="hidden" name="group" value="&dtml-group;"> <input type="hidden" name="group" value="&dtml-group;">
<tr><td align="center" class="list-header"> <tr><td>
<div class="list-nav"> <div class="font-weight-bold">
<dtml-var group html_quote> <dtml-var group html_quote>
</div> </div>
</td></tr> </td></tr>
<tr><td align="left"> <tr><td>
<dtml-let fields="get_fields_in_group(group, include_disabled=1)" fields_amount="_.len(fields)"> <dtml-let fields="get_fields_in_group(group)" fields_amount="_.len(fields)">
<table border="0" cellspacing="0" cellpadding="0"> <table class="table table-borderless table-sm">
<dtml-in fields> <dtml-in fields>
<dtml-let field=sequence-item field_id="field.id"> <dtml-let field=sequence-item field_id="field.id">
<tr><td height="25"> <tr><td>
<div class="list-item"> <input type="checkbox" name="&dtml-field_id;">&nbsp;<a href="&dtml-field_id;/manage_main"><img src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;" title="&dtml-meta_type;" border="0"></a>&nbsp;<a href="&dtml-field_id;/manage_main"><dtml-var field_id></a>
<dtml-if expr="REQUEST.has_key(field_id)"><input type="checkbox" name="&dtml-field_id;" checked="checked">
<dtml-else><input type="checkbox" name="&dtml-field_id;">
</dtml-if>
&nbsp;<a href="&dtml-field_id;/manage_main"><img src="&dtml-BASEPATH1;/&dtml-icon;" alt="&dtml-meta_type;" title="&dtml-meta_type;" border="0"></a>&nbsp;<a href="&dtml-field_id;/manage_main"><dtml-var field_id></a>
</div>
</td></tr> </td></tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
<dtml-in "_.range(group_length - fields_amount)"> <dtml-in "_.range(group_length - fields_amount)">
<tr><td height="25"></td></tr> <tr><td></td></tr>
</dtml-in> </dtml-in>
</dtml-let> </dtml-let>
</table> </table>
</td></tr> </td></tr>
<tr><td align="center"> <tr><td>
<input class="form-element" type="submit" name="manage_move_field_up:method" <input class="btn btn-secondary" type="submit" name="manage_move_field_up:method"
value="Move Up"> value="Move Up">
</td></tr> <input class="btn btn-secondary" type="submit" name="manage_move_field_down:method"
value="Move Dn">
<tr><td align="center">
<input class="form-element" type="submit" name="manage_move_field_down:method"
value="Move Dn"><br><br>
</td></tr> </td></tr>
<tr><td align="center"> <tr><td>
<div class="form-element"> <div class="form-group">
<select class="form-element" name="to_group" size="1"> <select class="form-control mb-2" name="to_group" size="1">
<option>Move to:</option> <option>Transfer Selected Fields to:</option>
<dtml-in all_groups> <dtml-in all_groups>
<option><dtml-var sequence-item html_quote></option> <option><dtml-var sequence-item html_quote></option>
</dtml-in> </dtml-in>
</select> </select>
</div> <input type="submit" class="btn btn-secondary mb-2" name="manage_move_group:method"
</td></tr>
<tr><td align="center">
<input class="form-element" type="submit" name="manage_move_group:method"
value="Transfer"> value="Transfer">
</div>
</td></tr> </td></tr>
<dtml-if "group != first_group"> <dtml-if "group != first_group">
<tr><td>
<tr><td align="center" class="list-header"> <div class="form-group">
<div class="list-item"> <input class="btn btn-secondary" type="submit" name="manage_move_group_up:method"
Group value="Move Group Up">
<input class="btn btn-secondary" type="submit" name="manage_move_group_down:method"
value="Move Group Down">
</div> </div>
</td></tr> </td></tr>
<tr><td align="center"> <tr><td>
<input class="form-element" type="submit" name="manage_move_group_up:method" <div class="form-group">
value="Move Up"> <input type="text" class="form-control form-control-sm" name="new_name" value="" size="10">
</td></tr> <input class="btn btn-secondary" type="submit" name="manage_rename_group:method"
value="Rename Group">
<tr><td align="center"> </div>
<input class="form-element" type="submit" name="manage_move_group_down:method"
value="Move Dn"><br><br>
</td></tr>
<tr><td align="center">
<input type="text" name="new_name" value="" size="10">
</td></tr>
<tr><td align="center">
<input class="form-element" type="submit" name="manage_rename_group:method"
value="Rename"><br>
</td></tr> </td></tr>
<tr><td align="center"> <tr><td>
<input class="form-element" type="submit" name="manage_remove_group:method" <input class="btn btn-secondary" type="submit" name="manage_remove_group:method"
value="Remove"><br> value="Remove Group">
</td></tr> </td></tr>
<dtml-else> <dtml-else>
<tr><td align="center" class="list-header"> <tr><td>
<div class="list-item"> <div class="form-group">
Group <input type="text" class="form-control form-control-sm" name="new_group" value="" size="10">
<input type="submit" class="btn btn-secondary" name="manage_add_group:method" value="Create Group">
</div> </div>
</td></tr> </td></tr>
<tr><td align="center">
<input type="text" name="new_group" value="" size="10">
</td></tr>
<tr><td align="center"> <tr><td>
<input type="submit" name="manage_add_group:method" value="Create"><br><br> <div class="form-group">
</td></tr> <input type="text" class="form-control form-control-sm" name="new_name" value="" size="10">
<input class="btn btn-secondary" type="submit" name="manage_rename_group:method"
<tr><td align="center"> value="Rename Group">
<input type="text" name="new_name" value="" size="10"> </div>
</td></tr>
<tr><td align="center">
<input class="form-element" type="submit" name="manage_rename_group:method"
value="Rename"><br>
</td></tr> </td></tr>
</dtml-if> </dtml-if>
...@@ -141,5 +114,5 @@ Change the display order and grouping of the fields in this form. ...@@ -141,5 +114,5 @@ Change the display order and grouping of the fields in this form.
</dtml-in> </dtml-in>
</dtml-let> </dtml-let>
</table> </table>
</main>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
<style>form td:not(:last-child) { padding-right: 1em; }</style>
<dtml-var manage_page_header> <dtml-var manage_page_header>
<style>
textarea.form-control {
resize: both;
}
textarea.form-control, input[type=text].form-control {
font-family: monospace;
}
</style>
<dtml-let help_product="'Formulator'" help_topic=meta_type> <dtml-let help_product="'Formulator'" help_topic=meta_type>
<dtml-var manage_tabs> <dtml-var manage_tabs>
</dtml-let> </dtml-let>
<p class="form-help"> <main class="container-fluid">
<p class="form-help lead">
Surcharge <dtml-var meta_type> properties here. Surcharge <dtml-var meta_type> properties here.
</p> </p>
<form action="manage_edit" method="POST"> <form action="manage_edit" method="POST">
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<dtml-let proxy_field="this()" <dtml-let proxy_field="this()"
current_field="None if proxy_field.getTemplateField() is None else proxy_field.getRecursiveTemplateField()"> current_field="None if proxy_field.getTemplateField() is None else proxy_field.getRecursiveTemplateField()">
...@@ -20,7 +28,7 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -20,7 +28,7 @@ Surcharge <dtml-var meta_type> properties here.
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="3" class="form-title"> <td colspan="4" class="font-weight-bold">
Proxy Widget properties <dtml-if "current_field is not None">(<dtml-var expr="current_field.meta_type">)</dtml-if> Proxy Widget properties <dtml-if "current_field is not None">(<dtml-var expr="current_field.meta_type">)</dtml-if>
</td> </td>
</tr> </tr>
...@@ -32,20 +40,20 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -32,20 +40,20 @@ Surcharge <dtml-var meta_type> properties here.
override="current_field.get_override(field_id)" override="current_field.get_override(field_id)"
tales="current_field.get_tales(field_id)"> tales="current_field.get_tales(field_id)">
<tr> <tr>
<td align="left" valign="top"> <td>
<div class="form-label">
<dtml-if "tales or override">[</dtml-if><dtml-var "field.title()"><dtml-if "field.has_value('required') and field.get_value('required')">*</dtml-if><dtml-if "tales or override">]</dtml-if> <dtml-if "tales or override">[</dtml-if><dtml-var "field.title()"><dtml-if "field.has_value('required') and field.get_value('required')">*</dtml-if><dtml-if "tales or override">]</dtml-if>
</div>
</td> </td>
<td align="left" valign="top"> <td>
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td>
<td>
<dtml-var "field.meta_type">
</td>
<td>
<p class="form-text">
<small><dtml-var "field.get_value('description')"></small>
</p>
</td> </td>
<td><div class="form-element">
<dtml-var "field.meta_type">
</div></td>
<td><div class="form-element">
<dtml-var "field.get_value('description')">
</div></td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
...@@ -55,19 +63,19 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -55,19 +63,19 @@ Surcharge <dtml-var meta_type> properties here.
</dtml-in> </dtml-in>
<tr> <tr>
<td align="left" valign="top"> <td>
<div class="form-label">Proxy Target</div> <div>Proxy Target</div>
</td> </td>
<td align="left" valign="top"> <td>
<a href="manage_edit_target">Click to edit the target</a> <a href="manage_edit_target" class="btn btn-info">Click to edit the target</a>
</td> </td>
<td></td><td></td> <td></td><td></td>
</tr> </tr>
</table> </table>
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<!-- Then, display Template Field properties --> <!-- Then, display Template Field properties -->
<dtml-if "current_field is not None"> <dtml-if "current_field is not None">
<dtml-let form="current_field.form"> <dtml-let form="current_field.form">
...@@ -75,7 +83,7 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -75,7 +83,7 @@ Surcharge <dtml-var meta_type> properties here.
<dtml-let group=sequence-item fields="form.get_fields_in_group(group)"> <dtml-let group=sequence-item fields="form.get_fields_in_group(group)">
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="3" class="form-title"> <td colspan="5" class="font-weight-bold">
<dtml-var group capitalize> properties <dtml-var group capitalize> properties
</td> </td>
</tr> </tr>
...@@ -84,11 +92,12 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -84,11 +92,12 @@ Surcharge <dtml-var meta_type> properties here.
<dtml-in fields> <dtml-in fields>
<dtml-let field=sequence-item field_id="field.id" <dtml-let field=sequence-item field_id="field.id"
is_datetime_field="field.meta_type == 'DateTimeField'"
value="proxy_field.get_recursive_orig_value(field_id)" value="proxy_field.get_recursive_orig_value(field_id)"
override="proxy_field.get_recursive_override(field_id)" override="proxy_field.get_recursive_override(field_id)"
tales="proxy_field.get_recursive_tales(field_id)"> tales="proxy_field.get_recursive_tales(field_id)">
<tr> <tr>
<td align="left" valign="top"> <td>
<dtml-let checkbox_key="'surcharge_%s' % field_id" > <dtml-let checkbox_key="'surcharge_%s' % field_id" >
<dtml-if "proxy_field.is_delegated(field_id)"> <dtml-if "proxy_field.is_delegated(field_id)">
<input type="checkbox" <input type="checkbox"
...@@ -102,8 +111,7 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -102,8 +111,7 @@ Surcharge <dtml-var meta_type> properties here.
</dtml-if > </dtml-if >
</dtml-let > </dtml-let >
</td> </td>
<td align="left" valign="top"> <td>
<div class="form-label">
<dtml-if "tales or override">[ <dtml-if "tales or override">[
</dtml-if> </dtml-if>
<dtml-var "field.title()"> <dtml-var "field.title()">
...@@ -111,23 +119,24 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -111,23 +119,24 @@ Surcharge <dtml-var meta_type> properties here.
</dtml-if> </dtml-if>
<dtml-if "tales or override">] <dtml-if "tales or override">]
</dtml-if> </dtml-if>
</div>
</td> </td>
<dtml-if "proxy_field.is_delegated(field_id)"> <dtml-if "proxy_field.is_delegated(field_id)">
<td align="left" valign="top" class="to_disable delegated"> <td class="to_disable delegated <dtml-if is_datetime_field>form-inline</dtml-if>">
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td> </td>
<dtml-else > <dtml-else >
<td align="left" valign="top" class="to_disable"> <td class="to_disable <dtml-if is_datetime_field>form-inline</dtml-if>">
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td> </td>
</dtml-if> </dtml-if>
<td><div class="form-element"> <td>
<dtml-var "field.meta_type"> <dtml-var "field.meta_type">
</div></td> </td>
<td><div class="form-element"> <td>
<dtml-var "field.get_value('description')"> <p class="form-text">
</div></td> <small><dtml-var "field.get_value('description')"></small>
</p>
</td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
...@@ -140,13 +149,13 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -140,13 +149,13 @@ Surcharge <dtml-var meta_type> properties here.
</dtml-let> </dtml-let>
</table> </table>
<div class="form-element"> <div class="zmi-controls">
<input class="form-element" type="submit" name="submit" <input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
value="Save Changes" /> </div>
</div>
</form>
</form>
</main>
<script type="text/javascript"> <script type="text/javascript">
function isClass(object, className) { function isClass(object, className) {
if (object.className != undefined){ if (object.className != undefined){
......
<tr class="list-header"> <thead class="thead-light">
<td align="left" valign="top"> <tr>
<div class="form-label"> <th>
Delegated Delegated
</div> </th>
</td> <th>
<td align="left" valign="top">
<div class="form-label">
Name Name
</div> </th>
</td> <th class="w-50">
<td align="left" valign="top">
<div class="form-label">
Value Value
</div> </th>
</td> <th>
<td align="left" valign="top">
<div class="form-label">
Field Field
</div> </th>
</td>
<dtml-if "_['URL'].endswith(('/manage_main', '/manage_edit'))"> <dtml-if "_['URL'].endswith(('/manage_main', '/manage_edit'))">
<td align="left" valign="top"> <th>
<div class="form-label">
Description Description
</div> </th>
</td>
</dtml-if> </dtml-if>
</tr> </tr>
</thead>
\ No newline at end of file
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<main class="container-fluid">
<p class="form-help"> <p class="form-help leap">
Edit <dtml-var meta_type> error messages here. Edit <dtml-var meta_type> error messages here.
</p> </p>
<form action="manage_messages" method="POST"> <form action="manage_messages" method="POST">
<table border="0"> <table class="table table-striped table-hover table-sm">
<dtml-let proxy_field="this()"> <dtml-let proxy_field="this()">
<dtml-in "get_error_names()"> <dtml-in "get_error_names()">
<dtml-let name=sequence-item value="get_error_message(name)" <dtml-let name=sequence-item value="get_error_message(name)"
...@@ -21,14 +22,19 @@ Edit <dtml-var meta_type> error messages here. ...@@ -21,14 +22,19 @@ Edit <dtml-var meta_type> error messages here.
</dtml-if > </dtml-if >
</td> </td>
<td class="form-label"><dtml-var name></td> <td class="form-label"><dtml-var name></td>
<td><textarea name="&dtml-name;" cols="50" rows="4"><dtml-var value></textarea></td> <td><textarea class="form-control" name="&dtml-name;" cols="50" rows="4"><dtml-var value></textarea></td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
</dtml-let> </dtml-let>
<tr><td><input type="submit" value=" OK "></td></tr>
</table> </table>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
</div>
</form> </form>
</main>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
<style>form td:not(:last-child) { padding-right: 1em; }</style>
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<p class="form-help"> <main class="container-fluid">
<p class="form-help lead">
Edit <dtml-var meta_type> method TALES expressions here. Edit <dtml-var meta_type> method TALES expressions here.
<dtml-if "not isTALESAvailable()"><br> <dtml-if "not isTALESAvailable()"><br>
<span style="color: #FF0000;"> <span style="color: #FF0000;">
...@@ -14,7 +14,7 @@ This tab can therefore not be used. ...@@ -14,7 +14,7 @@ This tab can therefore not be used.
<form action="manage_tales" method="POST"> <form action="manage_tales" method="POST">
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<dtml-in "override_form.get_groups()"> <dtml-in "override_form.get_groups()">
...@@ -22,7 +22,7 @@ This tab can therefore not be used. ...@@ -22,7 +22,7 @@ This tab can therefore not be used.
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="3" class="form-title"> <td colspan="3" class="font-weight-bold">
Proxy Widget properties Proxy Widget properties
</td> </td>
</tr> </tr>
...@@ -34,17 +34,15 @@ This tab can therefore not be used. ...@@ -34,17 +34,15 @@ This tab can therefore not be used.
<dtml-let field=sequence-item field_id="field.id" <dtml-let field=sequence-item field_id="field.id"
value="current_field.get_tales(field.id)"> value="current_field.get_tales(field.id)">
<tr> <tr>
<td align="left" valign="top"> <td>
<div class="form-label"> <dtml-var "field.title()">
<dtml-var "field.title()">
</div>
</td> </td>
<td align="left" valign="top"> <td>
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td>
<td>
<dtml-var "current_field.form.get_field(field.id).meta_type">
</td> </td>
<td><div class="form-element">
<dtml-var "current_field.form.get_field(field.id).meta_type">
</div></td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
...@@ -54,17 +52,17 @@ This tab can therefore not be used. ...@@ -54,17 +52,17 @@ This tab can therefore not be used.
</dtml-in> </dtml-in>
<tr> <tr>
<td align="left" valign="top"> <td>
<div class="form-label">Proxy Target</div> <div>Proxy Target</div>
</td> </td>
<td align="left" valign="top"> <td>
<a href="manage_tales_target">Click to edit the target</a> <a href="manage_tales_target" class="btn btn-info">Click to edit the target</a>
</td> </td>
<td></td> <td></td>
</tr> </tr>
</table> </table>
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<!-- XXX Loop until find not a proxy field --> <!-- XXX Loop until find not a proxy field -->
<dtml-let proxy_field="this()" <dtml-let proxy_field="this()"
...@@ -77,7 +75,7 @@ This tab can therefore not be used. ...@@ -77,7 +75,7 @@ This tab can therefore not be used.
<dtml-let group=sequence-item fields="form.get_fields_in_group(group)"> <dtml-let group=sequence-item fields="form.get_fields_in_group(group)">
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="3" class="form-title"> <td colspan="4" class="font-weight-bold">
<dtml-var group capitalize> properties <dtml-var group capitalize> properties
</td> </td>
</tr> </tr>
...@@ -86,11 +84,10 @@ This tab can therefore not be used. ...@@ -86,11 +84,10 @@ This tab can therefore not be used.
<dtml-in fields> <dtml-in fields>
<dtml-let field=sequence-item field_id="field.id" <dtml-let field=sequence-item field_id="field.id"
value="proxy_field.get_recursive_tales(field_id)"> value="proxy_field.get_recursive_tales(field_id)">
<tr> <tr>
<td align="left" valign="top"> <td>
<dtml-let checkbox_key="'surcharge_%s' % field_id" > <dtml-let checkbox_key="'surcharge_%s' % field_id" >
<dtml-if "proxy_field.is_delegated(field_id)"> <dtml-if "proxy_field.is_delegated(field_id)">
<input type="checkbox" <input type="checkbox"
...@@ -105,25 +102,21 @@ This tab can therefore not be used. ...@@ -105,25 +102,21 @@ This tab can therefore not be used.
</dtml-let > </dtml-let >
</td> </td>
<td>
<dtml-var "field.title()">
<td align="left" valign="top">
<div class="form-label">
<dtml-var "field.title()">
</div>
</td> </td>
<dtml-if "proxy_field.is_delegated(field_id)"> <dtml-if "proxy_field.is_delegated(field_id)">
<td align="left" valign="top" class="to_disable delegated"> <td class="to_disable delegated">
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td> </td>
<dtml-else > <dtml-else >
<td align="left" valign="top" class="to_disable"> <td class="to_disable">
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td> </td>
</dtml-if> </dtml-if>
<td><div class="form-element"> <td>
<dtml-var "current_field.form.get_field(field.id).meta_type"> <dtml-var "current_field.form.get_field(field.id).meta_type">
</div></td> </td>
</tr> </tr>
</dtml-let> </dtml-let>
...@@ -138,12 +131,14 @@ This tab can therefore not be used. ...@@ -138,12 +131,14 @@ This tab can therefore not be used.
</dtml-let> </dtml-let>
</table> </table>
<div class="form-element">
<input class="form-element" type="submit" name="submit" <div class="zmi-controls">
value="Save Changes" /> <input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
</div> </div>
</form> </form>
</main>
<script type="text/javascript"> <script type="text/javascript">
function isClass(object, className) { function isClass(object, className) {
if (object.className != undefined){ if (object.className != undefined){
......
...@@ -73,6 +73,8 @@ def initializeFieldForm(field_class): ...@@ -73,6 +73,8 @@ def initializeFieldForm(field_class):
tales_field = fields.TALESField(field.id, tales_field = fields.TALESField(field.id,
title=field.get_value('title'), title=field.get_value('title'),
description="", description="",
css_class="form-control code",
extra='id="%s"' % field.id,
default="", default="",
display_width=40, display_width=40,
required=0) required=0)
...@@ -81,6 +83,8 @@ def initializeFieldForm(field_class): ...@@ -81,6 +83,8 @@ def initializeFieldForm(field_class):
method_field = fields.MethodField(field.id, method_field = fields.MethodField(field.id,
title=field.get_value("title"), title=field.get_value("title"),
description="", description="",
css_class="form-control code",
extra='id="%s"' % field.id,
default="", default="",
required=0) required=0)
override_form.add_field(method_field, "widget") override_form.add_field(method_field, "widget")
...@@ -89,6 +93,8 @@ def initializeFieldForm(field_class): ...@@ -89,6 +93,8 @@ def initializeFieldForm(field_class):
form.add_field(field, "validator") form.add_field(field, "validator")
tales_field = fields.TALESField(field.id, tales_field = fields.TALESField(field.id,
title=field.get_value('title'), title=field.get_value('title'),
css_class="form-control code",
extra='id="%s"' % field.id,
description="", description="",
default="", default="",
display_with=40, display_with=40,
...@@ -97,6 +103,8 @@ def initializeFieldForm(field_class): ...@@ -97,6 +103,8 @@ def initializeFieldForm(field_class):
method_field = fields.MethodField(field.id, method_field = fields.MethodField(field.id,
title=field.get_value("title"), title=field.get_value("title"),
css_class="form-control code",
extra='id="%s"' % field.id,
description="", description="",
default="", default="",
required=0) required=0)
......
...@@ -878,9 +878,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -878,9 +878,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
if (len(field_ids) == 1 and if (len(field_ids) == 1 and
self.move_field_up(field_ids[0], group)): self.move_field_up(field_ids[0], group)):
message = "Field %s moved up." % field_ids[0] message = "Field %s moved up." % field_ids[0]
manage_tabs_type = "success"
else: else:
message = "Can't move field up." message = "Can't move field up."
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -892,9 +895,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -892,9 +895,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
if (len(field_ids) == 1 and if (len(field_ids) == 1 and
self.move_field_down(field_ids[0], group)): self.move_field_down(field_ids[0], group)):
message = "Field %s moved down." % field_ids[0] message = "Field %s moved down." % field_ids[0]
manage_tabs_type = "success"
else: else:
message = "Can't move field down." message = "Can't move field down."
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -909,9 +915,13 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -909,9 +915,13 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
message = "Fields %s transferred from %s to %s." % (fields, message = "Fields %s transferred from %s to %s." % (fields,
group, group,
to_group) to_group)
manage_tabs_type = "success"
else: else:
message = "Can't transfer fields." message = "Can't transfer fields."
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -923,9 +933,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -923,9 +933,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
if (group and group != 'Select group' and if (group and group != 'Select group' and
self.add_group(group)): self.add_group(group)):
message = "Group %s created." % (group) message = "Group %s created." % (group)
manage_tabs_type = "success"
else: else:
message = "Can't create group." message = "Can't create group."
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -935,9 +948,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -935,9 +948,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
""" """
if self.remove_group(group): if self.remove_group(group):
message = "Group %s removed." % (group) message = "Group %s removed." % (group)
manage_tabs_type = "success"
else: else:
message = "Can't remove group." message = "Can't remove group."
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -949,12 +965,16 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -949,12 +965,16 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
new_name = REQUEST['new_name'].strip() new_name = REQUEST['new_name'].strip()
if self.rename_group(group, new_name): if self.rename_group(group, new_name):
message = "Group %s renamed to %s." % (group, new_name) message = "Group %s renamed to %s." % (group, new_name)
manage_tabs_type = "success"
else: else:
message = "Can't rename group." message = "Can't rename group."
manage_tabs_type = "danger"
else: else:
message = "No new name supplied." message = "No new name supplied."
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -964,9 +984,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -964,9 +984,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
""" """
if self.move_group_up(group): if self.move_group_up(group):
message = "Group %s moved up." % group message = "Group %s moved up." % group
manage_tabs_type = "success"
else: else:
message = "Can't move group %s up" % group message = "Can't move group %s up" % group
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
security.declareProtected('Change Formulator Forms', security.declareProtected('Change Formulator Forms',
...@@ -976,9 +999,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form): ...@@ -976,9 +999,12 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
""" """
if self.move_group_down(group): if self.move_group_down(group):
message = "Group %s moved down." % group message = "Group %s moved down." % group
manage_tabs_type = "success"
else: else:
message = "Can't move group %s down" % group message = "Can't move group %s down" % group
manage_tabs_type = "danger"
return self.formOrder(self, REQUEST, return self.formOrder(self, REQUEST,
manage_tabs_type=manage_tabs_type,
manage_tabs_message=message) manage_tabs_message=message)
PythonForm = ZMIForm # NOTE: backwards compatibility PythonForm = ZMIForm # NOTE: backwards compatibility
......
...@@ -28,6 +28,7 @@ class ValidatorBase: ...@@ -28,6 +28,7 @@ class ValidatorBase:
"a user could submit a field that since got disabled, or " "a user could submit a field that since got disabled, or "
"get a validation error as a field suddenly got enabled that " "get a validation error as a field suddenly got enabled that "
"wasn't there when the form was drawn."), "wasn't there when the form was drawn."),
css_class="form-check-input",
default=1) default=1)
editable = fields.CheckBoxField('editable', editable = fields.CheckBoxField('editable',
...@@ -36,6 +37,7 @@ class ValidatorBase: ...@@ -36,6 +37,7 @@ class ValidatorBase:
"If a field is not editable, then the user can only see" "If a field is not editable, then the user can only see"
"the value. This allows to drawn very different forms depending" "the value. This allows to drawn very different forms depending"
"on use permissions."), "on use permissions."),
css_class="form-check-input",
default=1) default=1)
def raise_error(self, error_key, field): def raise_error(self, error_key, field):
...@@ -64,6 +66,7 @@ class Validator(ValidatorBase): ...@@ -64,6 +66,7 @@ class Validator(ValidatorBase):
"arguments to this method. Your method should return true if the " "arguments to this method. Your method should return true if the "
"validation succeeded. Anything else will cause " "validation succeeded. Anything else will cause "
"'external_validator_failed' to be raised."), "'external_validator_failed' to be raised."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -88,6 +91,7 @@ class StringBaseValidator(Validator): ...@@ -88,6 +91,7 @@ class StringBaseValidator(Validator):
description=( description=(
"Checked if the field preserves whitespace. This means even " "Checked if the field preserves whitespace. This means even "
"just whitespace input is considered to be data."), "just whitespace input is considered to be data."),
css_class="form-check-input",
default=0) default=0)
message_names = Validator.message_names + ['required_not_found'] message_names = Validator.message_names + ['required_not_found']
...@@ -123,6 +127,7 @@ class StringValidator(StringBaseValidator): ...@@ -123,6 +127,7 @@ class StringValidator(StringBaseValidator):
description=( description=(
"Checked if the field delivers a unicode string instead of an " "Checked if the field delivers a unicode string instead of an "
"8-bit string."), "8-bit string."),
css_class="form-check-input",
default=0) default=0)
max_length = fields.IntegerField('max_length', max_length = fields.IntegerField('max_length',
...@@ -131,6 +136,7 @@ class StringValidator(StringBaseValidator): ...@@ -131,6 +136,7 @@ class StringValidator(StringBaseValidator):
"The maximum amount of characters that can be entered in this " "The maximum amount of characters that can be entered in this "
"field. If set to 0 or is left empty, there is no maximum. " "field. If set to 0 or is left empty, there is no maximum. "
"Note that this is server side validation."), "Note that this is server side validation."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -140,6 +146,7 @@ class StringValidator(StringBaseValidator): ...@@ -140,6 +146,7 @@ class StringValidator(StringBaseValidator):
"If checked, truncate the field if it receives more input than is " "If checked, truncate the field if it receives more input than is "
"allowed. The normal behavior in this case is to raise a validation " "allowed. The normal behavior in this case is to raise a validation "
"error, but the text can be silently truncated instead."), "error, but the text can be silently truncated instead."),
css_class="form-check-input",
default=0) default=0)
message_names = StringBaseValidator.message_names +\ message_names = StringBaseValidator.message_names +\
...@@ -208,7 +215,8 @@ class PatternValidator(StringValidator): ...@@ -208,7 +215,8 @@ class PatternValidator(StringValidator):
"should appear literally in the value in that place. Internal " "should appear literally in the value in that place. Internal "
"whitespace is checked as well but may be included in any amount. " "whitespace is checked as well but may be included in any amount. "
"Example: 'dddd ee' is a Dutch zipcode (postcode). " "Example: 'dddd ee' is a Dutch zipcode (postcode). "
"NOTE: currently experimental and details may change!") "NOTE: currently experimental and details may change!"),
css_class="form-control",
) )
message_names = StringValidator.message_names +\ message_names = StringValidator.message_names +\
...@@ -235,6 +243,7 @@ class BooleanValidator(Validator): ...@@ -235,6 +243,7 @@ class BooleanValidator(Validator):
title='Required', title='Required',
description=( description=(
"Checked if the field is required; the user has to check."), "Checked if the field is required; the user has to check."),
css_class="form-check-input",
default=0) default=0)
message_names = Validator.message_names + ['required_not_found'] message_names = Validator.message_names + ['required_not_found']
...@@ -264,6 +273,7 @@ class IntegerValidator(StringBaseValidator): ...@@ -264,6 +273,7 @@ class IntegerValidator(StringBaseValidator):
description=( description=(
"The integer entered by the user must be larger than or equal to " "The integer entered by the user must be larger than or equal to "
"this value. If left empty, there is no minimum."), "this value. If left empty, there is no minimum."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -272,6 +282,7 @@ class IntegerValidator(StringBaseValidator): ...@@ -272,6 +282,7 @@ class IntegerValidator(StringBaseValidator):
description=( description=(
"The integer entered by the user must be smaller than this " "The integer entered by the user must be smaller than this "
"value. If left empty, there is no maximum."), "value. If left empty, there is no maximum."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -381,6 +392,7 @@ class LinesValidator(StringBaseValidator): ...@@ -381,6 +392,7 @@ class LinesValidator(StringBaseValidator):
description=( description=(
"Checked if the field delivers a unicode string instead of an " "Checked if the field delivers a unicode string instead of an "
"8-bit string."), "8-bit string."),
css_class="form-check-input",
default=0) default=0)
max_lines = fields.IntegerField('max_lines', max_lines = fields.IntegerField('max_lines',
...@@ -388,6 +400,7 @@ class LinesValidator(StringBaseValidator): ...@@ -388,6 +400,7 @@ class LinesValidator(StringBaseValidator):
description=( description=(
"The maximum amount of lines a user can enter. If set to 0, " "The maximum amount of lines a user can enter. If set to 0, "
"or is left empty, there is no maximum."), "or is left empty, there is no maximum."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -396,6 +409,7 @@ class LinesValidator(StringBaseValidator): ...@@ -396,6 +409,7 @@ class LinesValidator(StringBaseValidator):
description=( description=(
"The maximum length of a line. If set to 0 or is left empty, there " "The maximum length of a line. If set to 0 or is left empty, there "
"is no maximum."), "is no maximum."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -404,6 +418,7 @@ class LinesValidator(StringBaseValidator): ...@@ -404,6 +418,7 @@ class LinesValidator(StringBaseValidator):
description=( description=(
"The maximum total length in characters that the user may enter. " "The maximum total length in characters that the user may enter. "
"If set to 0 or is left empty, there is no maximum."), "If set to 0 or is left empty, there is no maximum."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -474,6 +489,7 @@ class SelectionValidator(StringBaseValidator): ...@@ -474,6 +489,7 @@ class SelectionValidator(StringBaseValidator):
description=( description=(
"Checked if the field delivers a unicode string instead of an " "Checked if the field delivers a unicode string instead of an "
"8-bit string."), "8-bit string."),
css_class="form-check-input",
default=0) default=0)
message_names = StringBaseValidator.message_names +\ message_names = StringBaseValidator.message_names +\
...@@ -522,6 +538,7 @@ class MultiSelectionValidator(Validator): ...@@ -522,6 +538,7 @@ class MultiSelectionValidator(Validator):
description=( description=(
"Checked if the field is required; the user has to fill in some " "Checked if the field is required; the user has to fill in some "
"data."), "data."),
css_class="form-check-input",
default=1) default=1)
unicode = fields.CheckBoxField('unicode', unicode = fields.CheckBoxField('unicode',
...@@ -529,6 +546,7 @@ class MultiSelectionValidator(Validator): ...@@ -529,6 +546,7 @@ class MultiSelectionValidator(Validator):
description=( description=(
"Checked if the field delivers a unicode string instead of an " "Checked if the field delivers a unicode string instead of an "
"8-bit string."), "8-bit string."),
css_class="form-check-input",
default=0) default=0)
message_names = Validator.message_names + ['required_not_found', message_names = Validator.message_names + ['required_not_found',
...@@ -600,6 +618,7 @@ class FileValidator(Validator): ...@@ -600,6 +618,7 @@ class FileValidator(Validator):
description=( description=(
"Checked if the field is required; the " "Checked if the field is required; the "
"user has to fill in some data."), "user has to fill in some data."),
css_class="form-check-input",
default=0) default=0)
property_names = Validator.property_names + ['required'] property_names = Validator.property_names + ['required']
...@@ -640,17 +659,20 @@ class LinkValidator(StringValidator): ...@@ -640,17 +659,20 @@ class LinkValidator(StringValidator):
title='Check Link', title='Check Link',
description=( description=(
"Check whether the link is not broken."), "Check whether the link is not broken."),
css_class="form-check-input",
default=0) default=0)
check_timeout = fields.FloatField('check_timeout', check_timeout = fields.FloatField('check_timeout',
title='Check Timeout', title='Check Timeout',
description=( description=(
"Maximum amount of seconds to check link. Required"), "Maximum amount of seconds to check link. Required"),
css_class="form-control",
default=7.0, default=7.0,
required=1) required=1)
link_type = fields.ListField('link_type', link_type = fields.ListField('link_type',
title='Type of Link', title='Type of Link',
css_class="form-control",
default="external", default="external",
size=1, size=1,
items=[('External Link', 'external'), items=[('External Link', 'external'),
...@@ -716,6 +738,7 @@ class DateTimeValidator(Validator): ...@@ -716,6 +738,7 @@ class DateTimeValidator(Validator):
description=( description=(
"Checked if the field is required; the user has to enter something " "Checked if the field is required; the user has to enter something "
"in the field."), "in the field."),
css_class="form-check-input",
default=1) default=1)
start_datetime = fields.DateTimeField('start_datetime', start_datetime = fields.DateTimeField('start_datetime',
...@@ -723,6 +746,7 @@ class DateTimeValidator(Validator): ...@@ -723,6 +746,7 @@ class DateTimeValidator(Validator):
description=( description=(
"The date and time entered must be later than or equal to " "The date and time entered must be later than or equal to "
"this date/time. If left empty, no check is performed."), "this date/time. If left empty, no check is performed."),
css_class="form-control",
default=None, default=None,
input_style="text", input_style="text",
required=0) required=0)
...@@ -732,6 +756,7 @@ class DateTimeValidator(Validator): ...@@ -732,6 +756,7 @@ class DateTimeValidator(Validator):
description=( description=(
"The date and time entered must be earlier than " "The date and time entered must be earlier than "
"this date/time. If left empty, no check is performed."), "this date/time. If left empty, no check is performed."),
css_class="form-control",
default=None, default=None,
input_style="text", input_style="text",
required=0) required=0)
...@@ -741,6 +766,7 @@ class DateTimeValidator(Validator): ...@@ -741,6 +766,7 @@ class DateTimeValidator(Validator):
description=( description=(
"Allow time to be left empty. Time will default to midnight " "Allow time to be left empty. Time will default to midnight "
"on that date."), "on that date."),
css_class="form-check-input",
default=0) default=0)
message_names = Validator.message_names + ['required_not_found', message_names = Validator.message_names + ['required_not_found',
......
...@@ -100,6 +100,7 @@ class Widget: ...@@ -100,6 +100,7 @@ class Widget:
description=( description=(
"The title of this field. This is the title of the field that " "The title of this field. This is the title of the field that "
"will appear in the form when it is displayed. Required."), "will appear in the form when it is displayed. Required."),
css_class="form-control",
default="", default="",
required=1) required=1)
...@@ -109,6 +110,7 @@ class Widget: ...@@ -109,6 +110,7 @@ class Widget:
"Description of this field. The description property can be " "Description of this field. The description property can be "
"used to add a short description of what a field does; such as " "used to add a short description of what a field does; such as "
"this one."), "this one."),
css_class="form-control",
default="", default="",
width="20", height="3", width="20", height="3",
required=0) required=0)
...@@ -118,6 +120,7 @@ class Widget: ...@@ -118,6 +120,7 @@ class Widget:
description=( description=(
"The CSS class of the field. This can be used to style your " "The CSS class of the field. This can be used to style your "
"formulator fields using cascading style sheets. Not required."), "formulator fields using cascading style sheets. Not required."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -128,6 +131,7 @@ class Widget: ...@@ -128,6 +131,7 @@ class Widget:
"the result dictionary when doing validation, and in the REQUEST " "the result dictionary when doing validation, and in the REQUEST "
"if validation goes to request. This can be used to support names " "if validation goes to request. This can be used to support names "
"that cannot be used as Zope ids."), "that cannot be used as Zope ids."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -137,6 +141,7 @@ class Widget: ...@@ -137,6 +141,7 @@ class Widget:
"This field will be on the form, but as a hidden field. The " "This field will be on the form, but as a hidden field. The "
"contents of the hidden field will be the default value. " "contents of the hidden field will be the default value. "
"Hidden fields are not visible but will be validated."), "Hidden fields are not visible but will be validated."),
css_class="form-check-input",
default=0) default=0)
# NOTE: for ordering reasons (we want extra at the end), # NOTE: for ordering reasons (we want extra at the end),
...@@ -149,6 +154,7 @@ class Widget: ...@@ -149,6 +154,7 @@ class Widget:
"string will be literally included in the rendered field." "string will be literally included in the rendered field."
"This property can be useful if you want " "This property can be useful if you want "
"to add an onClick attribute to use with JavaScript, for instance."), "to add an onClick attribute to use with JavaScript, for instance."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -375,6 +381,7 @@ class TextWidget(Widget): ...@@ -375,6 +381,7 @@ class TextWidget(Widget):
"You can place text here that will be used as the default " "You can place text here that will be used as the default "
"value of the field, unless the programmer supplies an override " "value of the field, unless the programmer supplies an override "
"when the form is being generated."), "when the form is being generated."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -382,6 +389,7 @@ class TextWidget(Widget): ...@@ -382,6 +389,7 @@ class TextWidget(Widget):
title='Display width', title='Display width',
description=( description=(
"The width in characters. Required."), "The width in characters. Required."),
css_class="form-control",
default=20, default=20,
required=1) required=1)
...@@ -391,6 +399,7 @@ class TextWidget(Widget): ...@@ -391,6 +399,7 @@ class TextWidget(Widget):
"The maximum input in characters that the widget will allow. " "The maximum input in characters that the widget will allow. "
"Required. If set to 0 or is left empty, there is no maximum. " "Required. If set to 0 or is left empty, there is no maximum. "
"Note that is client side behavior only."), "Note that is client side behavior only."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -400,6 +409,7 @@ class TextWidget(Widget): ...@@ -400,6 +409,7 @@ class TextWidget(Widget):
"The type of the input field like 'color', 'date', 'email' etc." "The type of the input field like 'color', 'date', 'email' etc."
"Note input types, not supported by old web browsers, will behave " "Note input types, not supported by old web browsers, will behave "
"as input type text."), "as input type text."),
css_class="form-control",
default="text", default="text",
required=0) required=0)
...@@ -505,6 +515,7 @@ class CheckBoxWidget(Widget): ...@@ -505,6 +515,7 @@ class CheckBoxWidget(Widget):
description=( description=(
"Default setting of the widget; either checked or unchecked. " "Default setting of the widget; either checked or unchecked. "
"(true or false)"), "(true or false)"),
css_class="form-check-input",
default=0) default=0)
def render(self, field, key, value, REQUEST, render_prefix=None): def render(self, field, key, value, REQUEST, render_prefix=None):
...@@ -648,6 +659,7 @@ class TextAreaWidget(Widget): ...@@ -648,6 +659,7 @@ class TextAreaWidget(Widget):
title='Default', title='Default',
description=( description=(
"Default value of the text in the widget."), "Default value of the text in the widget."),
css_class="form-control",
default="", default="",
width=20, height=3, width=20, height=3,
required=0) required=0)
...@@ -656,6 +668,7 @@ class TextAreaWidget(Widget): ...@@ -656,6 +668,7 @@ class TextAreaWidget(Widget):
title='Width', title='Width',
description=( description=(
"The width (columns) in characters. Required."), "The width (columns) in characters. Required."),
css_class="form-control",
default=40, default=40,
required=1) required=1)
...@@ -663,6 +676,7 @@ class TextAreaWidget(Widget): ...@@ -663,6 +676,7 @@ class TextAreaWidget(Widget):
title="Height", title="Height",
description=( description=(
"The height (rows) in characters. Required."), "The height (rows) in characters. Required."),
css_class="form-control",
default=5, default=5,
required=1) required=1)
...@@ -718,6 +732,7 @@ class LinesTextAreaWidget(TextAreaWidget): ...@@ -718,6 +732,7 @@ class LinesTextAreaWidget(TextAreaWidget):
title='Default', title='Default',
description=( description=(
"Default value of the lines in the widget."), "Default value of the lines in the widget."),
css_class="form-control",
default=[], default=[],
width=20, height=3, width=20, height=3,
required=0) required=0)
...@@ -727,6 +742,7 @@ class LinesTextAreaWidget(TextAreaWidget): ...@@ -727,6 +742,7 @@ class LinesTextAreaWidget(TextAreaWidget):
description=( description=(
"When called with render_view, this separator will be used to " "When called with render_view, this separator will be used to "
"render individual items."), "render individual items."),
css_class="form-control",
width=20, width=20,
default='<br />\n', default='<br />\n',
whitespace_preserve=1, whitespace_preserve=1,
...@@ -818,7 +834,7 @@ class ItemsWidget(Widget): ...@@ -818,7 +834,7 @@ class ItemsWidget(Widget):
"element of the tuple should be the value that will be submitted. " "element of the tuple should be the value that will be submitted. "
"If you want to override this property you will therefore have " "If you want to override this property you will therefore have "
"to return such a list."), "to return such a list."),
css_class="form-control",
default=[], default=[],
width=20, width=20,
height=5, height=5,
...@@ -835,6 +851,7 @@ class ItemsWidget(Widget): ...@@ -835,6 +851,7 @@ class ItemsWidget(Widget):
"field. This property can be useful if you want " "field. This property can be useful if you want "
"to add a disabled attribute to disable all contained items, for " "to add a disabled attribute to disable all contained items, for "
"instance."), "instance."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -858,6 +875,7 @@ class SingleItemsWidget(ItemsWidget): ...@@ -858,6 +875,7 @@ class SingleItemsWidget(ItemsWidget):
description=( description=(
"The default value of the widget; this should be one of the " "The default value of the widget; this should be one of the "
"elements in the list of items."), "elements in the list of items."),
css_class="form-control",
default="", default="",
required=0) required=0)
...@@ -866,6 +884,7 @@ class SingleItemsWidget(ItemsWidget): ...@@ -866,6 +884,7 @@ class SingleItemsWidget(ItemsWidget):
description=( description=(
"If checked, the first item will always be selected if " "If checked, the first item will always be selected if "
"no initial default value is supplied."), "no initial default value is supplied."),
css_class="form-check-input",
default=0) default=0)
def render_items(self, field, key, value, REQUEST, render_prefix=None): def render_items(self, field, key, value, REQUEST, render_prefix=None):
...@@ -986,6 +1005,7 @@ class MultiItemsWidget(ItemsWidget): ...@@ -986,6 +1005,7 @@ class MultiItemsWidget(ItemsWidget):
"The initial selections of the widget. This is a list of " "The initial selections of the widget. This is a list of "
"zero or more values. If you override this property from Python " "zero or more values. If you override this property from Python "
"your code should return a Python list."), "your code should return a Python list."),
css_class="form-control",
width=20, height=3, width=20, height=3,
default=[], default=[],
required=0) required=0)
...@@ -995,6 +1015,7 @@ class MultiItemsWidget(ItemsWidget): ...@@ -995,6 +1015,7 @@ class MultiItemsWidget(ItemsWidget):
description=( description=(
"When called with render_view, this separator will be used to " "When called with render_view, this separator will be used to "
"render individual items."), "render individual items."),
css_class="form-control",
width=20, width=20,
default='<br />\n', default='<br />\n',
whitespace_preserve=1, whitespace_preserve=1,
...@@ -1169,6 +1190,7 @@ class ListWidget(SingleItemsWidget): ...@@ -1169,6 +1190,7 @@ class ListWidget(SingleItemsWidget):
"The display size in rows of the field. If set to 1, the " "The display size in rows of the field. If set to 1, the "
"widget will be displayed as a drop down box by many browsers, " "widget will be displayed as a drop down box by many browsers, "
"if set to something higher, a list will be shown. Required."), "if set to something higher, a list will be shown. Required."),
css_class="form-control",
default=5, default=5,
required=1) required=1)
...@@ -1216,6 +1238,7 @@ class MultiListWidget(MultiItemsWidget): ...@@ -1216,6 +1238,7 @@ class MultiListWidget(MultiItemsWidget):
"The display size in rows of the field. If set to 1, the " "The display size in rows of the field. If set to 1, the "
"widget will be displayed as a drop down box by many browsers, " "widget will be displayed as a drop down box by many browsers, "
"if set to something higher, a list will be shown. Required."), "if set to something higher, a list will be shown. Required."),
css_class="form-control",
default=5, default=5,
required=1) required=1)
...@@ -1262,6 +1285,7 @@ class RadioWidget(SingleItemsWidget): ...@@ -1262,6 +1285,7 @@ class RadioWidget(SingleItemsWidget):
description=( description=(
"Orientation of the radio buttons. The radio buttons will " "Orientation of the radio buttons. The radio buttons will "
"be drawn either vertically or horizontally."), "be drawn either vertically or horizontally."),
css_class="form-control",
default="vertical", default="vertical",
required=1, required=1,
size=1, size=1,
...@@ -1313,6 +1337,7 @@ class MultiCheckBoxWidget(MultiItemsWidget): ...@@ -1313,6 +1337,7 @@ class MultiCheckBoxWidget(MultiItemsWidget):
description=( description=(
"Orientation of the check boxes. The check boxes will " "Orientation of the check boxes. The check boxes will "
"be drawn either vertically or horizontally."), "be drawn either vertically or horizontally."),
css_class="form-control",
default="vertical", default="vertical",
required=1, required=1,
size=1, size=1,
...@@ -1375,6 +1400,7 @@ class DateTimeWidget(Widget): ...@@ -1375,6 +1400,7 @@ class DateTimeWidget(Widget):
description=( description=(
"The day will be hidden on the output. Instead the default" "The day will be hidden on the output. Instead the default"
"Day will be taken"), "Day will be taken"),
css_class="form-check-input",
default=0) default=0)
hidden_day_is_last_day = fields.CheckBoxField('hidden_day_is_last_day', hidden_day_is_last_day = fields.CheckBoxField('hidden_day_is_last_day',
...@@ -1382,16 +1408,19 @@ class DateTimeWidget(Widget): ...@@ -1382,16 +1408,19 @@ class DateTimeWidget(Widget):
description=( description=(
"Defines wether hidden day means, you want the last day of the month" "Defines wether hidden day means, you want the last day of the month"
"Else it will be the first day"), "Else it will be the first day"),
css_class="form-check-input",
default=0) default=0)
timezone_style = fields.CheckBoxField('timezone_style', timezone_style = fields.CheckBoxField('timezone_style',
title="Display timezone", title="Display timezone",
description=("Display timezone"), description=("Display timezone"),
css_class="form-check-input",
default=0) default=0)
default = fields.DateTimeField('default', default = fields.DateTimeField('default',
title="Default", title="Default",
description=("The default datetime."), description=("The default datetime."),
css_class="form-control",
default=None, default=None,
display_style="text", display_style="text",
display_order="ymd", display_order="ymd",
...@@ -1403,12 +1432,14 @@ class DateTimeWidget(Widget): ...@@ -1403,12 +1432,14 @@ class DateTimeWidget(Widget):
description=( description=(
"Default date and time will be the date and time at showing of " "Default date and time will be the date and time at showing of "
"the form (if the default is left empty)."), "the form (if the default is left empty)."),
css_class="form-check-input",
default=0) default=0)
date_separator = fields.StringField('date_separator', date_separator = fields.StringField('date_separator',
title='Date separator', title='Date separator',
description=( description=(
"Separator to appear between year, month, day."), "Separator to appear between year, month, day."),
css_class="form-control",
default="/", default="/",
required=0, required=0,
display_width=2, display_width=2,
...@@ -1419,6 +1450,7 @@ class DateTimeWidget(Widget): ...@@ -1419,6 +1450,7 @@ class DateTimeWidget(Widget):
title='Time separator', title='Time separator',
description=( description=(
"Separator to appear between hour and minutes."), "Separator to appear between hour and minutes."),
css_class="form-control",
default=":", default=":",
required=0, required=0,
display_width=2, display_width=2,
...@@ -1430,6 +1462,7 @@ class DateTimeWidget(Widget): ...@@ -1430,6 +1462,7 @@ class DateTimeWidget(Widget):
description=( description=(
"The type of input used. 'text' will show the date part " "The type of input used. 'text' will show the date part "
"as text, while 'list' will use dropdown lists instead."), "as text, while 'list' will use dropdown lists instead."),
css_class="form-control",
default="text", default="text",
items=[("text", "text"), items=[("text", "text"),
("list", "list"), ("list", "list"),
...@@ -1440,6 +1473,7 @@ class DateTimeWidget(Widget): ...@@ -1440,6 +1473,7 @@ class DateTimeWidget(Widget):
title="Default Timezone", title="Default Timezone",
description=( description=(
"The default timezone display when inputing a new date"), "The default timezone display when inputing a new date"),
css_class="form-control",
default="GMT", default="GMT",
items=gmt_timezones, items=gmt_timezones,
required=1, required=1,
...@@ -1450,6 +1484,7 @@ class DateTimeWidget(Widget): ...@@ -1450,6 +1484,7 @@ class DateTimeWidget(Widget):
description=( description=(
"The order in which date input should take place. Either " "The order in which date input should take place. Either "
"year/month/day, day/month/year or month/day/year."), "year/month/day, day/month/year or month/day/year."),
css_class="form-control",
default="ymd", default="ymd",
items=[("year/month/day", "ymd"), items=[("year/month/day", "ymd"),
("day/month/year", "dmy"), ("day/month/year", "dmy"),
...@@ -1461,12 +1496,14 @@ class DateTimeWidget(Widget): ...@@ -1461,12 +1496,14 @@ class DateTimeWidget(Widget):
title="Display date only", title="Display date only",
description=( description=(
"Display the date only, not the time."), "Display the date only, not the time."),
css_class="form-check-input",
default=0) default=0)
ampm_time_style = fields.CheckBoxField('ampm_time_style', ampm_time_style = fields.CheckBoxField('ampm_time_style',
title="AM/PM time style", title="AM/PM time style",
description=( description=(
"Display time in am/pm format."), "Display time in am/pm format."),
css_class="form-check-input",
default=0) default=0)
property_names = Widget.property_names +\ property_names = Widget.property_names +\
...@@ -1900,6 +1937,7 @@ class FloatWidget(TextWidget): ...@@ -1900,6 +1937,7 @@ class FloatWidget(TextWidget):
title="Input style", title="Input style",
description=( description=(
"The type of float we should enter. "), "The type of float we should enter. "),
css_class="form-control",
default="-1234.5", default="-1234.5",
items=[("-1234.5", "-1234.5"), items=[("-1234.5", "-1234.5"),
("-1 234.5", "-1 234.5"), ("-1 234.5", "-1 234.5"),
...@@ -1914,6 +1952,7 @@ class FloatWidget(TextWidget): ...@@ -1914,6 +1952,7 @@ class FloatWidget(TextWidget):
title='Precision', title='Precision',
description=( description=(
"Number of digits after the decimal point"), "Number of digits after the decimal point"),
css_class="form-control",
default='', default='',
required=0) required=0)
......
<style>form td:not(:last-child) { padding-right: 1em; }</style>
<dtml-var manage_page_header> <dtml-var manage_page_header>
<style>
textarea.form-control {
resize: both;
}
textarea.form-control, input[type=text].form-control {
font-family: monospace;
}
</style>
<dtml-let help_product="'Formulator'" help_topic=meta_type> <dtml-let help_product="'Formulator'" help_topic=meta_type>
<dtml-var manage_tabs> <dtml-var manage_tabs>
</dtml-let> </dtml-let>
<p class="form-help">
<main class="container-fluid">
<p class="form-help lead">
Edit <dtml-var meta_type> properties here. Edit <dtml-var meta_type> properties here.
</p> </p>
<form action="manage_edit" method="POST"> <form action="manage_edit" method="POST">
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<dtml-in "form.get_groups()"> <dtml-in "form.get_groups()">
<dtml-let group=sequence-item fields="form.get_fields_in_group(group)"> <dtml-let group=sequence-item fields="form.get_fields_in_group(group)">
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="4" class="form-title"> <td colspan="4" class="font-weight-bold">
<dtml-var group capitalize> properties <dtml-var group capitalize> properties
</td> </td>
</tr> </tr>
...@@ -26,24 +35,25 @@ Edit <dtml-var meta_type> properties here. ...@@ -26,24 +35,25 @@ Edit <dtml-var meta_type> properties here.
<dtml-let current_field="this()"> <dtml-let current_field="this()">
<dtml-in fields> <dtml-in fields>
<dtml-let field=sequence-item field_id="field.id" <dtml-let field=sequence-item field_id="field.id"
is_datetime_field="field.meta_type == 'DateTimeField'"
value="current_field.get_orig_value(field_id)" value="current_field.get_orig_value(field_id)"
override="current_field.get_override(field_id)" override="current_field.get_override(field_id)"
tales="current_field.get_tales(field_id)"> tales="current_field.get_tales(field_id)">
<tr> <tr>
<td align="left" valign="top"> <td>
<div class="form-label"> <dtml-if "tales or override">[</dtml-if><dtml-var "field.title()"><dtml-if "field.has_value('required') and field.get_value('required')">*</dtml-if><dtml-if "tales or override">]</dtml-if>
<dtml-if "tales or override">[</dtml-if><dtml-var "field.title()"><dtml-if "field.has_value('required') and field.get_value('required')">*</dtml-if><dtml-if "tales or override">]</dtml-if> </td>
</div> <td class="<dtml-if is_datetime_field>form-inline</dtml-if>">
<dtml-var "field.render(value)">
</td> </td>
<td align="left" valign="top"> <td>
<dtml-var "field.render(value)"> <dtml-var "field.meta_type">
</td>
<td>
<p class="form-text">
<small><dtml-var "field.get_value('description')"></small>
</p>
</td> </td>
<td valign="top" ><div class="form-element">
<dtml-var "field.meta_type">
</div></td>
<td align="left" valign="top"><div class="form-element">
<dtml-var "field.get_value('description')">
</div></td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
...@@ -53,13 +63,12 @@ Edit <dtml-var meta_type> properties here. ...@@ -53,13 +63,12 @@ Edit <dtml-var meta_type> properties here.
</dtml-in> </dtml-in>
</table> </table>
<div class="form-element"> <div class="zmi-controls">
<input class="form-element" type="submit" name="submit" <input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
value="Save Changes" /> </div>
</div>
</form> </form>
</main>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
......
<tr class="list-header"> <thead class="thead-light">
<td align="left" valign="top"> <tr>
<div class="form-label"> <th>
Name Name
</div> </th>
</td> <th class="w-50">
<td align="left" valign="top">
<div class="form-label">
Value Value
</div> </th>
</td> <th>
<td align="left" valign="top">
<div class="form-label">
Field Field
</div> </th>
</td>
<dtml-if "_['URL'].endswith(('/manage_main', '/manage_edit'))"> <dtml-if "_['URL'].endswith(('/manage_main', '/manage_edit'))">
<td align="left" valign="top"> <th>
<div class="form-label">
Description Description
</div> </th>
</td>
</dtml-if> </dtml-if>
</tr> </tr>
\ No newline at end of file </thead>
\ No newline at end of file
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<main class="container-fluid">
<p class="form-help"> <p class="form-help lead">
Edit <dtml-var meta_type> error messages here. Edit <dtml-var meta_type> error messages here.
</p> </p>
<form action="manage_messages" method="POST"> <form action="manage_messages" method="POST">
<table border="0"> <table class="table table-striped table-hover table-sm">
<dtml-in "get_error_names()"> <dtml-in "get_error_names()">
<dtml-let name=sequence-item value="get_error_message(name)"> <dtml-let name=sequence-item value="get_error_message(name)">
<tr> <tr>
<td class="form-label"><dtml-var name></td> <td class="form-label"><dtml-var name></td>
<td><textarea name="&dtml-name;" cols="50" rows="4"><dtml-var value></textarea></td> <td><textarea class="form-control" name="&dtml-name;" cols="50" rows="4"><dtml-var value></textarea></td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
<tr><td><input type="submit" value=" OK "></td></tr>
</table> </table>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
</div>
</form> </form>
</main>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<main class="container-fluid">
<p class="form-help"> <p class="form-help lead">
Edit <dtml-var meta_type> method overrides here. Edit <dtml-var meta_type> method overrides here.
</p> </p>
<form action="manage_override" method="POST"> <form action="manage_override" method="POST">
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<dtml-in "override_form.get_groups()"> <dtml-in "override_form.get_groups()">
<dtml-let group=sequence-item fields="override_form.get_fields_in_group(group)"> <dtml-let group=sequence-item fields="override_form.get_fields_in_group(group)">
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="3" class="form-title"> <td colspan="3" class="font-weight-bold">
<dtml-var group capitalize> properties <dtml-var group capitalize> properties
</td> </td>
</tr> </tr>
...@@ -24,19 +25,18 @@ Edit <dtml-var meta_type> method overrides here. ...@@ -24,19 +25,18 @@ Edit <dtml-var meta_type> method overrides here.
<dtml-in fields> <dtml-in fields>
<dtml-let field=sequence-item field_id="field.id" <dtml-let field=sequence-item field_id="field.id"
value="current_field.get_override(field.id)"> value="current_field.get_override(field.id)">
<tr> <tr>
<td align="left" valign="top"> <td>
<div class="form-label">
<dtml-var "field.title()"> <dtml-var "field.title()">
</div> </td>
</td> <td>
<td align="left" valign="top">
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td> </td>
<td valign="top"><div class="form-element"> <td>
<dtml-var "current_field.form.get_field(field.id).meta_type"> <dtml-var "current_field.form.get_field(field.id).meta_type">
</div></td> </td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
</dtml-let> </dtml-let>
...@@ -44,15 +44,12 @@ Edit <dtml-var meta_type> method overrides here. ...@@ -44,15 +44,12 @@ Edit <dtml-var meta_type> method overrides here.
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
<tr>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value="Save Changes" />
</div>
</td>
</tr>
</table> </table>
</form>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
</div>
</form>
</main>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
<style>form td:not(:last-child) { padding-right: 1em; }</style>
<dtml-var manage_page_header> <dtml-var manage_page_header>
<dtml-var manage_tabs> <dtml-var manage_tabs>
<p class="form-help"> <main class="container-fluid">
<p class="form-help lead">
Edit <dtml-var meta_type> method TALES expressions here. Edit <dtml-var meta_type> method TALES expressions here.
<dtml-if "not isTALESAvailable()"><br> <dtml-if "not isTALESAvailable()"><br>
<span style="color: #FF0000;"> <span style="color: #FF0000;">
...@@ -13,50 +13,52 @@ This tab can therefore not be used. ...@@ -13,50 +13,52 @@ This tab can therefore not be used.
</p> </p>
<form action="manage_tales" method="POST"> <form action="manage_tales" method="POST">
<table cellspacing="0" cellpadding="2" border="0"> <table class="table table-striped table-hover table-sm">
<dtml-in "override_form.get_groups()"> <dtml-in "override_form.get_groups()">
<dtml-let group=sequence-item fields="tales_form.get_fields_in_group(group)"> <dtml-let group=sequence-item fields="tales_form.get_fields_in_group(group)">
<dtml-if fields> <dtml-if fields>
<tr> <tr>
<td colspan="3" class="form-title"> <td colspan="3" class="font-weight-bold">
<dtml-var group capitalize> properties <dtml-var group capitalize> properties
</td> </td>
</tr> </tr>
<dtml-var fieldListHeader> <dtml-var fieldListHeader>
<dtml-let current_field="this()"> <dtml-let current_field="this()">
<dtml-in fields> <dtml-in fields>
<dtml-let field=sequence-item field_id="field.id" <dtml-let field=sequence-item field_id="field.id"
value="current_field.get_tales(field.id)"> value="current_field.get_tales(field.id)">
<tr>
<td align="left" valign="top"> <tr>
<div class="form-label"> <td>
<dtml-var "field.title()"> <dtml-var "field.title()">
</div> </td>
</td> <td>
<td align="left" valign="top">
<dtml-var "field.render(value)"> <dtml-var "field.render(value)">
</td> </td>
<td valign="top"><div class="form-element"> <td>
<dtml-var "current_field.form.get_field(field.id).meta_type"> <dtml-var "current_field.form.get_field(field.id).meta_type">
</div></td> </td>
</tr> </tr>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
</dtml-let> </dtml-let>
</dtml-if> </dtml-if>
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
</div>
</table> </table>
<div class="form-element"> <div class="zmi-controls">
<input class="form-element" type="submit" name="submit" <input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
value="Save Changes" /> </div>
</div>
</form> </form>
</main>
<dtml-var manage_page_footer> <dtml-var manage_page_footer>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment