Commit 40b116a0 authored by Jérome Perrin's avatar Jérome Perrin

Form: modernize add field in ZMI

parent af788214
Pipeline #38553 failed with stage
in 0 seconds
......@@ -456,6 +456,7 @@ def initializeForm(field_registry, form_class=None):
# set up individual add dictionaries for meta_types
dict = { 'name': field.meta_type,
'permission': 'Add Formulator Fields',
'zmi_show_add_dialog': 'modal',
'action':
'manage_addProduct/Formulator/manage_add%sForm' % meta_type }
meta_types.append(dict)
......
<dtml-var manage_page_header>
<main class="container-fluid">
<dtml-var "manage_form_title(this(), _,
form_title='Add %s' % fieldname,
)">
......@@ -10,43 +12,29 @@ Add a <dtml-var fieldname> to the form.
<form action="manage_addField" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Id
<div class="form-group row">
<label for="id" class="form-label col-sm-3 col-md-2">Id</label>
<div class="col-sm-9 col-md-10">
<input id="id" class="form-control code" type="text" name="id" />
</div>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Title
<div class="form-group row">
<label for="title" class="form-label col-sm-3 col-md-2">Title</label>
<div class="col-sm-9 col-md-10">
<input id="title" class="form-control" type="text" name="title" />
</div>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="title" size="40" />
</td>
</tr>
<input type="hidden" name="fieldname" value="&dtml-fieldname;">
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit_add"
value=" Add " />
<input class="form-element" type="submit" name="submit_add_and_edit"
value=" Add and Edit " />
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<input class="btn btn-primary" type="submit" name="submit_add_and_edit" value="Add and Edit" />
</div>
</td>
</tr>
</table>
</form>
</main>
<dtml-var manage_page_footer>
......@@ -1053,6 +1053,7 @@ def initializeForm(field_registry):
# set up individual add dictionaries for meta_types
dict = { 'name': field.meta_type,
'zmi_show_add_dialog': 'modal',
'action':
'manage_addProduct/Formulator/manage_add%sForm' % meta_type }
meta_types.append(dict)
......
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