From f3e405fbe174d737f0a945295a28d9480b0cc4c1 Mon Sep 17 00:00:00 2001 From: Kersten Jeremy Date: Tue, 8 Apr 2014 13:54:24 +0200 Subject: [PATCH] [FIX] Website snippet - Update carousel to use bootstrap position and size without CSS. Fix bug with slide-to which doesn't work. bzr revid: jke@openerp.com-20140408115424-irsmuhibasonhv7p --- addons/website/static/src/css/website.css | 74 +++---------------- addons/website/static/src/css/website.sass | 61 ++------------- .../static/src/js/website.snippets.editor.js | 2 +- addons/website/views/snippets.xml | 30 +++----- 4 files changed, 30 insertions(+), 137 deletions(-) diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index 354796a053e..ee732d0495f 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -1,3 +1,4 @@ +@charset "utf-8"; /* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY * * css for editor buttons, openerp widget included in the website and other @@ -305,69 +306,6 @@ section, .carousel, .parallax, .row, .hr, .blockquote { background-size: cover; } -.carousel .carousel-caption { - position: absolute; - right: 50%; - left: 50%; - bottom: 20px; -} -.carousel .carousel-caption > div { - position: absolute; - text-align: left; - padding: 20px; - background: rgba(0, 0, 0, 0.4); - bottom: 20px; -} -.carousel .carousel-caption h1, .carousel .carousel-caption h2, .carousel .carousel-caption h3 { - margin-top: 10px; - margin-bottom: 10px; -} -.carousel .carousel-image { - top: 5%; - bottom: 5%; - position: absolute; - max-height: 90%; - margin: 0 auto; -} -.carousel .item.text_only .carousel-image { - display: none !important; -} -.carousel .item.text_only .carousel-caption { - left: 10%; - right: 10%; - top: 10%; - bottom: auto; -} -.carousel .item.text_only .carousel-caption > div { - text-align: center; - background: transparent; - bottom: auto; - width: 100%; -} -.carousel .item.text_image .carousel-caption { - left: 10%; -} -.carousel .item.text_image .carousel-caption > div { - right: 50%; - margin-right: -20%; - max-width: 550px; -} -.carousel .item.text_image .carousel-image { - right: 10%; - left: 50%; -} -.carousel .item.image_text .carousel-caption { - right: 10%; -} -.carousel .item.image_text .carousel-caption > div { - left: 50%; - margin-left: -20%; - max-width: 550px; -} -.carousel .item.image_text .carousel-image { - right: 50%; - left: 10%; -} .carousel .carousel-control { cursor: pointer; } @@ -394,6 +332,16 @@ div.carousel .carousel-indicators li { div.carousel .carousel-indicators .active { background-color: grey; } +div.carousel span.carousel-img img, div.carousel div.carousel-content { + max-height: 95%; + padding: 10px; +} +div.carousel div.carousel-content { + background-color: black; + color: white; + background: rgba(0, 0, 0, 0.3); + margin-top: 75px; +} .parallax { background-size: cover; diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 77da53c2958..ff50fb3dd18 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -249,59 +249,6 @@ section, .carousel, .parallax, .row, .hr, .blockquote height: 100% background-size: cover .carousel - .carousel-caption - position: absolute - right: 50% - left: 50% - bottom: 20px - > div - position: absolute - text-align: left - padding: 20px - background: rgba(0, 0, 0, 0.4) - bottom: 20px - h1, h2, h3 - margin-top: 10px - margin-bottom: 10px - .carousel-image - top: 5% - bottom: 5% - position: absolute - max-height: 90% - margin: 0 auto - .item.text_only - .carousel-image - display: none !important - .carousel-caption - left: 10% - right: 10% - top: 10% - bottom: auto - > div - text-align: center - background: transparent - bottom: auto - width: 100% - .item.text_image - .carousel-caption - left: 10% - > div - right: 50% - margin-right: -20% - max-width: 550px - .carousel-image - right: 10% - left: 50% - .item.image_text - .carousel-caption - right: 10% - > div - left: 50% - margin-left: -20% - max-width: 550px - .carousel-image - right: 50% - left: 10% .carousel-control cursor: pointer span @@ -324,6 +271,14 @@ div.carousel border: 1px solid grey .active background-color: grey + span.carousel-img img, div.carousel-content + max-height: 95% + padding: 10px + div.carousel-content + background-color: black + color: white + background: rgba(0, 0, 0, 0.3) + margin-top: 75px .parallax background-size: cover diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 52deeabf5e6..c5a085f209d 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -927,7 +927,7 @@ drop_and_build_snippet: function() { this.id = this.unique_id(); this.$target.attr("id", this.id); - this.$target.find("[data-slide]").attr("href", "#" + this.id); + this.$target.find("[data-slide]").attr("data-cke-saved-href", "#" + this.id); this.$target.find("[data-slide-to]").attr("data-target", "#" + this.id); this.rebind_event(); diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index 3e27ffb227f..7ee96aa1162 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -26,16 +26,18 @@