Commit f8055834 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: Add links to access form and listbox configuration

parent e3921c42
...@@ -216,11 +216,13 @@ ...@@ -216,11 +216,13 @@
})); }));
}) })
.push(function (result_list) { .push(function (result_list) {
var dom_element = form_gadget.element.querySelector(".field_container"),
parent_element,
field_href,
j;
if (modification_dict.hasOwnProperty('hash')) { if (modification_dict.hasOwnProperty('hash')) {
var dom_element = form_gadget.element parent_element = document.createDocumentFragment();
.querySelector(".field_container"),
j,
parent_element = document.createDocumentFragment();
// Add all fieldset into the fragment // Add all fieldset into the fragment
for (j = 0; j < result_list.length; j += 1) { for (j = 0; j < result_list.length; j += 1) {
parent_element.appendChild(result_list[j]); parent_element.appendChild(result_list[j]);
...@@ -230,6 +232,24 @@ ...@@ -230,6 +232,24 @@
} }
dom_element.appendChild(parent_element); dom_element.appendChild(parent_element);
} }
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;
dom_element.insertBefore(field_href, dom_element.firstChild);
}
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;
dom_element.firstElementChild.insertAdjacentElement(
"afterend", field_href);
}
}); });
}) })
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>979.61953.36209.9762</string> </value> <value> <string>987.50975.46561.32017</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1574329059.87</float> <float>1604609338.19</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -474,7 +474,6 @@ ...@@ -474,7 +474,6 @@
if (displayed_column_item_list.length === 0) { if (displayed_column_item_list.length === 0) {
displayed_column_item_list = field_json.column_list; displayed_column_item_list = field_json.column_list;
} }
return gadget.changeState({ return gadget.changeState({
key: field_json.key, key: field_json.key,
title: field_json.title, title: field_json.title,
...@@ -527,7 +526,13 @@ ...@@ -527,7 +526,13 @@
has_error: false, has_error: false,
show_line_selector: false, show_line_selector: false,
show_select_action: false, show_select_action: false,
show_clipboard_action: false show_clipboard_action: false,
// development mode
edit_field_href: field_json.edit_field_href,
edit_field_icon: field_json.edit_field_icon,
translate_title_href: field_json.translate_title_href,
translate_title_icon: field_json.translate_title_icon
}); });
}); });
return queue; return queue;
...@@ -547,7 +552,6 @@ ...@@ -547,7 +552,6 @@
'button[name="Configure"]', 'button[name="Configure"]',
'button[name="SelectRows"]'], 'button[name="SelectRows"]'],
button; button;
/* /*
if (modification_dict.hasOwnProperty('error_text') && this.state.error_text !== undefined) { if (modification_dict.hasOwnProperty('error_text') && this.state.error_text !== undefined) {
// XXX TODO // XXX TODO
...@@ -714,6 +718,7 @@ ...@@ -714,6 +718,7 @@
span_element = document.createElement('span'), span_element = document.createElement('span'),
tr_element, tr_element,
th_element, th_element,
field_href,
a_element; a_element;
div_element.setAttribute('class', 'ui-table-header ui-header'); div_element.setAttribute('class', 'ui-table-header ui-header');
...@@ -725,6 +730,24 @@ ...@@ -725,6 +730,24 @@
h1_element.appendChild(span_element); h1_element.appendChild(span_element);
div_element.appendChild(h1_element); div_element.appendChild(h1_element);
if (modification_dict.hasOwnProperty("edit_field_href")) {
field_href = document.createElement("a");
field_href.href = modification_dict.edit_field_href;
field_href.title = "Edit this form";
field_href.appendChild(document.createElement("img"));
field_href.firstElementChild.src = modification_dict.edit_field_icon;
h1_element.appendChild(field_href);
}
console.log(modification_dict);
if (modification_dict.hasOwnProperty("translate_title_href")) {
field_href = document.createElement("a");
field_href.href = modification_dict.translate_title_href;
field_href.title = "Edit this form's action";
field_href.appendChild(document.createElement("img"));
field_href.firstElementChild.src = modification_dict.translate_title_icon;
h1_element.appendChild(field_href);
}
if (gadget.state.show_select_action) { if (gadget.state.show_select_action) {
for (k = 0; k < select_option_list.length; k += 1) { for (k = 0; k < select_option_list.length; k += 1) {
// Add include button // Add include button
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>george</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>986.62778.43816.35430</string> </value> <value> <string>987.51033.55322.64580</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1601472016.81</float> <float>1604614029.21</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -1074,6 +1074,9 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1074,6 +1074,9 @@ div[data-gadget-scope='header'] .ui-header ul {
padding-top: 6em; padding-top: 6em;
} }
} }
.gadget-content .field_container > a {
padding-left: 3pt;
}
.gadget-content .field_container > div > div > div.ui-field-contain { .gadget-content .field_container > div > div > div.ui-field-contain {
padding: 3pt 0; padding: 3pt 0;
} }
...@@ -1092,9 +1095,6 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1092,9 +1095,6 @@ div[data-gadget-scope='header'] .ui-header ul {
.gadget-content .ui-content-header-plain { .gadget-content .ui-content-header-plain {
font-size: 150%; font-size: 150%;
} }
.gadget-content .ui-content-header-plain > h3 > a {
padding-left: 3pt;
}
.gadget-content .worklist-empty { .gadget-content .worklist-empty {
max-width: 442px; max-width: 442px;
/* original size of the embedded image */ /* original size of the embedded image */
...@@ -1180,7 +1180,7 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1180,7 +1180,7 @@ div[data-gadget-scope='header'] .ui-header ul {
.gadget-content .ui-field-contain > label { .gadget-content .ui-field-contain > label {
color: hsl(0, 0%, 42%); color: hsl(0, 0%, 42%);
} }
.gadget-content .ui-field-contain > label > a { .gadget-content .ui-field-contain > a {
padding-left: 3pt; padding-left: 3pt;
} }
.gadget-content .required > .ui-field-contain > label { .gadget-content .required > .ui-field-contain > label {
...@@ -1392,6 +1392,9 @@ div[data-gadget-scope='erp5_searchfield'] div.search_parsed_value button { ...@@ -1392,6 +1392,9 @@ div[data-gadget-scope='erp5_searchfield'] div.search_parsed_value button {
display: initial; display: initial;
} }
} }
.document_table .ui-table-header h1 > a {
padding-left: 3pt;
}
.document_table .ui-table-header button { .document_table .ui-table-header button {
padding: 3pt; padding: 3pt;
border: 1px solid rgba(0, 0, 0, 0.14); border: 1px solid rgba(0, 0, 0, 0.14);
......
...@@ -1638,6 +1638,9 @@ div[data-gadget-scope='erp5_searchfield'] { ...@@ -1638,6 +1638,9 @@ div[data-gadget-scope='erp5_searchfield'] {
} }
} }
} }
& > a {
padding-left: 3pt;
}
} }
button { button {
......
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