Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
40b116a0
Commit
40b116a0
authored
Nov 17, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Form: modernize add field in ZMI
parent
af788214
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
32 deletions
+22
-32
product/ERP5Form/Form.py
product/ERP5Form/Form.py
+1
-0
product/ERP5Form/dtml/fieldAdd.dtml
product/ERP5Form/dtml/fieldAdd.dtml
+20
-32
product/Formulator/Form.py
product/Formulator/Form.py
+1
-0
No files found.
product/ERP5Form/Form.py
View file @
40b116a0
...
...
@@ -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
)
...
...
product/ERP5Form/dtml/fieldAdd.dtml
View file @
40b116a0
<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>
product/Formulator/Form.py
View file @
40b116a0
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment