Commit 12ef5b29 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Allow to surcharge the default page used to display a jio document

parent 8a278cbd
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<script data-renderjs-configuration="default_view_reference" type="text/x-renderjs-configuration">${default_view_reference}</script> <script data-renderjs-configuration="default_view_reference" type="text/x-renderjs-configuration">${default_view_reference}</script>
<script data-renderjs-configuration="hateoas_url" type="text/x-renderjs-configuration">${hateoas_url}</script> <script data-renderjs-configuration="hateoas_url" type="text/x-renderjs-configuration">${hateoas_url}</script>
<script data-renderjs-configuration="frontpage_gadget" type="text/x-renderjs-configuration">${frontpage_gadget}</script> <script data-renderjs-configuration="frontpage_gadget" type="text/x-renderjs-configuration">${frontpage_gadget}</script>
<script data-renderjs-configuration="jio_document_page_gadget" type="text/x-renderjs-configuration">${jio_document_page_gadget}</script>
<script data-renderjs-configuration="language_map" type="text/x-renderjs-configuration">${language_map}</script> <script data-renderjs-configuration="language_map" type="text/x-renderjs-configuration">${language_map}</script>
<script data-renderjs-configuration="default_selected_language" type="text/x-renderjs-configuration">${default_selected_language}</script> <script data-renderjs-configuration="default_selected_language" type="text/x-renderjs-configuration">${default_selected_language}</script>
<script data-renderjs-configuration="website_url_set" type="text/x-renderjs-configuration">${website_url_set}</script> <script data-renderjs-configuration="website_url_set" type="text/x-renderjs-configuration">${website_url_set}</script>
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.32778.10430.62549</string> </value> <value> <string>958.33121.48203.5614</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1491475425.69</float> <float>1491989001.6</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -619,16 +619,19 @@ ...@@ -619,16 +619,19 @@
function routeDisplay(gadget, command_options) { function routeDisplay(gadget, command_options) {
if (command_options.path) { if (command_options.path) {
if (command_options.args.page === undefined) { if (command_options.args.page === undefined) {
return synchronousChangeState( return gadget.getSetting("jio_document_page_gadget", "form")
getDisplayUrlFor(command_options.path, { .push(function (jio_document_page_gadget) {
page: 'form', return synchronousChangeState(
editable: command_options.args.editable, getDisplayUrlFor(command_options.path, {
view: command_options.args.view || 'view', page: jio_document_page_gadget,
selection: command_options.args.selection, editable: command_options.args.editable,
selection_index: command_options.args.selection_index, view: command_options.args.view || 'view',
history: command_options.args.history selection: command_options.args.selection,
}) selection_index: command_options.args.selection_index,
); history: command_options.args.history
})
);
});
} }
} }
......
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.31324.24990.32187</string> </value> <value> <string>958.41403.15830.7458</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1491384797.89</float> <float>1491991472.33</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
<string>my_configuration_application_title</string> <string>my_configuration_application_title</string>
<string>my_configuration_hateoas_url</string> <string>my_configuration_hateoas_url</string>
<string>my_configuration_frontpage_gadget_url</string> <string>my_configuration_frontpage_gadget_url</string>
<string>my_configuration_default_jio_document_page_gadget_url</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_configuration_default_jio_document_page_gadget_url</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Default Jio Document Page Gadget</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -32,6 +32,7 @@ view_as_web_method = default_web_page.getTypeBasedMethod( ...@@ -32,6 +32,7 @@ view_as_web_method = default_web_page.getTypeBasedMethod(
) )
return view_as_web_method(mapping_dict={ return view_as_web_method(mapping_dict={
"frontpage_gadget": web_section.getLayoutProperty("configuration_frontpage_gadget_url", default="worklist"), "frontpage_gadget": web_section.getLayoutProperty("configuration_frontpage_gadget_url", default="worklist"),
"jio_document_page_gadget": web_section.getLayoutProperty("configuration_default_jio_document_page_gadget_url", default="form"),
"application_title": web_section.getLayoutProperty("configuration_application_title", default="ERP5"), "application_title": web_section.getLayoutProperty("configuration_application_title", default="ERP5"),
"action_view": web_section.getLayoutProperty("configuration_view_action_category", default="object_view"), "action_view": web_section.getLayoutProperty("configuration_view_action_category", default="object_view"),
"default_view_reference": web_section.getLayoutProperty("configuration_default_view_action_reference", default="view"), "default_view_reference": web_section.getLayoutProperty("configuration_default_view_action_reference", default="view"),
......
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