Commit 751d975a authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Add links to edit form and form action

parent a3c0e2f6
......@@ -105,6 +105,8 @@
.onStateChange(function onStateChange(modification_dict) {
var gadget = this,
options = modification_dict.options || {},
field_json = options.field_json,
span,
css_class,
i,
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>984.41193.2075.29252</string> </value>
<value> <string>987.42313.38411.5666</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1596116391.77</float>
<float>1604090662.46</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -1092,6 +1092,9 @@ div[data-gadget-scope='header'] .ui-header ul {
.gadget-content .ui-content-header-plain {
font-size: 150%;
}
.gadget-content .ui-content-header-plain > h3 > a {
padding-left: 3pt;
}
.gadget-content .worklist-empty {
max-width: 442px;
/* original size of the embedded image */
......
......@@ -281,7 +281,9 @@
]);
})
.push(function (translated_title_list) {
var action_confirm = form_gadget.element.querySelector('input.dialogconfirm');
var field_href,
form_definition = modification_dict.form_definition,
action_confirm = form_gadget.element.querySelector('input.dialogconfirm');
if (action_confirm !== null) {
if (form_gadget.state.action_title) {
action_confirm.value = form_gadget.state.action_title;
......@@ -292,6 +294,23 @@
selector.textContent = "\u00A0" + translated_title_list[0];
selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon;
if (form_definition.hasOwnProperty("edit_form_href")) {
field_href = document.createElement("a");
field_href.href = form_definition.edit_form_href;
field_href.title = "Edit this form";
field_href.appendChild(document.createElement("img"));
field_href.firstElementChild.src = form_definition.edit_form_icon;
selector.appendChild(field_href);
}
if (form_definition.hasOwnProperty("edit_form_action_href")) {
field_href = document.createElement("a");
field_href.href = form_definition.edit_form_action_href;
field_href.title = "Edit this form's action";
field_href.appendChild(document.createElement("img"));
field_href.firstElementChild.src = form_definition.edit_form_action_icon;
selector.appendChild(field_href);
}
// Render the erp5_from
return form_gadget.getDeclaredGadget("erp5_form");
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>987.241.33421.16076</string> </value>
<value> <string>987.42388.43014.21896</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1601565340.43</float>
<float>1604095960.55</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -1265,6 +1265,9 @@ div[data-gadget-scope='header'] .ui-header {
.ui-content-header-plain {
font-size: 150%;
& > h3 > a {
padding-left: 3pt;
}
}
.worklist-empty {
max-width: 442px; /* original size of the embedded image */
......
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