Commit d173a863 authored by Romain Courteaud's avatar Romain Courteaud Committed by Sebastien Robin

Do not hardcode actions used to display document

parent bc12cb2f
...@@ -198,6 +198,7 @@ ...@@ -198,6 +198,7 @@
sub_options.erp5_document = result[0].data;\n sub_options.erp5_document = result[0].data;\n
sub_options.form_definition = result[1].data;\n sub_options.form_definition = result[1].data;\n
sub_options.view = options.view;\n sub_options.view = options.view;\n
sub_options.action_view = gadget.props.action_view;\n
\n \n
return gadget.declareGadget("gadget_erp5_pt_" + sub_options.form_definition.pt + ".html", {\n return gadget.declareGadget("gadget_erp5_pt_" + sub_options.form_definition.pt + ".html", {\n
scope: "form_gadget"\n scope: "form_gadget"\n
...@@ -361,7 +362,7 @@ ...@@ -361,7 +362,7 @@
} else {\n } else {\n
if (options.view === undefined) {\n if (options.view === undefined) {\n
// Redirect to the default view\n // Redirect to the default view\n
return gadget.aq_pleasePublishMyState({jio_key: options.jio_key, view: "view"})\n return gadget.aq_pleasePublishMyState({jio_key: options.jio_key, view: gadget.props.default_view_reference})\n
.push(gadget.pleaseRedirectMyHash.bind(gadget));\n .push(gadget.pleaseRedirectMyHash.bind(gadget));\n
}\n }\n
queue = renderJioDocument(gadget, options);\n queue = renderJioDocument(gadget, options);\n
...@@ -541,7 +542,7 @@ ...@@ -541,7 +542,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.47421.11609.45107</string> </value> <value> <string>936.48944.48108.750</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -559,7 +560,7 @@ ...@@ -559,7 +560,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407398340.29</float> <float>1407492633.6</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -188,6 +188,7 @@ ...@@ -188,6 +188,7 @@
tab_options.erp5_document = options.erp5_document;\n tab_options.erp5_document = options.erp5_document;\n
tab_options.form_definition = options.form_definition;\n tab_options.form_definition = options.form_definition;\n
tab_options.view = options.view;\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
...@@ -212,8 +213,8 @@ ...@@ -212,8 +213,8 @@
\n \n
\n \n
return RSVP.all([\n return RSVP.all([\n
all_gadget[1].render(form_options),\n all_gadget[1].render(tab_options),\n
all_gadget[0].render(tab_options),\n all_gadget[0].render(form_options),\n
]);\n ]);\n
});\n });\n
\n \n
...@@ -366,7 +367,7 @@ ...@@ -366,7 +367,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>sven</string> </value> <value> <string>romain</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -380,7 +381,7 @@ ...@@ -380,7 +381,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.43413.1047.52957</string> </value> <value> <string>936.48947.19194.26931</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -398,7 +399,7 @@ ...@@ -398,7 +399,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407157797.48</float> <float>1407492656.27</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -149,10 +149,14 @@ ...@@ -149,10 +149,14 @@
.declareMethod(\'render\', function (options) {\n .declareMethod(\'render\', function (options) {\n
var nav_element = this.props.element.querySelector(".grid-container"),\n var nav_element = this.props.element.querySelector(".grid-container"),\n
erp5_document = options.erp5_document,\n erp5_document = options.erp5_document,\n
view_list = erp5_document._links.action_object_view,\n view_list = erp5_document._links[options.action_view],\n
i,\n i,\n
nav_html = \'<nav data-role="navbar"><ul class="grid-items">\',\n nav_html = \'<nav data-role="navbar"><ul class="grid-items">\',\n
promise_list = []\n promise_list = [];\n
\n
if (view_list.constructor !== Array) {\n
view_list = [view_list];\n
}\n
\n \n
for (i = 0; i < view_list.length; i += 1) {\n for (i = 0; i < view_list.length; i += 1) {\n
\n \n
...@@ -309,7 +313,7 @@ ...@@ -309,7 +313,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>sven</string> </value> <value> <string>romain</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -323,7 +327,7 @@ ...@@ -323,7 +327,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.46363.37694.56064</string> </value> <value> <string>936.48950.45876.44202</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -341,7 +345,7 @@ ...@@ -341,7 +345,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407334850.3</float> <float>1407492676.55</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
46 47
\ No newline at end of file \ 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