diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 1f62a0e66f5..a263f6e8003 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -105,15 +105,17 @@ class Website(openerp.addons.web.controllers.main.Home): view.write(request.cr, request.uid, [view_id], {'inherit_id': view_option_id}, context=request.context) - return request.webcontext.render('website.themes', {'theme_changed': True}) + return request.website.render('website.themes', {'theme_changed': True}) @website.route('/page/', type='http', auth="admin") def page(self, path, **kwargs): - request.webcontext['path'] = path + values = { + 'path': path, + } try: - html = request.webcontext.render(path) + html = request.website.render(path, values) except ValueError: - html = request.webcontext.render('website.404') + html = request.website.render('website.404', values) return html @website.route('/website/customize_template_toggle', type='json', auth='admin') # FIXME: auth @@ -267,6 +269,6 @@ class Website(openerp.addons.web.controllers.main.Home): @website.route(['/website/kanban/'], type='http', auth="public") def kanban(self, **post): - return request.registry['website'].kanban_col(**post) + return request.website.kanban_col(**post) # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 5b20d85c69f..a2f322f1b84 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -106,13 +106,18 @@ table.editorbar-panel td.selected { left: 0px; right: 0px; bottom: 0px; - max-height: 280px; - min-height: 140px; background: #282828; box-shadow: 0px 10px 10px -10px black inset; overflow-y: auto; z-index: 100; } +.oe_snippets .nav-pills { + padding: 3px 8px; + background: #444444; +} +.oe_snippets .nav-pills > li > a { + padding: 2px 10px !important; +} .oe_snippet { display: inline-block; @@ -121,10 +126,10 @@ table.editorbar-panel td.selected { width: 120px; height: 120px; border-radius: 3px; - margin: 10px; + margin: 8px; margin-right: 0px; position: relative; - box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); overflow: hidden; -webkit-user-select: none; user-select: none; diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index e4edcd3c62e..8c32d4222f5 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -98,12 +98,15 @@ table.editorbar-panel left: 0px right: 0px bottom: 0px - max-height: 280px - min-height: 140px background: rgb(40,40,40) box-shadow: 0px 10px 10px -10px black inset overflow-y: auto z-index: 100 + .nav-pills + padding: 3px 8px + background: #444 + > li > a + padding: 2px 10px !important .oe_snippet display: inline-block @@ -112,10 +115,10 @@ table.editorbar-panel width: 120px height: 120px border-radius: 3px - margin: 10px + margin: 8px margin-right: 0px position: relative - box-shadow: 0px 3px 10px rgba(0,0,0,0.2) + box-shadow: 0px 3px 8px rgba(0,0,0,0.2) overflow: hidden -webkit-user-select: none user-select: none diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index 3c8aee57ef2..77db53b45e9 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -193,6 +193,8 @@ a[data-publish][data-publish='on']:hover .css_published { [data-publish]:not(a) { position: relative; overflow: visible; + /*&:hover > [data-publish] */ + /* display: block */ } [data-publish]:not(a) > [data-publish] { position: absolute; @@ -200,6 +202,3 @@ a[data-publish][data-publish='on']:hover .css_published { top: -10px; display: none; } -[data-publish]:not(a):hover > [data-publish] { - display: block; -} diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index b5468a4b0e8..9992a8586ef 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -156,5 +156,5 @@ a[data-publish] right: -6px top: -10px display: none - &:hover > [data-publish] - display: block \ No newline at end of file + /*&:hover > [data-publish]*/ + /* display: block*/ \ No newline at end of file diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 9bb9c30c10b..098a3927e10 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -118,7 +118,11 @@ var editor = new website.EditorBar(); var $body = $(document.body); - editor.prependTo($body); + editor.prependTo($body).then(function () { + if (location.search.indexOf("unable_editor") >= 0) { + editor.edit(); + } + }); $body.css('padding-top', '50px'); // Not working properly: editor.$el.outerHeight()); }; /* ----- TOP EDITOR BAR FOR ADMIN ---- */ @@ -241,7 +245,7 @@ defs.push(def); }); return $.when.apply(null, defs).then(function () { - window.location.reload(); + window.location.href = window.location.href.replace(/unable_editor(=[^&]*)?/, ''); }); }, saveElement: function ($el) { @@ -264,7 +268,7 @@ }); }, cancel: function () { - window.location.reload(); + window.location.href = window.location.href.replace(/unable_editor(=[^&]*)?/, ''); }, }); diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index cde25d7e692..eadd5549fbf 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -189,6 +189,11 @@ }, drop: function(){ var snipped_id = $snippet.data('snippet-id'); + + if (!$(".oe_drop_zone.oe_hover").length) { + return false; + } + if($snippet.find('.oe_snippet_body').size()){ var $toInsert = $snippet.find('.oe_snippet_body').clone(); $toInsert.removeClass('oe_snippet_body'); diff --git a/addons/website/views/views.xml b/addons/website/views/views.xml index 8e0dfbb75f4..88869dcabfa 100644 --- a/addons/website/views/views.xml +++ b/addons/website/views/views.xml @@ -72,16 +72,16 @@