[FIX] matching of site page URLs
With page urls not necessarily being full xmlids, match to result of list_pages needs to take that in account to correctly infer a url is a site page's. bzr revid: xmo@openerp.com-20130923110618-ckicw4a5bpvatzie
This commit is contained in:
@@ -64,7 +64,7 @@ class Website(openerp.addons.web.controllers.main.Home):
|
||||
request.cr, request.uid, newview_id, context=request.context)
|
||||
newview.write({
|
||||
'arch': newview.arch.replace("website.default_page", xid),
|
||||
'name': "page/%s" % xid,
|
||||
'name': "page/%s" % path,
|
||||
'page': True,
|
||||
})
|
||||
# Fuck it, we're doing it live
|
||||
|
||||
@@ -604,10 +604,15 @@
|
||||
if (!href) { return; }
|
||||
|
||||
var match, $control;
|
||||
if (match = /(mailto):(.+)/.exec(href)) {
|
||||
$control = this.$('input.email-address').val(match[2]);
|
||||
} else if(href in this.pages) {
|
||||
if (match = /mailto:(.+)/.exec(href)) {
|
||||
$control = this.$('input.email-address').val(match[1]);
|
||||
} else if (href in this.pages) {
|
||||
$control = this.$('select.existing').val(href);
|
||||
} else if (match = /\/page\/(.+)/.exec(href)) {
|
||||
var actual_href = '/page/website.' + match[1];
|
||||
if (actual_href in this.pages) {
|
||||
$control = this.$('select.existing').val(actual_href);
|
||||
}
|
||||
}
|
||||
if (!$control) {
|
||||
$control = this.$('input.url').val(href);
|
||||
|
||||
Reference in New Issue
Block a user