summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/utils.js
diff options
context:
space:
mode:
authorrde <rde@odoo.com>2017-09-15 12:36:59 +0200
committerJeremy Kersten <jke@odoo.com>2017-09-15 15:29:37 +0200
commit4ecbacaf59576a22ff45615a5aa5c67244e4fb93 (patch)
treeb1d38321d2838579ccb8adc2f3fcdd0765351fcc /addons/website/static/src/js/utils.js
parent13a44d33bda1d7ff21e3de5de8b3c84f6a482a0d (diff)
[ADD] website: add new page management
website.page = old ir.ui.view with page=True website.redirect is a new mechanism to replace in the futur the ir.attachment mechanism of redirect. From now, we don't have a specific /page controller to serve 'page'. We use a new model website.page which is rendered if none route matches the url and that the field 'url' on website.page matches the request.httprequest.path. The order to serve a path is: - Routes defines in controllers (/shop, /blog, ...) - ir.attachment with name matching the path - website.page with url matching the path - website.redirect with url_from matching the path - 404 To improve: - allow regexp in website.redirect model - allow to edit the view_arch from the page.management via redirect backend (needed when traceback in the page, or when modifying a js/css/less/...)
Diffstat (limited to 'addons/website/static/src/js/utils.js')
-rw-r--r--addons/website/static/src/js/utils.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/website/static/src/js/utils.js b/addons/website/static/src/js/utils.js
index 40a4033540d..e7f76376480 100644
--- a/addons/website/static/src/js/utils.js
+++ b/addons/website/static/src/js/utils.js
@@ -7,7 +7,7 @@ var weContext = require('web_editor.context');
var qweb = core.qweb;
/**
- * Allows the given input to propose existing website pages.
+ * Allows the given input to propose existing website URLs.
*
* @param {ServicesMixin|Widget} self - an element capable to trigger an RPC
* @param {jQuery} $input
@@ -25,7 +25,12 @@ function autocompleteWithPages(self, $input) {
},
}).then(function (exists) {
var rs = _.map(exists, function (r) {
- return r.loc;
+ if (show_only_website_page_model) {
+ return r.loc + ' (' + r.name + ')';
+ }
+ else {
+ return r.loc;
+ }
});
response(rs);
});