diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index 5d0f452863f..78c51dd9907 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -199,12 +199,11 @@ html, body, #wrapwrap { } #wrapwrap { - display: table; width: 100%; } header, #wrap, footer { - display: table-row; + margin: 0 auto; } footer { @@ -224,6 +223,10 @@ footer { width: 100%; } +.row { + min-height: 32px; +} + /* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */ .oe_structure.oe_editable.oe_empty:empty, .oe_editable[data-oe-type=html]:empty, .oe_structure.oe_editable.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child { background-image: url("/website/static/src/img/drag_here.png"); @@ -283,12 +286,12 @@ ul.nav-stacked > li > a { } /* ---- PUBLISH ---- */ -.css_unpublish, .css_publish { +.css_published .btn-danger, .css_published .css_publish { display: none; } -.css_published .css_unpublish, .css_unpublished .css_publish { - display: block; +.css_unpublished .btn-success, .css_unpublished .css_unpublish { + display: none; } [data-publish='off'] { @@ -345,23 +348,7 @@ ul.nav-stacked > li > a { .carousel.oe_big .carousel-inner { height: 450px; } -.carousel .carousel-caption h1, .carousel .carousel-caption h2, .carousel .carousel-caption h3 { - margin-top: 10px; - margin-bottom: 10px; -} -.carousel .carousel-image { - right: 10%; - left: 50%; - top: 5%; - bottom: 5%; - position: absolute; - text-align: center; -} -.carousel .carousel-image img { - height: 100%; - margin: 0 auto; -} -.carousel .item.text_image .carousel-caption { +.carousel .carousel-caption { left: auto; right: auto; bottom: 10%; @@ -369,6 +356,19 @@ ul.nav-stacked > li > a { padding: 20px; background: rgba(0, 0, 0, 0.4); } +.carousel .carousel-caption h1, .carousel .carousel-caption h2, .carousel .carousel-caption h3 { + margin-top: 10px; + margin-bottom: 10px; +} +.carousel .carousel-image { + right: 50%; + left: 50%; + top: 5%; + bottom: 5%; + position: absolute; + max-height: 90%; + margin: 0 auto; +} .carousel .item.text_only .carousel-image { display: none !important; } @@ -376,18 +376,14 @@ ul.nav-stacked > li > a { left: 10%; right: 10%; top: 10%; + bottom: auto; text-align: center; + background: transparent; } .carousel .item.image_text .carousel-caption { - left: auto; - text-align: left; right: 10%; - bottom: 10%; - padding: 20px; - background: rgba(0, 0, 0, 0.4); } .carousel .item.image_text .carousel-image { - right: 50%; left: 10%; } .carousel .carousel-control { diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index a08aee8cfd1..4a79b7b4a97 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -124,11 +124,10 @@ html,body, #wrapwrap height: 100% #wrapwrap - display: table width: 100% header, #wrap, footer - display: table-row + margin: 0 auto footer height: 100% @@ -145,6 +144,9 @@ footer float: left width: 100% +.row + min-height: 32px + /* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */ .oe_structure.oe_editable.oe_empty:empty, .oe_editable[data-oe-type=html]:empty, .oe_structure.oe_editable.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child @@ -202,10 +204,12 @@ ul.nav-stacked > li > a text-transform: uppercase /* ---- PUBLISH ---- */ -.css_unpublish, .css_publish - display: none -.css_published .css_unpublish, .css_unpublished .css_publish - display: block +.css_published + .btn-danger, .css_publish + display: none +.css_unpublished + .btn-success, .css_unpublish + display: none [data-publish='off'] +opacity(0.5) @@ -250,27 +254,23 @@ ul.nav-stacked > li > a &.oe_big .carousel-inner height: 450px .carousel-caption + left: auto + right: auto + bottom: 10% + text-align: left + padding: 20px + background: rgba(0, 0, 0, 0.4) h1, h2, h3 margin-top: 10px margin-bottom: 10px .carousel-image - right: 10% + right: 50% left: 50% top: 5% bottom: 5% position: absolute - text-align: center - img - height: 100% - margin: 0 auto - .item.text_image - .carousel-caption - left: auto - right: auto - bottom: 10% - text-align: left - padding: 20px - background: rgba(0, 0, 0, 0.4) + max-height: 90% + margin: 0 auto .item.text_only .carousel-image display: none !important @@ -278,17 +278,13 @@ ul.nav-stacked > li > a left: 10% right: 10% top: 10% + bottom: auto text-align: center + background: transparent .item.image_text .carousel-caption - left: auto - text-align: left right: 10% - bottom: 10% - padding: 20px - background: rgba(0, 0, 0, 0.4) .carousel-image - right: 50% left: 10% .carousel-control cursor: pointer diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 79d5f6b9d57..64767d95171 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -266,12 +266,11 @@ /* ----- PUBLISHING STUFF ---- */ $(document).on('click', '.js_publish_management .js_publish_btn', function () { - var $data = $(this).parent(".js_publish_management"); - var self=this; + var $data = $(this).parents(".js_publish_management:first"); + var self=this; openerp.jsonRpc($data.data('controller') || '/website/publish', 'call', {'id': +$data.data('id'), 'object': $data.data('object')}) .then(function (result) { $data.toggleClass("css_unpublished css_published"); - $(self).toggleClass("btn-success btn-danger"); $data.parents("[data-publish]").attr("data-publish", +result ? 'on' : 'off'); }).fail(function (err, data) { website.error(data, '/web#return_label=Website&model='+$data.data('object')+'&id='+$data.data('id')); diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index e605bba3d1b..55a920eab28 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1114,9 +1114,12 @@ this.$target.addClass("col-md-offset-" + this.$target.prevAll(".oe_drop_to_remove").length); this._super(); }, + hide_remove_button: function() { + this.$overlay.find('.oe_snippet_remove').toggleClass("hidden", !this.$target.siblings().length); + }, onFocus : function () { this._super(); - this.$overlay.find('.oe_snippet_remove').toggleClass("hidden", !this.$target.siblings().length); + this.hide_remove_button(); }, on_clone: function () { var $clone = this.$target.clone(false); @@ -1124,13 +1127,16 @@ _class += ' col-md-1'; $clone.attr("class", _class); this.$target.after($clone); + this.hide_remove_button(); return false; }, on_remove: function () { if (!this.$target.siblings().length){ return false; } - return this._super(); + this._super(); + this.hide_remove_button(); + return false; }, on_resize: function (compass, beginClass, current) { if (compass !== 'w') @@ -1174,7 +1180,7 @@ self.$target.carousel(+$(this).data('slide-to')); }); this.$target.attr('contentEditable', 'false'); - this.$target.find('.oe_structure, blockquote').attr('contentEditable', 'true'); + this.$target.find('.oe_structure, .content>.row').attr('contentEditable', 'true'); this.$target.carousel('pause'); }, @@ -1259,7 +1265,6 @@ this._super(); this.$target.css("background-image", ""); this.$target.removeClass(this._class); - this.$target.find('.content, .carousel-image img').attr('contentEditable', 'true'); }, start : function () { var self = this; @@ -1314,7 +1319,7 @@ this.$target.find('.carousel-control').off('click').on('click', function () { self.$target.carousel( $(this).data('slide')); }); - this.$target.find('.carousel-image img, .content').attr('contentEditable', 'true'); + this.$target.find('.carousel-image, .content').attr('contentEditable', 'true'); this._super(); }, }); diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 9bea6b223da..f0b9043f20f 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -92,18 +92,18 @@ }, { stepId: 'activate-text-block-title', - element: '#wrap [data-snippet-id=three-columns]:first .text-center[data-snippet-id=colmd]', + element: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]', placement: 'top', title: "Edit an Area", content: "Select any area of the page to modify it. Click on this subtitle.", trigger: { - emitter: '#wrap [data-snippet-id=three-columns]:first .text-center[data-snippet-id=colmd]', + emitter: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]', id: 'snippet-activated', }, }, { stepId: 'remove-text-block-title', - element: '.ui-draggable.oe_active .oe_snippet_remove', + element: '.oe_active .oe_snippet_remove', placement: 'top', title: "Delete the Title", content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the trash can to delete the title.", diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 3ea5626009f..114e28a389c 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -223,11 +223,11 @@ var selector = '#oe_snippets div.oe_snippet[data-snippet-id="'+snippetId+'"] .oe_snippet_thumbnail'; var $thumbnail = $(selector).first(); var thumbnailPosition = $thumbnail.position(); - $thumbnail.trigger($.Event( "mousedown", { which: 1, pageX: thumbnailPosition.left, pageY: thumbnailPosition.top })); - $thumbnail.trigger($.Event( "mousemove", { which: 1, pageX: thumbnailPosition.left+100, pageY: thumbnailPosition.top+700 })); + $thumbnail.trigger($.Event("mousedown", { which: 1, pageX: thumbnailPosition.left, pageY: thumbnailPosition.top })); + $thumbnail.trigger($.Event("mousemove", { which: 1, pageX: thumbnailPosition.left+100, pageY: thumbnailPosition.top+700 })); var $dropZone = $(".oe_drop_zone").first(); var dropPosition = $dropZone.position(); - $dropZone.trigger($.Event( "mouseup", { which: 1, pageX: dropPosition.left, pageY: dropPosition.top })); + $dropZone.trigger($.Event("mouseup", { which: 1, pageX: dropPosition.left, pageY: dropPosition.top })); }, tests: [], }; @@ -256,6 +256,7 @@ return this._super(); }, registerTour: function (tour) { + var testId = 'test_'+tour.id+'_tour'; this.tours.push(tour); TestConsole.tests.push({ id: tour.id, @@ -263,22 +264,34 @@ var actionSteps = _.filter(tour.steps, function (step) { return step.trigger; }); - var currentIndex = 0; function executeStep (step) { - var $element = $(step.element); + window.localStorage.setItem(testId, step.stepId); step.triggers(function () { - currentIndex = currentIndex + 1; - executeStep(actionSteps[currentIndex]); + var nextStep = actionSteps.shift(); + if (nextStep) { + setTimeout(function () { + executeStep(nextStep); + }, 10); + } }); if (step.snippet && step.trigger === 'drag') { - setTimeout(function () { - TestConsole.dragAndDropSnippet(step.snippet); - }, 50); + TestConsole.dragAndDropSnippet(step.snippet); } else { - $element.click(); + var $element = $(step.element); + $element.trigger($.Event("click", { srcElement: $element })); } } - executeStep(actionSteps[currentIndex]); + var lastStepId = window.localStorage.getItem(testId); + var currentStep = actionSteps.shift(); + if (lastStepId) { + while (currentStep && lastStepId !== currentStep.stepId) { + currentStep = actionSteps.shift(); + } + } + executeStep(currentStep); + }, + reset: function () { + window.localStorage.removeItem(testId); }, }); }, diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index abd419fcd85..437074ba189 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -40,9 +40,7 @@ Contact us

- + @@ -304,7 +302,7 @@
-
+

Write here a quote from one of your customer. Quotes are are great way to give confidence in your products or services. diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 2ba72fc581e..8734777dc4f 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -277,14 +277,18 @@