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