Commit 07d31edc authored by Sven Franck's avatar Sven Franck Committed by Sebastien Robin

erp5_web_renderjs_ui: move tab gadget back inside form gadget

parent 06cb4783
...@@ -199,7 +199,6 @@ ...@@ -199,7 +199,6 @@
]);\n ]);\n
})\n })\n
.push(function (result) {\n .push(function (result) {\n
var content_list = [];\n
\n \n
sub_options = options.form_gadget || {};\n sub_options = options.form_gadget || {};\n
sub_options.erp5_document = result[0].data;\n sub_options.erp5_document = result[0].data;\n
...@@ -210,15 +209,11 @@ ...@@ -210,15 +209,11 @@
return RSVP.all([\n return RSVP.all([\n
gadget.declareGadget("gadget_erp5_pt_" + sub_options.form_definition.pt + ".html", {\n gadget.declareGadget("gadget_erp5_pt_" + sub_options.form_definition.pt + ".html", {\n
scope: "form_gadget"\n scope: "form_gadget"\n
}),\n
gadget.declareGadget("gadget_erp5_tab_list.html", {\n
scope: "erp5_tab"\n
})\n })\n
]);\n ]);\n
})\n })\n
.push(function (gadget_list) {\n .push(function (gadget_list) {\n
var form_gadget = gadget_list[0],\n var form_gadget = gadget_list[0],\n
tab_gadget = gadget_list[1],\n
new_content_action = sub_options.erp5_document._links.action_object_new_content_action,\n new_content_action = sub_options.erp5_document._links.action_object_new_content_action,\n
plus_queue,\n plus_queue,\n
new_element;\n new_element;\n
...@@ -240,8 +235,6 @@ ...@@ -240,8 +235,6 @@
}\n }\n
\n \n
return RSVP.all([\n return RSVP.all([\n
tab_gadget.render(sub_options),\n
tab_gadget.getElement(),\n
form_gadget.render(sub_options),\n form_gadget.render(sub_options),\n
form_gadget.getElement(),\n form_gadget.getElement(),\n
gadget.props.breadcrumb_gadget.render(breadcrumb_options),\n gadget.props.breadcrumb_gadget.render(breadcrumb_options),\n
...@@ -564,7 +557,7 @@ ...@@ -564,7 +557,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>937.8167.39223.50892</string> </value> <value> <string>937.22192.46889.64802</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -582,7 +575,7 @@ ...@@ -582,7 +575,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1408975361.84</float> <float>1409819356.02</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -129,6 +129,11 @@ ...@@ -129,6 +129,11 @@
\n \n
</head>\n </head>\n
<body>\n <body>\n
\n
<div data-gadget-url="gadget_erp5_tab_list.html"\n
data-gadget-scope="erp5_tab"\n
data-gadget-sandbox="public">\n
</div>\n
\n \n
<!-- XXX action, method, fieldset -->\n <!-- XXX action, method, fieldset -->\n
<form class="save_form">\n <form class="save_form">\n
...@@ -283,7 +288,7 @@ ...@@ -283,7 +288,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.54726.55391.8362</string> </value> <value> <string>937.22212.34746.7150</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -301,7 +306,7 @@ ...@@ -301,7 +306,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407836841.44</float> <float>1409817872.15</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -152,10 +152,11 @@ ...@@ -152,10 +152,11 @@
.declareMethod(\'render\', function (options) {\n .declareMethod(\'render\', function (options) {\n
var erp5_document = options.erp5_document,\n var erp5_document = options.erp5_document,\n
action_list = erp5_document._links.action_workflow || [],\n action_list = erp5_document._links.action_workflow || [],\n
fragment = document.createDocumentFragment(),\n
form_gadget = this,\n form_gadget = this,\n
i,\n promise_list = [],\n
promise_list = [];\n i;\n
\n \n
for (i = 0; i < action_list.length; i += 1) {\n for (i = 0; i < action_list.length; i += 1) {\n
promise_list.push(this.whoWantToDisplayThisPage({\n promise_list.push(this.whoWantToDisplayThisPage({\n
name: action_list[i].name\n name: action_list[i].name\n
...@@ -168,13 +169,15 @@ ...@@ -168,13 +169,15 @@
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return RSVP.all([\n return RSVP.all([\n
form_gadget.getDeclaredGadget("erp5_tab"),\n
form_gadget.getDeclaredGadget("erp5_form"),\n form_gadget.getDeclaredGadget("erp5_form"),\n
RSVP.all(promise_list)\n RSVP.all(promise_list)\n
]);\n ]);\n
})\n })\n
.push(function (all_gadget) {\n .push(function (all_gadget) {\n
var form_options = options.erp5_form || {},\n var form_options = options.erp5_form || {},\n
all_result = all_gadget[1],\n tab_options = options.erp5_tag || {},\n
all_result = all_gadget[2],\n
actionlist = [],\n actionlist = [],\n
class_list,\n class_list,\n
i;\n i;\n
...@@ -182,6 +185,11 @@ ...@@ -182,6 +185,11 @@
form_options.erp5_document = options.erp5_document;\n form_options.erp5_document = options.erp5_document;\n
form_options.form_definition = options.form_definition;\n form_options.form_definition = options.form_definition;\n
form_options.view = options.view;\n form_options.view = options.view;\n
\n
tab_options.erp5_document = options.erp5_document;\n
tab_options.form_definition = options.form_definition;\n
tab_options.view = options.view;\n
tab_options.action_view = options.action_view;\n
\n \n
for (i = 0; i < all_result.length; i += 1) {\n for (i = 0; i < all_result.length; i += 1) {\n
switch (i) {\n switch (i) {\n
...@@ -201,12 +209,14 @@ ...@@ -201,12 +209,14 @@
link: all_result[i],\n link: all_result[i],\n
});\n });\n
}\n }\n
form_gadget.__element.appendChild(fragment);\n
form_gadget.__element.querySelector("div.ui-controlgroup-controls")\n form_gadget.__element.querySelector("div.ui-controlgroup-controls")\n
.innerHTML = workflow_template({actionlist: actionlist});\n .innerHTML = workflow_template({actionlist: actionlist});\n
\n \n
\n \n
return RSVP.all([\n return RSVP.all([\n
all_gadget[0].render(form_options),\n all_gadget[0].render(tab_options),\n
all_gadget[1].render(form_options)\n
]);\n ]);\n
});\n });\n
\n \n
...@@ -373,7 +383,7 @@ ...@@ -373,7 +383,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.54729.48588.29371</string> </value> <value> <string>937.22215.35138.15906</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -391,7 +401,7 @@ ...@@ -391,7 +401,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407836873.52</float> <float>1409818069.12</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -147,7 +147,8 @@ ...@@ -147,7 +147,8 @@
// declared methods\n // declared methods\n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n .declareMethod(\'render\', function (options) {\n
var nav_element = this.props.element.querySelector(".grid-container"),\n var tab_gadget = this, \n
nav_element = tab_gadget.props.element.querySelector(".grid-container"),\n
erp5_document = options.erp5_document,\n erp5_document = options.erp5_document,\n
view_list = erp5_document._links[options.action_view],\n view_list = erp5_document._links[options.action_view],\n
nav_html = \'<nav data-role="navbar"><ul class="grid-items">\',\n nav_html = \'<nav data-role="navbar"><ul class="grid-items">\',\n
...@@ -190,6 +191,7 @@ ...@@ -190,6 +191,7 @@
nav_html += \'</ul></nav>\';\n nav_html += \'</ul></nav>\';\n
nav_element.innerHTML = nav_html;\n nav_element.innerHTML = nav_html;\n
\n \n
return tab_gadget;\n
});\n });\n
\n \n
});\n });\n
...@@ -331,7 +333,7 @@ ...@@ -331,7 +333,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.54906.24658.1911</string> </value> <value> <string>937.690.6828.44612</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -349,7 +351,7 @@ ...@@ -349,7 +351,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407848815.35</float> <float>1409818434.1</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
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