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

Form: modernize add field in ZMI

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