Commit 7b154b24 authored by Tomáš Peterka's avatar Tomáš Peterka

[renderjs_ui] Any form can be embedded by hard-rewriting its page template (in javascript)

parent 291f2cdc
......@@ -69,7 +69,8 @@
key: gadget.state.name,
view: gadget.state.view,
jio_key: erp5_document_uri.segment(2),
editable: gadget.state.editable
editable: gadget.state.editable,
embedded: true
};
// do not preserve objects in the state
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.56527.16709.20804</string> </value>
<value> <string>966.24080.24291.61081</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1517248866.15</float>
<float>1521818911.25</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -119,7 +119,8 @@ and handling data send&receive.
options: options,
erp5_document: undefined,
erp5_form: undefined,
url: undefined
url: undefined,
embedded: asBoolean(options.embedded)
};
if (options.hasOwnProperty('erp5_document')) {
......@@ -161,7 +162,11 @@ and handling data send&receive.
return gadget.jio_getAttachment(uri.segment(2), "view");
})
.push(function (erp5_form) {
var url = "gadget_erp5_pt_" + erp5_form.pt;
var url;
if (new_state.embedded) {
erp5_form.pt = "embedded_form_render"; // hard-coded erp5 naming
}
url = "gadget_erp5_pt_" + erp5_form.pt;
// XXX Hardcoded specific behaviour for form_view
if ((options.editable === 1) && (erp5_form.pt === "form_view")) {
url += "_editable";
......
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