Commit 2b15810c authored by Romain Courteaud's avatar Romain Courteaud

Activate select url in editable mode.

Going back to non editable mode is available on the tabs view.
Select URL is by default a link to the parent document.
parent 1fc0d30f
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
<!-- renderjs -->\n <!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n <script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n <script src="renderjs.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
\n \n
<!-- custom script -->\n <!-- custom script -->\n
<script src="gadget_global.js" type="text/javascript"></script>\n <script src="gadget_global.js" type="text/javascript"></script>\n
...@@ -277,7 +278,7 @@ ...@@ -277,7 +278,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>937.59883.50986.57548</string> </value> <value> <string>937.64343.1806.54016</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -295,7 +296,7 @@ ...@@ -295,7 +296,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1412085640.69</float> <float>1412342149.91</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -99,9 +99,9 @@ ...@@ -99,9 +99,9 @@
</item> </item>
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>/*global window, rJS, RSVP, loopEventListener */\n <value> <string>/*global window, rJS, RSVP, loopEventListener, URI */\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n /*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, RSVP, loopEventListener) {\n (function (window, rJS, RSVP, loopEventListener, URI) {\n
"use strict";\n "use strict";\n
\n \n
rJS(window)\n rJS(window)\n
...@@ -170,7 +170,8 @@ ...@@ -170,7 +170,8 @@
form_gadget.whoWantToDisplayThisPage({page: "tab", name: options.view}),\n form_gadget.whoWantToDisplayThisPage({page: "tab", name: options.view}),\n
form_gadget.whoWantToDisplayThisPage({page: "action", name: options.view, editable: true}),\n form_gadget.whoWantToDisplayThisPage({page: "action", name: options.view, editable: true}),\n
form_gadget.whoWantToDisplayThisPage({page: "breadcrumb", name: options.view, editable: true}),\n form_gadget.whoWantToDisplayThisPage({page: "breadcrumb", name: options.view, editable: true}),\n
new_content_action\n new_content_action,\n
form_gadget.whoWantToDisplayThis((new URI(options.erp5_document._links.parent.href)).segment(2))\n
]);\n ]);\n
})\n })\n
.push(function (all_result) {\n .push(function (all_result) {\n
...@@ -181,7 +182,8 @@ ...@@ -181,7 +182,8 @@
actions_url: all_result[3],\n actions_url: all_result[3],\n
delete_url: "",\n delete_url: "",\n
add_url: all_result[5],\n add_url: all_result[5],\n
view_url: all_result[1],\n // view_url: all_result[1],\n
selection_url: all_result[6],\n
page_title: options.erp5_document.title,\n page_title: options.erp5_document.title,\n
breadcrumb_url: all_result[4],\n breadcrumb_url: all_result[4],\n
save_action: true\n save_action: true\n
...@@ -210,8 +212,8 @@ ...@@ -210,8 +212,8 @@
.push(function (data) {\n .push(function (data) {\n
data._id = form_gadget.props.id;\n data._id = form_gadget.props.id;\n
return RSVP.all([\n return RSVP.all([\n
form_gadget.aq_put(data, {"_view": form_gadget.props.view}),\n form_gadget.notifySubmitting(),\n
form_gadget.notifySubmitting()\n form_gadget.aq_put(data, {"_view": form_gadget.props.view})\n
]);\n ]);\n
})\n })\n
.push(form_gadget.notifySubmitted.bind(form_gadget));\n .push(form_gadget.notifySubmitted.bind(form_gadget));\n
...@@ -228,7 +230,7 @@ ...@@ -228,7 +230,7 @@
);\n );\n
});\n });\n
\n \n
}(window, rJS, RSVP, loopEventListener));</string> </value> }(window, rJS, RSVP, loopEventListener, URI));</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -363,7 +365,7 @@ ...@@ -363,7 +365,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>937.64076.58625.38690</string> </value> <value> <string>938.190.52141.13448</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -381,7 +383,7 @@ ...@@ -381,7 +383,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1412257242.7</float> <float>1412343933.71</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
<!-- renderjs -->\n <!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n <script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n <script src="renderjs.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
\n \n
<!-- custom script -->\n <!-- custom script -->\n
<script src="gadget_global.js" type="text/javascript"></script>\n <script src="gadget_global.js" type="text/javascript"></script>\n
...@@ -256,7 +257,7 @@ ...@@ -256,7 +257,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>
...@@ -270,7 +271,7 @@ ...@@ -270,7 +271,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>937.49983.23949.119</string> </value> <value> <string>937.64343.1806.54016</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -288,7 +289,7 @@ ...@@ -288,7 +289,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1411576583.27</float> <float>1412342134.54</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -101,9 +101,9 @@ ...@@ -101,9 +101,9 @@
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
/*global window, rJS, RSVP */\n /*global window, rJS, RSVP, URI */\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n /*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, RSVP) {\n (function (window, rJS, RSVP, URI) {\n
"use strict";\n "use strict";\n
\n \n
// Precompile the templates while loading the first gadget instance\n // Precompile the templates while loading the first gadget instance\n
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n .declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
.declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n .declareAcquiredMethod("whoWantToDisplayThisPage", "whoWantToDisplayThisPage")\n
.declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n
\n \n
/////////////////////////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////\n
// declared methods\n // declared methods\n
...@@ -156,7 +157,8 @@ ...@@ -156,7 +157,8 @@
form_gadget.render(form_options),\n form_gadget.render(form_options),\n
gadget.whoWantToDisplayThisPage({name: options.view, editable: true}),\n gadget.whoWantToDisplayThisPage({name: options.view, editable: true}),\n
gadget.whoWantToDisplayThisPage({page: "action", name: options.view}),\n gadget.whoWantToDisplayThisPage({page: "action", name: options.view}),\n
gadget.whoWantToDisplayThisPage({page: "breadcrumb", name: options.view})\n gadget.whoWantToDisplayThisPage({page: "breadcrumb", name: options.view}),\n
gadget.whoWantToDisplayThis((new URI(options.erp5_document._links.parent.href)).segment(2))\n
]);\n ]);\n
})\n })\n
.push(function (all_result) {\n .push(function (all_result) {\n
...@@ -168,14 +170,14 @@ ...@@ -168,14 +170,14 @@
next_url: "",\n next_url: "",\n
export_url: "",\n export_url: "",\n
edit_url: all_result[1],\n edit_url: all_result[1],\n
selection_url: "",\n selection_url: all_result[4],\n
page_title: options.erp5_document.title,\n page_title: options.erp5_document.title,\n
breadcrumb_url: all_result[3]\n breadcrumb_url: all_result[3]\n
});\n });\n
});\n });\n
});\n });\n
\n \n
}(window, rJS, RSVP)); }(window, rJS, RSVP, URI));
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -312,7 +314,7 @@ ...@@ -312,7 +314,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>937.58419.29836.39389</string> </value> <value> <string>938.194.24732.3993</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -330,7 +332,7 @@ ...@@ -330,7 +332,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1411990309.14</float> <float>1412343893.37</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -170,13 +170,16 @@ ...@@ -170,13 +170,16 @@
editable: true\n editable: true\n
}));\n }));\n
}\n }\n
promise_list.push(gadget.whoWantToDisplayThisPage({\n
name: view_list[0].name\n
}));\n
return RSVP.all(promise_list);\n return RSVP.all(promise_list);\n
})\n })\n
.push(function (all_result) {\n .push(function (all_result) {\n
var i,\n var i,\n
tab_list = [];\n tab_list = [];\n
\n \n
for (i = 0; i < all_result.length; i += 1) {\n for (i = 0; i < all_result.length - 1; i += 1) {\n
tab_list.push({\n tab_list.push({\n
title: view_list[i].title,\n title: view_list[i].title,\n
link: all_result[i]\n link: all_result[i]\n
...@@ -186,6 +189,12 @@ ...@@ -186,6 +189,12 @@
\n \n
gadget.props.element.innerHTML = table_template({\n gadget.props.element.innerHTML = table_template({\n
definition_title: "Views",\n definition_title: "Views",\n
documentlist: [{\n
title: view_list[0].title,\n
link: all_result[all_result.length - 1]\n
}]\n
}) + table_template({\n
definition_title: "Editables",\n
documentlist: tab_list\n documentlist: tab_list\n
});\n });\n
\n \n
...@@ -333,7 +342,7 @@ ...@@ -333,7 +342,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>937.54023.36332.45994</string> </value> <value> <string>937.65458.5148.27426</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -351,7 +360,7 @@ ...@@ -351,7 +360,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1411726674.75</float> <float>1412344005.15</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