Commit b598ade5 authored by Gabriel Monnerat's avatar Gabriel Monnerat Committed by Romain Courteaud

erp5_web_renderjs_ui: Calculate link to render developer actions in ERP5JS UI

Calculate link to allow Nexedi developers access the ERP5 fields, forms and form actions from it.

* erp5 form gadget handle links to access from and form action
* label field gadget handle links to access field configuration, title
and descriptions translations
* page action handle all links to access workflows and portal type document
parent f281df64
...@@ -337,8 +337,13 @@ url_template_dict = { ...@@ -337,8 +337,13 @@ url_template_dict = {
} }
default_document_uri_template = url_template_dict["jio_get_template"] default_document_uri_template = url_template_dict["jio_get_template"]
Base_translateString = context.getPortalObject().Base_translateString portal = context.getPortalObject()
portal_absolute_url = portal.absolute_url()
preference_tool = portal.portal_preferences
Base_translateString = portal.Base_translateString
preferred_html_style_developper_mode = preference_tool.getPreferredHtmlStyleDevelopperMode()
preferred_html_style_translator_mode = preference_tool.getPreferredHtmlStyleTranslatorMode()
def getRealRelativeUrl(document): def getRealRelativeUrl(document):
return '/'.join(portal.portal_url.getRelativeContentPath(document)) return '/'.join(portal.portal_url.getRelativeContentPath(document))
...@@ -446,6 +451,32 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k ...@@ -446,6 +451,32 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
"description": field.get_value("description"), "description": field.get_value("description"),
} }
if preferred_html_style_developper_mode or meta_type == "ListBox":
form_relative_url = getFormRelativeUrl(form)
if preferred_html_style_developper_mode:
result["edit_field_href"] = '%s/%s/manage_main' % (form_relative_url, field.id)
result["edit_field_icon"] = "%s/images/editfield.png" % portal_absolute_url
if preferred_html_style_translator_mode:
erp5_ui = portal.Localizer.erp5_ui
selected_language = erp5_ui.get_selected_language()
result["translate_title_href"] = '%s/manage_messages?regex=^%s$&lang=%s' % (
'/'.join(erp5_ui.getPhysicalPath()),
field.title(),
selected_language
)
result["translate_title_icon"] = "%s/images/translate.png" % portal_absolute_url
field_description = field.Field_getDescription()
if field_description:
result["translate_description_href"] = '%s/manage_messages?regex=^%s$&lang=%s' % (
'/'.join(erp5_ui.getPhysicalPath()),
field_description,
selected_language
)
result["translate_description_icon"] = "%s/images/translate_tooltip.png" % portal_absolute_url
if "Field" in meta_type: if "Field" in meta_type:
# fields have default value and can be required (unlike boxes) # fields have default value and can be required (unlike boxes)
result["required"] = field.get_value("required") if field.has_value("required") else None result["required"] = field.get_value("required") if field.has_value("required") else None
...@@ -737,7 +768,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k ...@@ -737,7 +768,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
"root_url": site_root.absolute_url(), "root_url": site_root.absolute_url(),
"script_id": script.id, "script_id": script.id,
"relative_url": getRealRelativeUrl(traversed_document).replace("/", "%2F"), "relative_url": getRealRelativeUrl(traversed_document).replace("/", "%2F"),
"form_relative_url": "%s/%s" % (getFormRelativeUrl(form), field.id), "form_relative_url": "%s/%s" % (form_relative_url, field.id),
"list_method": list_method_name, "list_method": list_method_name,
"default_param_json": urlsafe_b64encode( "default_param_json": urlsafe_b64encode(
json.dumps(ensureSerializable(list_method_query_dict))), json.dumps(ensureSerializable(list_method_query_dict))),
...@@ -1207,6 +1238,17 @@ def renderFormDefinition(form, response_dict): ...@@ -1207,6 +1238,17 @@ def renderFormDefinition(form, response_dict):
response_dict["update_action"] = form.update_action response_dict["update_action"] = form.update_action
response_dict["update_action_title"] = Base_translateString(form.update_action_title) response_dict["update_action_title"] = Base_translateString(form.update_action_title)
if preferred_html_style_developper_mode:
form_relative_url = getFormRelativeUrl(form)
response_dict["edit_form_href"] = '%s/manage_main' % form_relative_url
response_dict["edit_form_icon"] = "%s/images/editform.png" % portal_absolute_url
response_dict["edit_form_action_href"] = '%s/%s/manage_main' % (
form_relative_url,
form.action
)
response_dict["edit_form_action_icon"] = "%s/images/editformaction.png" % portal_absolute_url
def statusLevelToString(level): def statusLevelToString(level):
"""Transform any level format to lowercase string representation""" """Transform any level format to lowercase string representation"""
if isinstance(level, (str, unicode)): if isinstance(level, (str, unicode)):
...@@ -1291,7 +1333,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1291,7 +1333,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# Always inform about portal # Always inform about portal
"portal": { "portal": {
"href": default_document_uri_template % { "href": default_document_uri_template % {
"root_url": portal.absolute_url(), "root_url": portal_absolute_url,
# XXX the portal has an empty getRelativeUrl. Make it still compatible # XXX the portal has an empty getRelativeUrl. Make it still compatible
# with restrictedTraverse # with restrictedTraverse
"relative_url": portal.getId(), "relative_url": portal.getId(),
...@@ -1461,6 +1503,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1461,6 +1503,9 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
} }
# Extract & modify action URLs # Extract & modify action URLs
if preferred_html_style_developper_mode and 'object_jio_raw' not in erp5_action_dict:
erp5_action_dict["object_jio_raw"] = []
for erp5_action_key in erp5_action_dict.keys(): for erp5_action_key in erp5_action_dict.keys():
erp5_action_list = [] erp5_action_list = []
for view_action in erp5_action_dict[erp5_action_key]: for view_action in erp5_action_dict[erp5_action_key]:
...@@ -1500,6 +1545,27 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None, ...@@ -1500,6 +1545,27 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
"extra_param_json": urlsafe_b64encode(json.dumps(ensureSerializable(extra_param_json))) "extra_param_json": urlsafe_b64encode(json.dumps(ensureSerializable(extra_param_json)))
} }
if preferred_html_style_developper_mode and erp5_action_key == "object_jio_raw":
type_info = portal.portal_types.getTypeInfo(traversed_document)
if type_info is not None and type_info.Base_getSourceVisibility():
erp5_action_list.append({
'href': "%s?ignore_layout:int=1" % type_info.absolute_url_path(),
'name': "jump_to_portal_type",
'icon': None,
'title': "%s %s" % (
Base_translateString("Edit Portal Type"),
Base_translateString(traversed_document.getPortalType())
),
})
if portal.portal_workflow.Base_getSourceVisibility():
for workflow in portal.portal_workflow.getWorkflowsFor(traversed_document):
erp5_action_list.append({
'href': "%s/manage_properties?ignore_layout:int=1" % workflow.absolute_url_path(),
'name': "jump_to_%s" % workflow.id,
'icon': None,
'title': workflow.title
})
if erp5_action_list: if erp5_action_list:
if len(erp5_action_list) == 1: if len(erp5_action_list) == 1:
erp5_action_list = erp5_action_list[0] erp5_action_list = erp5_action_list[0]
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_form.js" type="text/javascript"></script> <script src="gadget_erp5_form.js" type="text/javascript"></script>
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>969.41882.58371.33382</string> </value> <value> <string>987.52327.33749.63539</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1536679144.45</float> <float>1605646543.35</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, document, rJS, RSVP*/ /*global window, document, rJS, RSVP, domsugar*/
/** Form is one of a complicated gadget! /** Form is one of a complicated gadget!
* *
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* changed in FormBox gadget which renders form as a subgadget * changed in FormBox gadget which renders form as a subgadget
**/ **/
(function (window, document, rJS, RSVP) { (function (window, document, rJS, RSVP, domsugar) {
"use strict"; "use strict";
/** /**
...@@ -216,11 +216,14 @@ ...@@ -216,11 +216,14 @@
})); }));
}) })
.push(function (result_list) { .push(function (result_list) {
var dom_element = form_gadget.element.querySelector(".field_container"),
parent_element,
field_href,
current_field,
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 +233,35 @@ ...@@ -230,6 +233,35 @@
} }
dom_element.appendChild(parent_element); dom_element.appendChild(parent_element);
} }
current_field = form_gadget.element.querySelector(".edit-form");
if (form_definition.hasOwnProperty("edit_form_href") &&
!current_field) {
field_href = domsugar("a", {"class": "edit-form"});
field_href.href = form_definition.edit_form_href;
field_href.title = "Edit this form";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = form_definition.edit_form_icon;
form_gadget.element.insertBefore(field_href, dom_element);
} else if (!form_definition.hasOwnProperty("edit_form_href") &&
current_field) {
form_gadget.element.removeChild(current_field);
}
current_field = form_gadget.element.querySelector(".edit-form-action");
if (form_definition.hasOwnProperty("edit_form_action_href") &&
!current_field) {
field_href = domsugar("a", {"class": "edit-form-action"});
field_href.href = form_definition.edit_form_action_href;
field_href.title = "Edit this form's action";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = form_definition.edit_form_action_icon;
form_gadget.element.insertBefore(field_href, dom_element);
} else if (!form_definition.hasOwnProperty("edit_form_action_href") &&
current_field) {
form_gadget.element.removeChild(current_field);
}
}); });
}) })
...@@ -308,4 +340,4 @@ ...@@ -308,4 +340,4 @@
}, {mutex: 'changestate'}); }, {mutex: 'changestate'});
}(window, document, rJS, RSVP)); }(window, document, rJS, RSVP, domsugar));
...@@ -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>988.23186.12447.8960</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>1606787725.33</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_label_field.js" type="text/javascript"></script> <script src="gadget_erp5_label_field.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="ui-field-contain"> <div class="ui-field-contain">
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>970.11191.7445.40789</string> </value> <value> <string>988.2724.42282.37358</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1536679172.23</float> <float>1605646555.5</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, document, rJS*/ /*global window, document, rJS, domsugar */
/*jslint indent: 2, maxerr: 3 */ /*jslint indent: 2, maxerr: 3 */
/** /**
* Label gadget takes care of displaying validation errors and label. * Label gadget takes care of displaying validation errors and label.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* - class "horizontal_align_form_box" will prevent any label to show as well * - class "horizontal_align_form_box" will prevent any label to show as well
* *
*/ */
(function (window, document, rJS) { (function (window, document, rJS, domsugar) {
"use strict"; "use strict";
var SCOPE = 'field'; var SCOPE = 'field';
...@@ -107,11 +107,16 @@ ...@@ -107,11 +107,16 @@
.onStateChange(function onStateChange(modification_dict) { .onStateChange(function onStateChange(modification_dict) {
var gadget = this, var gadget = this,
options = modification_dict.options || {},
field_json = options.field_json,
span, span,
css_class, css_class,
i, i,
queue, queue,
new_div; new_div,
field_href,
current_field;
if (modification_dict.hasOwnProperty('first_call')) { if (modification_dict.hasOwnProperty('first_call')) {
gadget.props = { gadget.props = {
container_element: gadget.element.querySelector('div'), container_element: gadget.element.querySelector('div'),
...@@ -129,6 +134,51 @@ ...@@ -129,6 +134,51 @@
} }
this.props.label_element.setAttribute('for', gadget.state.scope); this.props.label_element.setAttribute('for', gadget.state.scope);
if (field_json) {
current_field = this.props.label_element.querySelector(".edit-field");
if (field_json.hasOwnProperty('edit_field_href') &&
!current_field) {
field_href = domsugar("a", {"class": "edit-field"});
field_href.href = field_json.edit_field_href;
field_href.title = "Edit this field";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = field_json.edit_field_icon;
this.props.label_element.appendChild(field_href);
} else if (!field_json.hasOwnProperty('edit_field_href') &&
current_field) {
this.props.label_element.removeChild(current_field);
}
current_field = this.props.label_element.querySelector(".translate-title");
if (field_json.hasOwnProperty('translate_title_href') &&
!current_field) {
field_href = domsugar("a", {"class": "translate-title"});
field_href.href = field_json.translate_title_href;
field_href.title = "Translate this field title";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = field_json.translate_title_icon;
this.props.label_element.appendChild(field_href);
} else if (!field_json.hasOwnProperty('translate_title_href') &&
current_field) {
this.props.label_element.removeChild(current_field);
}
current_field = this.props.label_element.querySelector(".translate-description");
if (field_json.hasOwnProperty('translate_description_href') &&
!current_field) {
field_href = domsugar("a", {"class": "translate-description"});
field_href.href = field_json.translate_description_href;
field_href.title = "Translate this field description";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = field_json.translate_description_icon;
this.props.label_element.appendChild(field_href);
} else if (!field_json.hasOwnProperty('translate_description_href') &&
current_field) {
this.props.label_element.removeChild(current_field);
}
}
if (modification_dict.hasOwnProperty('css_class') && this.state.css_class) { if (modification_dict.hasOwnProperty('css_class') && this.state.css_class) {
css_class = this.state.css_class.split(' '); css_class = this.state.css_class.split(' ');
for (i = 0; i < css_class.length; i += 1) { for (i = 0; i < css_class.length; i += 1) {
...@@ -266,4 +316,4 @@ ...@@ -266,4 +316,4 @@
return this.changeState({first_call: true, error_text: error_text}); return this.changeState({first_call: true, error_text: error_text});
}); });
}(window, document, rJS)); }(window, document, rJS, domsugar));
\ No newline at end of file
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.16240.14459.45960</string> </value> <value> <string>988.23199.45305.6775</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>1602525354.74</float> <float>1606788596.95</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>
......
...@@ -1016,6 +1016,9 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1016,6 +1016,9 @@ div[data-gadget-scope='header'] .ui-header ul {
.gadget-content div[data-gadget-scope='m'] { .gadget-content div[data-gadget-scope='m'] {
animation: fadein 0.2s ease-out; animation: fadein 0.2s ease-out;
} }
.gadget-content div[data-gadget-scope='erp5_form'] > a {
margin-left: 3pt;
}
.gadget-content input[type='submit'] { .gadget-content input[type='submit'] {
padding: 6pt; padding: 6pt;
margin-top: 30pt; margin-top: 30pt;
...@@ -1104,6 +1107,9 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1104,6 +1107,9 @@ 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 {
margin-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 */
...@@ -1189,6 +1195,9 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -1189,6 +1195,9 @@ div[data-gadget-scope='header'] .ui-header ul {
.gadget-content .ui-field-contain > label:not(:is-invalid) { .gadget-content .ui-field-contain > label:not(:is-invalid) {
color: hsl(0, 0%, 42%); color: hsl(0, 0%, 42%);
} }
.gadget-content .ui-field-contain > label > a {
margin-left: 3pt;
}
.gadget-content .required > .ui-field-contain > label { .gadget-content .required > .ui-field-contain > label {
font-weight: bold; font-weight: bold;
color: #1F1F1F; color: #1F1F1F;
...@@ -1398,6 +1407,9 @@ div[data-gadget-scope='erp5_searchfield'] div.search_parsed_value button { ...@@ -1398,6 +1407,9 @@ div[data-gadget-scope='erp5_searchfield'] div.search_parsed_value button {
display: initial; display: initial;
} }
} }
.document_table .ui-table-header h1 > a {
margin-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);
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>986.53918.32237.3225</string> </value> <value> <string>988.2627.57081.47803</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1600941690.9</float> <float>1605640720.58</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -59,13 +59,15 @@ ...@@ -59,13 +59,15 @@
.onStateChange(function () { .onStateChange(function () {
var gadget = this, var gadget = this,
erp5_document, erp5_document,
group_list; group_list,
raw_list;
// Get the whole view as attachment because actions can change based on // Get the whole view as attachment because actions can change based on
// what view we are at. If no view available than fallback to "links". // what view we are at. If no view available than fallback to "links".
return gadget.jio_getAttachment(gadget.state.jio_key, gadget.state.view || "links") return gadget.jio_getAttachment(gadget.state.jio_key, gadget.state.view || "links")
.push(function (jio_attachment) { .push(function (jio_attachment) {
erp5_document = jio_attachment; erp5_document = jio_attachment;
raw_list = ensureArray(erp5_document._links.action_object_jio_raw);
var i, var i,
j, j,
...@@ -89,12 +91,20 @@ ...@@ -89,12 +91,20 @@
}}); }});
} }
} }
for (i = 0; i < raw_list.length; i += 1) {
url_for_kw_list.push({
command: 'raw',
options: {
url: raw_list[i].href
}
});
}
url_for_kw_list.push({command: 'cancel_dialog_with_history'}); url_for_kw_list.push({command: 'cancel_dialog_with_history'});
return RSVP.hash({ return RSVP.hash({
url_list: gadget.getUrlForList(url_for_kw_list), url_list: gadget.getUrlForList(url_for_kw_list),
translation_list: gadget.getTranslationList(['Workflows', 'Actions', 'Clone', 'Delete']), translation_list: gadget.getTranslationList(['Workflows', 'Actions', 'Clone', 'Delete', 'Developer mode']),
page_title: calculatePageTitle(gadget, erp5_document) page_title: calculatePageTitle(gadget, erp5_document)
}); });
}) })
...@@ -104,6 +114,7 @@ ...@@ -104,6 +114,7 @@
j, j,
k = 0, k = 0,
dom_list = [], dom_list = [],
raw_action_list = [],
link_list; link_list;
for (i = 0; i < group_list.length; i += 3) { for (i = 0; i < group_list.length; i += 3) {
...@@ -120,6 +131,17 @@ ...@@ -120,6 +131,17 @@
); );
} }
for (i = 0; i < raw_list.length; i += 1) {
raw_action_list.push({
title: raw_list[i].title,
link: result_dict.url_list[k]
});
k += 1;
}
if (raw_action_list.length > 0) {
dom_list.push(generateSection(result_dict.translation_list[4], 'plane', raw_action_list));
}
domsugar(gadget.element, dom_list); domsugar(gadget.element, dom_list);
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>981.55016.12244.41318</string> </value> <value> <string>988.24508.25206.47513</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>1582128763.98</float> <float>1606867016.4</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -281,7 +281,9 @@ ...@@ -281,7 +281,9 @@
]); ]);
}) })
.push(function (translated_title_list) { .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 (action_confirm !== null) {
if (form_gadget.state.action_title) { if (form_gadget.state.action_title) {
action_confirm.value = form_gadget.state.action_title; action_confirm.value = form_gadget.state.action_title;
...@@ -292,6 +294,23 @@ ...@@ -292,6 +294,23 @@
selector.textContent = "\u00A0" + translated_title_list[0]; selector.textContent = "\u00A0" + translated_title_list[0];
selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon; selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon;
if (form_definition.hasOwnProperty("edit_form_href")) {
field_href = domsugar("a");
field_href.href = form_definition.edit_form_href;
field_href.title = "Edit this form";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = form_definition.edit_form_icon;
selector.appendChild(field_href);
}
if (form_definition.hasOwnProperty("edit_form_action_href")) {
field_href = domsugar("a");
field_href.href = form_definition.edit_form_action_href;
field_href.title = "Edit this form's action";
field_href.appendChild(domsugar("img"));
field_href.firstElementChild.src = form_definition.edit_form_action_icon;
selector.appendChild(field_href);
}
// Render the erp5_from // Render the erp5_from
return form_gadget.getDeclaredGadget("erp5_form"); return form_gadget.getDeclaredGadget("erp5_form");
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>987.241.33421.16076</string> </value> <value> <string>987.52327.33749.63539</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1601565340.43</float> <float>1605641027.16</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -1199,12 +1199,18 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1199,12 +1199,18 @@ div[data-gadget-scope='header'] .ui-header {
animation: fadein @transition-timing; animation: fadein @transition-timing;
} }
// Dialog page template main submit button div[data-gadget-scope='erp5_form'] {
& > a {
margin-left: @half-margin-size;
}
}
// Dialog page template main submit button
input[type='submit'] { input[type='submit'] {
.renderPageSubmitButton(@coloraccent); .renderPageSubmitButton(@coloraccent);
text-shadow: @foreground-text-shadow; text-shadow: @foreground-text-shadow;
} }
// Dialog page template update button // Dialog page template update button
button[name='action_update'] { button[name='action_update'] {
.renderPageSubmitButton(@grey); .renderPageSubmitButton(@grey);
} }
...@@ -1274,6 +1280,9 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1274,6 +1280,9 @@ div[data-gadget-scope='header'] .ui-header {
.ui-content-header-plain { .ui-content-header-plain {
font-size: 150%; font-size: 150%;
& > h3 > a {
margin-left: @half-margin-size;
}
} }
.worklist-empty { .worklist-empty {
max-width: 442px; /* original size of the embedded image */ max-width: 442px; /* original size of the embedded image */
...@@ -1371,7 +1380,10 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -1371,7 +1380,10 @@ div[data-gadget-scope='header'] .ui-header {
.ui-field-contain { .ui-field-contain {
& > label:not(:is-invalid) { & > label:not(:is-invalid) {
color: @colorlabel; color: @colorlabel;
& > a {
// links inside label when dev mode is enable
margin-left: @half-margin-size;
}
} }
} }
//Label styling in required and "invisible" field //Label styling in required and "invisible" field
...@@ -1641,6 +1653,9 @@ div[data-gadget-scope='erp5_searchfield'] { ...@@ -1641,6 +1653,9 @@ div[data-gadget-scope='erp5_searchfield'] {
} }
} }
} }
& > a {
margin-left: @half-margin-size;
}
} }
button { button {
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_ui_developer_mode_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testAccessPortalTypeDocument</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Access Portal Type Document</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Access Portal Type Document</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-subheader"]/ul/li/a[text()="Actions"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-subheader"]/ul/li/a[text()="Actions"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Developer mode</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Portal Type Preference"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Portal Type Preference"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value="Preference" and @name="field_my_id"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@name="Base_edit:method"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testAccessWorkflow</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Access Workflow</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Access Workflow</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-subheader"]/ul/li/a[text()="Actions"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-subheader"]/ul/li/a[text()="Actions"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Developer mode</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Workflow"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Workflow"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>edit_workflow</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Edit Workflow"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperEditField</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Edit Field</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Field</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: True">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_developper_mode"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/my_preferred_html_style_developper_mode/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_developper_mode"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/my_preferred_html_style_developper_mode/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//label[@for="field_my_preferred_html_style_developper_mode"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/my_preferred_html_style_developper_mode/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Developer Mode"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperEditForm</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Edit Form</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<!-- Check if save the page again will not create the links again -->
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"][1]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"][2]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperEditFormAction</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Edit Form Action</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form Action</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/Base_edit/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/Base_edit/manage_main"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"][1]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form's action"][2]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/Base_edit/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="ZPythonScriptHTML_editAction:method"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="ZPythonScriptHTML_editAction:method"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleEditForm</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Edit Form</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Edit Form</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: True">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/manage_main"]</td>
<td></td>
</tr>
<!--tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr-->
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//a[@href="formTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Script (Python)</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Accounting Transactions"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleEditFormAction</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Edit Form Action</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Edit Form Action</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: True">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/Base_doSelect/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="ZScriptHTML_tryForm"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Script (Python)</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleEditLisbox</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Edit Listbox</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Edit Form</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: True">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="portal_skins/erp5_accounting/AccountingTransactionModule_viewAccountingTransactionList/listbox/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@href="fieldTest"]/span/strong</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@value="Accounting Transactions"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperModuleTranslateField</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Translate Field</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Translate Field</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementPresent</td>
<td>//li/a[text()="Modules"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li/a[text()="Modules"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="/erp5/Localizer/erp5_ui/manage_messages?regex=^Accounting Transactions$&amp;lang=en"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-table-header ui-header"]/h1/a[@href="/erp5/Localizer/erp5_ui/manage_messages?regex=^Accounting Transactions$&amp;lang=en"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="regex" and @value="^Accounting Transactions$"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testDeveloperTranslateField</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Developer Translate Field</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Translate Field</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>javascript{selenium.browserbot.currentWindow.location.href}</td>
<td>current_location</td>
</tr>
<tr>
<td>click</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="regex" and @value="^Translator Mode$"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="regex" and @value="^Translator Mode$"]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${current_location}</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name="regex" and @value="^Indicate if we display link to translation system in interface or not$"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//input[@name="regex" and @value="^Indicate if we display link to translation system in interface or not$"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testHideButtonsAfterDisable</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Hide Buttons After Disable</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Developer Edit Form</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: False">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@href="portal_skins/erp5_core/Preference_viewHtmlStyle/manage_main"]</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=3 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>waitForElementNotPresent</td>
<td>//div[@data-gadget-scope="erp5_form"]/a[@title="Edit this form"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=1 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field description"]</td>
<td></td>
</tr>
<tr>
<td>uncheck</td>
<td>//input[@id='field_my_preferred_html_style_translator_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tr>
<td>assertElementNotPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=1 and @title="Translate this field title"]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//label[@for="field_my_preferred_html_style_translator_mode"]/a[position()=2 and @title="Translate this field description"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testModuleAccessPortalTypeDocument</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode>Test Module Access Portal Type Document</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Module Access Portal Type Document</td></tr>
</thead><tbody>
<tal:block tal:define="is_listbox python: True">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/disable_developer_mode" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//li/a[text()="Accounting"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@class="ui-subheader"]/ul/li/a[text()="Actions"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@class="ui-subheader"]/ul/li/a[text()="Actions"]</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Developer mode</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Edit Portal Type Accounting Transaction Module</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Portal Type Accounting Transaction Module"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//ul[@class="document-listview"]/li/a[text()="Edit Portal Type Accounting Transaction Module"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@value="Accounting Transaction Module" and @name="field_my_id"]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//button[@name="Base_edit:method"]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
portal = context.getPortalObject()
active_preference = portal.portal_preferences.getActivePreference()
if active_preference.getPreferredHtmlStyleDevelopperMode():
active_preference.setPreferredHtmlStyleDevelopperMode(0)
active_preference.setPreferredHtmlStyleContextualHelp(0)
active_preference.setPreferredHtmlStyleTranslatorMode(0)
return "OK"
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_disableDeveloperMode</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -2,6 +2,8 @@ portal_tests/renderjs_ui_check_box_field_zuite ...@@ -2,6 +2,8 @@ portal_tests/renderjs_ui_check_box_field_zuite
portal_tests/renderjs_ui_check_box_field_zuite/** portal_tests/renderjs_ui_check_box_field_zuite/**
portal_tests/renderjs_ui_date_time_field_zuite portal_tests/renderjs_ui_date_time_field_zuite
portal_tests/renderjs_ui_date_time_field_zuite/** portal_tests/renderjs_ui_date_time_field_zuite/**
portal_tests/renderjs_ui_developer_mode_zuite
portal_tests/renderjs_ui_developer_mode_zuite/**
portal_tests/renderjs_ui_dms_zuite portal_tests/renderjs_ui_dms_zuite
portal_tests/renderjs_ui_dms_zuite/** portal_tests/renderjs_ui_dms_zuite/**
portal_tests/renderjs_ui_editor_gadget_zuite portal_tests/renderjs_ui_editor_gadget_zuite
......
...@@ -1764,5 +1764,88 @@ ...@@ -1764,5 +1764,88 @@
</tr> </tr>
</tal:block> </tal:block>
<tal:block metal:define-macro="disable_developer_mode">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="Preferences"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="Preferences"]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/ERP5Site_disableDeveloperMode</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>OK</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>OK</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="Preferences"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="Preferences"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="User Interface"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="User Interface"]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tr>
<td>check</td>
<td>//input[@id='field_my_preferred_html_style_developper_mode']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save" />
<tal:block tal:condition="is_listbox">
<tr>
<td>waitForElementPresent</td>
<td>//a[text()="Modules"]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text()="Modules"]</td>
<td></td>
</tr>
</tal:block>
</tal:block>
</tal:block> </tal:block>
\ No newline at end of file
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