diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 2f49071adf6..2548ad80824 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -271,10 +271,21 @@ class Website(openerp.addons.web.controllers.main.Home): def robots(self): return request.website.render('website.robots', {'url_root': request.httprequest.url_root}) - @website.route(['/sitemap.xml'], type='http', auth="public") - def sitemap(self): + @website.route('/sitemap', type='http', auth='public', multilang=True) + def sitemap(self, **kwargs): return request.website.render('website.sitemap', {'pages': request.website.list_pages()}) + @website.route('/sitemap.xml', type='http', auth="public") + def sitemap_xml(self): + body = request.website.render('website.sitemap_xml', { + 'pages': request.website.list_pages() + }) + + return request.make_response(body, [ + ('Content-Type', 'application/xml;charset=utf-8') + ]) + + class Images(http.Controller): def placeholder(self, response): # file_open may return a StringIO. StringIO can be closed but are diff --git a/addons/website/data/website_demo.xml b/addons/website/data/website_demo.xml index 672f2f3d29d..d23bc50c817 100644 --- a/addons/website/data/website_demo.xml +++ b/addons/website/data/website_demo.xml @@ -9,5 +9,8 @@ http://www.linkedin.com/company/openerp + + Great Product for Great People + diff --git a/addons/website/models/ir_ui_view.py b/addons/website/models/ir_ui_view.py index ab09336d6cb..123557a625e 100644 --- a/addons/website/models/ir_ui_view.py +++ b/addons/website/models/ir_ui_view.py @@ -131,7 +131,9 @@ class view(osv.osv): arch_section = html.fromstring( value, parser=html.HTMLParser(encoding='utf-8')) - self._normalize_urls(arch_section) + # TODO fme: Temporary desactivated because this breaks most of the snippets + # Need to find another way to normalize multilang urls (postprocessing) ? + # self._normalize_urls(arch_section) if xpath is None: # value is an embedded field on its own, not a view section diff --git a/addons/website/models/website.py b/addons/website/models/website.py index d7f47c01b25..add8c921b92 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -55,7 +55,7 @@ def url_for(path, lang=None, keep_query=None): if request: path = urljoin(request.httprequest.path, path) langs = request.context.get('langs') - if path[0] == '/' and len(langs) > 1: + if path[0] == '/' and (len(langs) > 1 or lang): ps = path.split('/') lang = lang or request.context.get('lang') if ps[1] in langs: diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 8fa0ad80f5f..474012afc98 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -1,3 +1,4 @@ +@charset "utf-8"; /* ---- CKEditor Minimal Reset ---- */ .navbar.navbar-inverse .cke_chrome { border: none; diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index c851c7e43f6..dd7d1f3183b 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -2,7 +2,7 @@ /* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY * * css for editor buttons, openerp widget included in the website and other - * stuff must go to the editor.css + * stuff must go to the editor.css * */ /* ----- GENERIC LAYOUTING HELPERS ---- */ @@ -440,3 +440,7 @@ a[data-publish][data-publish='on']:hover .css_published { ::selection { background: rgba(150, 150, 220, 0.3); } + +.logo-img { + width: 220px; +} diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 4d9a6ae01c0..8ef6407e08c 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -1,10 +1,10 @@ @charset "utf-8" -/* +/* * THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY * * css for editor buttons, openerp widget included in the website and other - * stuff must go to the editor.css + * stuff must go to the editor.css * */ @@ -133,7 +133,7 @@ html,body, #wrapwrap header, #wrap, footer display: table-row - + footer height: 100% background: rgb(239, 248, 248) @@ -183,7 +183,7 @@ footer // .navbar .nav > li a // text-shadow: none -// .nav > li a +// .nav > li a // display: block .carousel-inner .item @@ -284,7 +284,6 @@ footer height: 300px &.oe_big height: 450px - /* -- Hack for removing double scrollbar from mobile preview -- */ div#mobile-preview.modal overflow: hidden @@ -335,3 +334,6 @@ a[data-publish] ::selection background: rgba(150, 150, 220, 0.3) + +.logo-img + width: 220px diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index c29325c8de8..303e670b133 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -1037,6 +1037,11 @@ this.$target.attr("id", "myCarousel" + id); this.$target.find(".carousel-control").attr("href", "#myCarousel" + id); this.$target.find("[data-target='#myCarousel']").attr("data-target", "#myCarousel" + id); + + this.$target.attr('contentEditable', 'false') + .find('.content, .carousel-image img') + .attr('contentEditable', 'true'); + this.rebind_event(); }, onFocus: function () { @@ -1053,6 +1058,9 @@ if(!this.$target.find(".item.active").length) { this.$target.find(".item:first").addClass("active"); } + this.$target.removeAttr('contentEditable') + .find('.content, .carousel-image img') + .removeAttr('contentEditable'); }, start : function () { this._super(); @@ -1223,7 +1231,6 @@ size = 'oe_small'; else if ($el.hasClass('oe_medium')) size = 'oe_medium'; - var $ul = this.$editor.find('ul[name="parallax-size"]'); var $li = $ul.find("li"); diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index d1f4d92e35a..82c8c94a2c4 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -62,7 +62,7 @@ Banner -