Commit 3f364b10 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Change the header menu for the page templates

* form_list: Jump, Actions, Add, Export, Fast Input
* form_view: View, Actions, Export, Previous, Next
* form_view_editable: View, Actions, Add, Previous, Next

This allow to keep the previous/next links in all mode.

Move the delete functionnality to the action page.
parent 64e8171c
......@@ -23,6 +23,7 @@
data-i18n=Previous
data-i18n=Next
data-i18n=Loading
data-i18n=Fast Input
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>959.56503.39390.29269</string> </value>
<value> <string>963.11788.48702.26146</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1496749467.74</float>
<float>1517586466.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -50,11 +50,12 @@
possible_sub_header_list = [
['tab_url', 'Views', 'eye'],
['jump_url', 'Jump', 'plane'],
['delete_url', 'Delete', 'times'],
['export_url', 'Export', 'share-square-o'],
['actions_url', 'Actions', 'cogs'],
['cut_url', 'Cut', 'scissors'],
['add_url', 'Add', 'plus'],
['export_url', 'Export', 'share-square-o'],
['delete_url', 'Delete', 'times'],
['cut_url', 'Cut', 'scissors'],
['fast_input_url', 'Fast Input', 'magic'],
['previous_url', 'Previous', 'carat-l'],
['next_url', 'Next', 'carat-r'],
['edit_content', 'Content', 'file-text'],
......
......@@ -216,7 +216,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>vincent</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.8363.33749.28962</string> </value>
<value> <string>965.11893.61137.22886</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1513343430.33</float>
<float>1517476478.22</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -3099,3 +3099,6 @@ hmtl .ui-icon-carat-u::before {
.ui-icon-bomb::before {
content: "\f1e2";
}
.ui-icon-clone::before {
content: "\f24d";
}
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.13467.35844.48162</string> </value>
<value> <string>965.14626.55645.31283</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1517492960.24</float>
<float>1517562628.45</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,6 +4,8 @@
<!--
data-i18n=Workflow-Transitions
data-i18n=Actions
data-i18n=Clone
data-i18n=Delete
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.12737.42441.36300</string> </value>
<value> <string>965.14619.24625.3874</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1505910372.49</float>
<float>1517562155.58</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -75,18 +75,23 @@
var gadget = this,
erp5_document,
transition_list,
action_list;
action_list,
clone_list,
delete_list;
return gadget.jio_getAttachment(options.jio_key, "links")
.push(function (result) {
erp5_document = result;
transition_list = asArray(erp5_document._links.action_workflow);
action_list = asArray(erp5_document._links.action_object_jio_action)
.concat(asArray(erp5_document._links.action_object_clone_action));
action_list = asArray(erp5_document._links.action_object_jio_action),
clone_list = asArray(erp5_document._links.action_object_clone_action),
delete_list = asArray(erp5_document._links.action_object_delete_action);
return RSVP.all([
renderLinkList(gadget, "Workflow-Transitions", "random", transition_list),
renderLinkList(gadget, "Actions", "gear", action_list),
renderLinkList(gadget, "Workflow-Transitions", "random", transition_list)
renderLinkList(gadget, "Clone", "clone", clone_list),
renderLinkList(gadget, "Delete", "trash-o", delete_list)
]);
})
.push(function (translated_html_link_list) {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.3161.27188.50653</string> </value>
<value> <string>965.14625.10198.9028</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1509097440.1</float>
<float>1517563527.38</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -111,7 +111,7 @@
return form_gadget.updateHeader({
panel_action: true,
jump_url: "",
cut_url: "",
fast_input_url: "",
add_url: all_gadget[0],
actions_url: all_gadget[1],
export_url: all_gadget[3],
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.45640.391.48230</string> </value>
<value> <string>965.11893.45662.8840</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516351087.15</float>
<float>1517476487.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -80,8 +80,7 @@
// render the header
.push(function () {
var new_content_action = form_gadget.state.erp5_document._links.action_object_new_content_action,
delete_action = form_gadget.state.erp5_document._links.action_object_delete_action;
var new_content_action = form_gadget.state.erp5_document._links.action_object_new_content_action;
if (new_content_action !== undefined) {
new_content_action = form_gadget.getUrlFor({command: 'change', options: {view: new_content_action.href, editable: true}});
......@@ -89,17 +88,13 @@
new_content_action = "";
}
if (delete_action !== undefined) {
delete_action = form_gadget.getUrlFor({command: 'change', options: {view: delete_action.href}});
} else {
delete_action = "";
}
return RSVP.all([
form_gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
form_gadget.getUrlFor({command: 'change', options: {page: "action"}}),
new_content_action,
form_gadget.getUrlFor({command: 'history_previous'}),
delete_action,
form_gadget.getUrlFor({command: 'selection_previous'}),
form_gadget.getUrlFor({command: 'selection_next'}),
calculatePageTitle(form_gadget, form_gadget.state.erp5_document)
]);
})
......@@ -109,9 +104,9 @@
actions_url: all_result[1],
add_url: all_result[2],
selection_url: all_result[3],
delete_url: all_result[4],
cut_url: "",
page_title: all_result[5]
previous_url: all_result[4],
next_url: all_result[5],
page_title: all_result[6]
};
if (form_gadget.state.save_action === true) {
header_dict.save_action = true;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.45640.391.48230</string> </value>
<value> <string>965.14609.38920.44509</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516351216.09</float>
<float>1517561386.33</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.58561.19908.14080</string> </value>
<value> <string>965.14600.20468.49988</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1516351419.44</float>
<float>1517561447.52</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -3318,4 +3318,7 @@ hmtl .ui-icon-carat-u::before{
}
.ui-icon-bomb::before {
content: "\f1e2";
}
\ No newline at end of file
}
.ui-icon-clone::before {
content: "\f24d";
}
......@@ -84,34 +84,31 @@
<td>//div[@data-role="header"]//a[text() = 'shitu']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-role="header"]//a[text() = 'shangchu']</td>
<td>//div[@data-role="header"]//a[text() = 'caozhuo']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-role="header"]//a[text() = 'caozhuo']</td>
<td>//div[@data-role="header"]//a[text() = 'zhenjia']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-role="header"]//a[text() = 'jianque']</td>
<td>//div[@data-role="header"]//a[text() = 'qianyige']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-role="header"]//a[text() = 'zhenjia']</td>
<td>//div[@data-role="header"]//a[text() = 'houyige']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//label[text()="biaoti"]</td>
......
......@@ -42,7 +42,7 @@
<tr>
<td>verifyElementPresent</td>
<td>//div[@data-role="header"]//a[text() = 'jianque']</td>
<td>//div[@data-role="header"]//a[text() = 'kuaishushuru']</td>
<td></td>
</tr>
......
......@@ -161,16 +161,26 @@
<td>2 Records</td>
<td></td>
</tr>
<!-- Wait for the action page and click on the delete link -->
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete']</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Delete']</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
......@@ -216,16 +226,26 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<!-- Wait for the action page and click on the delete link -->
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete']</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Delete']</td>
<td></td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
......@@ -259,16 +279,26 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode" />
<!-- Wait for the action page and click on the delete link -->
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete']</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Delete']</td>
<td></td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
......@@ -291,15 +321,25 @@
<td></td>
</tr>
<!-- Wait for the action page and check no delete link is here-->
<tr>
<td>waitForElementPresent</td>
<td>//a[@data-i18n='Delete' and contains(@class, 'ui-disabled')]</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[@data-i18n='Actions']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Delete</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//a[@data-i18n='Delete' and contains(@class, 'ui-disabled')]</td>
<td>verifyElementNotPresent</td>
<td>//a[@data-i18n='Delete Document']</td>
<td></td>
</tr>
</tbody></table>
......
......@@ -8,6 +8,7 @@ param_dict = [
{ 'message': 'Contains', 'translation': 'baohang', 'language': 'wo'},
{ 'message': 'Search', 'translation': 'soushuo', 'language': 'wo'},
{ 'message': 'Next', 'translation': 'houyige', 'language': 'wo'},
{ 'message': 'Fast Input', 'translation': 'kuaishushuru', 'language': 'wo'},
{ 'message': 'Add', 'translation': 'zhenjia', 'language': 'wo'},
{ 'message': 'Loading', 'translation': 'jiazhaizhong', 'language': 'wo'},
{ 'message': 'Actions', 'translation': 'caozhuo', 'language': 'wo'},
......
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