diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-10-16 16:04:39 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-10-16 16:04:39 +0200 |
| commit | 52fee2811d658031a34257b911b1d2b40bfa0c04 (patch) | |
| tree | 61a625efad5e5ffe237e712bf1db2a840b71cb4a /addons/website/static/src | |
| parent | 904adc8b51abd3a0fc29c979884f845d6641da3c (diff) | |
| parent | 2b192bef2242c71d0ff3a45b9efb9e717fd364c4 (diff) | |
[MERGE] forward port of branch 8.0 up to 2b192be
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/css/website.css | 208 | ||||
| -rw-r--r-- | addons/website/static/src/css/website.sass | 150 | ||||
| -rw-r--r-- | addons/website/static/src/img/odoo.jpg | bin | 0 -> 196808 bytes | |||
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 13 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.js | 4 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.snippets.editor.js | 22 | ||||
| -rw-r--r-- | addons/website/static/src/xml/website.editor.xml | 2 |
7 files changed, 368 insertions, 31 deletions
diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index 09d00d6d0b6..589faf1c038 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; /* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY * * css for editor buttons, openerp widget included in the website and other @@ -81,13 +81,11 @@ /* Extra Styles */ img.shadow { - -webkit-border-radius: 3px; -moz-border-radius: 3px; - -ms-border-radius: 3px; - -o-border-radius: 3px; + -webkit-border-radius: 3px; border-radius: 3px; - -webkit-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); margin: 0 auto; } @@ -104,7 +102,7 @@ header a.navbar-brand img { } #wrapwrap p:empty:after { - content: "\2060"; + content: ""; } /* ----- Snippets Styles ----- */ @@ -123,10 +121,8 @@ header a.navbar-brand img { #oe_main_menu_navbar { min-height: 34px; z-index: 1001; - -webkit-border-radius: 0px; -moz-border-radius: 0px; - -ms-border-radius: 0px; - -o-border-radius: 0px; + -webkit-border-radius: 0px; border-radius: 0px; margin-bottom: 0px; } @@ -140,7 +136,7 @@ header a.navbar-brand img { } .css_non_editable_mode_hidden { - display: none; + display: none !important; } /* ----- BOOTSTRAP FIX ----- */ @@ -162,8 +158,8 @@ header a.navbar-brand img { /* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */ html, body, #wrapwrap { - -webkit-box-sizing: border-box; -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; box-sizing: border-box; height: 100%; } @@ -356,6 +352,63 @@ ul.nav-stacked > li > a { padding: 4px 0; } +.o_image_floating { + width: 40%; + margin: 4px; +} +.o_image_floating div.o_container { + position: relative; +} +.o_image_floating div.o_container mark { + display: block; + position: absolute; + bottom: 0; + width: 100%; + background-color: rgba(86, 61, 124, 0.25); +} +.o_image_floating div.o_container mark a { + color: white; +} +.o_image_floating.o_hide_link div.o_container mark { + display: none; +} +.o_image_floating.o_margin_s { + margin-bottom: 4px; +} +.o_image_floating.o_margin_s.pull-right { + margin-left: 8px; +} +.o_image_floating.o_margin_s.pull-left { + margin-right: 8px; +} +.o_image_floating.o_margin_m { + margin-bottom: 8px; +} +.o_image_floating.o_margin_m.pull-right { + margin-left: 12px; +} +.o_image_floating.o_margin_m.pull-left { + margin-right: 12px; +} +.o_image_floating.o_margin_l { + margin-bottom: 12px; +} +.o_image_floating.o_margin_l.pull-right { + margin-left: 16px; +} +.o_image_floating.o_margin_l.pull-left { + margin-right: 16px; +} +.o_image_floating.o_margin_xl { + margin-bottom: 24px; +} +.o_image_floating.o_margin_xl.pull-right { + margin-left: 32px; +} +.o_image_floating.o_margin_xl.pull-left { + margin-right: 32px; +} + /* gallery */ .o_gallery.o_grid.o_spc-none div.row, .o_gallery.o_masonry.o_spc-none div.row { margin: 0; @@ -412,7 +465,7 @@ ul.nav-stacked > li > a { padding: 15px; } .o_gallery.o_slideshow .carousel ul.carousel-indicators li { - border: 1px solid #aaaaaa; + border: 1px solid #aaa; } .o_gallery .carousel-inner .item img { max-width: none; @@ -450,11 +503,11 @@ ul.nav-stacked > li > a { height: 35px; margin: 0 0px 5px 5px; padding: 0; - border: 1px solid #aaaaaa; + border: 1px solid #aaa; text-indent: initial; background-size: cover; opacity: 0.5; - background-color: black; + background-color: #000; } .o_gallery.o_slideshow .carousel ul.carousel-indicators li.active, .modal-body.o_slideshow .carousel ul.carousel-indicators li.active { opacity: 1; @@ -497,6 +550,62 @@ div.carousel div.carousel-content { padding: 32px 0; } +/* Background (kept for 8.0 compatibility) */ +.oe_dark { + background: #eff8f8; + background: rgba(200, 200, 200, 0.14); +} + +.oe_black { + background-color: rgba(0, 0, 0, 0.9); + color: white; +} + +.oe_green { + background-color: #169C78; + color: white; +} +.oe_green .text-muted { + color: #ddd; +} + +.oe_blue_light { + background-color: #41b6ab; + color: white; +} +.oe_blue_light .text-muted { + color: #ddd; +} + +.oe_blue { + background-color: #34495e; + color: white; +} + +.oe_orange { + background-color: #f05442; + color: white; +} +.oe_orange .text-muted { + color: #ddd; +} + +.oe_purple { + background-color: #b163a3; + color: white; +} +.oe_purple .text-muted { + color: #ddd; +} + +.oe_red { + background-color: #9C1b31; + color: white; +} +.oe_red .text-muted { + color: #ddd; +} + /* Misc */ .texttop { vertical-align: top; @@ -547,10 +656,8 @@ span[data-oe-type="monetary"] { } .oe_template_fallback { - -webkit-column-count: 3; -moz-column-count: 3; - -ms-column-count: 3; - -o-column-count: 3; + -webkit-column-count: 3; column-count: 3; } @@ -559,6 +666,13 @@ span[data-oe-type="monetary"] { margin: 40px auto; } +.oe_website_spinner { + width: 121px; +} +.oe_website_spinner input { + text-align: center; +} + div.media_iframe_video { height: 0; margin: 0 auto; @@ -591,3 +705,63 @@ div.media_iframe_video .css_editable_mode_display { transform: none !important; } } +/* Fix: backward compatibility saas-3 */ +div.carousel .container > .carousel-caption { + position: absolute; + right: 50%; + left: 50%; + bottom: 20px; +} +div.carousel .container > .carousel-caption > div { + position: absolute; + text-align: left; + padding: 20px; + background: rgba(0, 0, 0, 0.4); + bottom: 20px; +} +div.carousel .container > .carousel-image { + top: 5%; + bottom: 5%; + position: absolute; + max-height: 90%; + margin: 0 auto; +} +div.carousel .item.text_image .container > .carousel-caption { + left: 10%; +} +div.carousel .item.text_image .container > .carousel-caption > div { + right: 50%; + margin-right: -20%; + max-width: 550px; +} +div.carousel .item.text_image .container > .carousel-image { + right: 10%; + left: 50%; +} +div.carousel .item.image_text .container > .carousel-caption { + right: 10%; +} +div.carousel .item.image_text .container > .carousel-caption > div { + left: 50%; + margin-left: -20%; + max-width: 550px; +} +div.carousel .item.image_text .container > .carousel-image { + right: 50%; + left: 10%; +} +div.carousel .item.text_only .container > .carousel-caption { + left: 10%; + right: 10%; + top: 10%; + bottom: auto; +} +div.carousel .item.text_only .container > .carousel-caption > div { + text-align: center; + background: transparent; + bottom: auto; + width: 100%; +} +div.carousel .item.text_only .container > .carousel-image { + display: none !important; +} diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index b9d7dc1fa9d..ac1397356b5 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -285,6 +285,48 @@ ul.nav-stacked > li > a .hr padding: 4px 0 + +.o_image_floating + width: 40% + margin: 4px + div.o_container + position: relative + mark + display: block + position: absolute + bottom: 0 + width: 100% + background-color: rgba(86,61,124,.25) + a + color: white + &.o_hide_link div.o_container mark + display: none + &.o_margin_s + margin-bottom: 4px + &.pull-right + margin-left: 8px + &.pull-left + margin-right: 8px + &.o_margin_m + margin-bottom: 8px + &.pull-right + margin-left: 12px + &.pull-left + margin-right: 12px + &.o_margin_l + margin-bottom: 12px + &.pull-right + margin-left: 16px + &.pull-left + margin-right: 16px + &.o_margin_xl + margin-bottom: 24px + &.pull-right + margin-left: 32px + &.pull-left + margin-right: 32px + + /* gallery */ .o_gallery @@ -410,6 +452,50 @@ div.carousel vertical-align: middle padding: 32px 0 +/* Background (kept for 8.0 compatibility) */ + +.oe_dark + background: #eff8f8 + background: rgba(200, 200, 200, 0.14) + +.oe_black + background-color: rgba(0, 0, 0, 0.9) + color: white + +.oe_green + background-color: #169C78 + color: white + .text-muted + color: #ddd + +.oe_blue_light + background-color: #41b6ab + color: white + .text-muted + color: #ddd + +.oe_blue + background-color: #34495e + color: white + +.oe_orange + background-color: #f05442 + color: white + .text-muted + color: #ddd + +.oe_purple + background-color: #b163a3 + color: white + .text-muted + color: #ddd + +.oe_red + background-color: #9C1b31 + color: white + .text-muted + color: #ddd + /* Misc */ .texttop @@ -463,6 +549,11 @@ span[data-oe-type="monetary"] overflow:hidden text-overflow:ellipsis +.oe_website_spinner + width: 121px + input + text-align: center + div.media_iframe_video height: 0 margin: 0 auto @@ -491,3 +582,62 @@ div.media_iframe_video -ms-transform: none !important -o-transform: none !important transform: none !important + + +/* Fix: backward compatibility saas-3 */ + +div.carousel + .container + > .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 + > .carousel-image + top: 5% + bottom: 5% + position: absolute + max-height: 90% + margin: 0 auto + .item.text_image + .container + > .carousel-caption + left: 10% + > div + right: 50% + margin-right: -20% + max-width: 550px + > .carousel-image + right: 10% + left: 50% + .item.image_text + .container + > .carousel-caption + right: 10% + > div + left: 50% + margin-left: -20% + max-width: 550px + > .carousel-image + right: 50% + left: 10% + .item.text_only + .container + > .carousel-caption + left: 10% + right: 10% + top: 10% + bottom: auto + > div + text-align: center + background: transparent + bottom: auto + width: 100% + > .carousel-image + display: none !important diff --git a/addons/website/static/src/img/odoo.jpg b/addons/website/static/src/img/odoo.jpg Binary files differnew file mode 100644 index 00000000000..e9c5ac231b1 --- /dev/null +++ b/addons/website/static/src/img/odoo.jpg diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 48d8d139aed..4dda0ffbd35 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1116,17 +1116,17 @@ var classes = (style && style.length ? "btn " : "") + style + " " + size; if ($e.hasClass('email-address') && $e.val().indexOf("@") !== -1) { - def.resolve('mailto:' + val, false, label); + def.resolve('mailto:' + val, false, label, classes); } else if ($e.val() && $e.val().length && $e.hasClass('page')) { var data = $e.select2('data'); if (!data.create) { - def.resolve(data.id, false, data.text); + def.resolve(data.id, false, label || data.text, classes); } else { // Create the page, get the URL back $.get(_.str.sprintf( '/website/add/%s?noredirect=1', encodeURI(data.id))) .then(function (response) { - def.resolve(response, false, data.id); + def.resolve(response, false, data.id, classes); }); } } else { @@ -2029,9 +2029,10 @@ return false; } switch(m.type) { - case 'attributes': // ignore .cke_focus being added or removed - // ignore id modification - if (m.attributeName === 'id') { return false; } + case 'attributes': + // ignore special attributes and .cke_focus class being added or removed + var ignored_attrs = ['id', 'contenteditable', 'attributeeditable'] + if (_.contains(ignored_attrs, m.attributeName)) { return false; } // if attribute is not a class, can't be .cke_focus change if (m.attributeName !== 'class') { return true; } diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 48b656cd89d..eebbb265487 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -93,7 +93,7 @@ options = _.extend({ window_title: '', field_name: '', - default: '', + 'default': '', // dict notation for IE<9 init: function() {} }, options || {}); @@ -106,7 +106,7 @@ var dialog = $(openerp.qweb.render('website.prompt', options)).appendTo("body"); options.$dialog = dialog; var field = dialog.find(options.field_type).first(); - field.val(options.default); + field.val(options['default']); // dict notation for IE<9 field.fillWith = function (data) { if (field.is('select')) { var select = field[0]; diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index eeb8261217c..6147ada2ea3 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -979,7 +979,7 @@ self.$target.carousel(+$(this).data('slide-to')); }); this.$target.attr('contentEditable', 'false'); - this.$target.find('.oe_structure, .content>.row, [data-slide]').attr('contentEditable', 'true'); + this.$target.find('.oe_structure, .content.row, [data-slide]').attr('contentEditable', 'true'); }, clean_for_save: function () { this._super(); @@ -1008,7 +1008,19 @@ this.$target.find('.carousel-control, .carousel-indicators').removeClass("hidden"); this.$indicators.append('<li data-target="#' + this.id + '" data-slide-to="' + cycle + '"></li>'); - var $clone = this.$target.find(".item.active").clone(); + // clone the best candidate from template to use new features + var $snippets = this.BuildingBlock.$snippets.find('.oe_snippet_body.carousel'); + var point = 0; + var selection; + var className = _.compact(this.$target.attr("class").split(" ")); + $snippets.each(function () { + var len = _.intersection(_.compact(this.className.split(" ")), className).length; + if (len > point) { + point = len; + selection = this; + } + }); + var $clone = $(selection).find('.item:first').clone(); // insert $clone.removeClass('active').insertAfter($active); @@ -1112,10 +1124,10 @@ var self = this; this.$target.find('.carousel-control').off('click').on('click', function () { self.$target.carousel( $(this).data('slide')); }); - - this.$target.find('.carousel-image, .carousel-inner .content > div').attr('contentEditable', 'true'); - this.$target.find('.carousel-image').attr('attributeEditable', 'true'); this._super(); + + /* Fix: backward compatibility saas-3 */ + this.$target.find('.item.text_image, .item.image_text, .item.text_only').find('.container > .carousel-caption > div, .container > img.carousel-image').attr('contentEditable', 'true'); }, }); website.snippet.options.marginAndResize = website.snippet.Option.extend({ diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml index c413c54bf43..f509157a053 100644 --- a/addons/website/static/src/xml/website.editor.xml +++ b/addons/website/static/src/xml/website.editor.xml @@ -22,7 +22,7 @@ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 class="modal-title"><t t-esc="title"/></h3> </div> - <div class="modal-body"><t t-raw="__content__"/></div> + <div class="modal-body"><t t-raw="0"/></div> <div class="modal-footer"> <button type="button" class="btn btn-primary save">Save</button> <button type="button" class="btn hidden wait" disabled="disabled"/> |
