Commit f11f3869 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_web_renderjs_ui: Use configuration_frontpage_gadget_url property to define landing page gadget

parent bb77c51a
......@@ -16,6 +16,7 @@
<script data-renderjs-configuration="action_view" type="text/x-renderjs-configuration">${action_view}</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="frontpage_gadget" type="text/x-renderjs-configuration">${frontpage_gadget}</script>
<script src="jquery.js"></script>
<script src="jquerymobile.js"></script>
......
......@@ -498,11 +498,14 @@
//////////////////////////////////////////////////////////////////
// Command URL functions
//////////////////////////////////////////////////////////////////
function routeMethodLess() {
function routeMethodLess(gadget) {
// Nothing. Go to front page
return gadget.getSetting("frontpage_gadget")
.push(function (result) {
return synchronousChangeState(
getDisplayUrlFor(undefined, {page: 'worklist'})
getDisplayUrlFor(undefined, {page: result})
);
});
}
function routeDisplay(gadget, command_options) {
......@@ -544,7 +547,7 @@
}
if (command_options.args.page === undefined) {
return routeMethodLess();
return routeMethodLess(gadget);
}
command_options.args.jio_key = command_options.path || undefined;
......@@ -788,7 +791,7 @@
if (command_options.method) {
throw new Error('Unsupported hash method: ' + command_options.method);
}
return routeMethodLess();
return routeMethodLess(gadget);
})
.declareMethod('start', function () {
......@@ -799,6 +802,7 @@
.declareAcquiredMethod('jio_allDocs', 'jio_allDocs')
.declareAcquiredMethod('jio_getAttachment', 'jio_getAttachment')
.declareAcquiredMethod('setSetting', 'setSetting')
.declareAcquiredMethod('getSetting', 'getSetting')
.declareService(function () {
var gadget = this;
......
......@@ -8,7 +8,7 @@ web_section = REQUEST.get("current_web_section")
return default_web_page.WebPage_viewAsWeb(mapping_dict={
"frontpage_gadget": web_section.getLayoutProperty("configuration_frontpage_gadget_url", default=""),
"frontpage_gadget": web_section.getLayoutProperty("configuration_frontpage_gadget_url", default="worklist"),
"application_title": web_section.getLayoutProperty("configuration_application_title", default="ERP5"),
"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"),
......
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