summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2013-12-02 16:49:35 +0100
committerThibault Delavallée <tde@openerp.com>2013-12-02 16:49:35 +0100
commit3a96d971fa25becb3d348bac4b339b3a5d65fd16 (patch)
tree86e3b6a9b6dc018266b4a7b33e6acb2dbe54aca6 /addons/website/static/src
parent5ee3495ccbcf300d9bdbbcbaa6dfe677bab3dc61 (diff)
parentb54ec1c5a21f878b28decc6744a7899bc22af687 (diff)
[MERGE] Sync with website-al
bzr revid: tde@openerp.com-20131202154935-t8wcgt180bbop8yy
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/css/editor.css5
-rw-r--r--addons/website/static/src/css/editor.sass3
-rw-r--r--addons/website/static/src/css/website.backend.css6
-rw-r--r--addons/website/static/src/css/website.css50
-rw-r--r--addons/website/static/src/css/website.sass39
-rw-r--r--addons/website/static/src/img/library/gears.jpgbin87089 -> 0 bytes
-rw-r--r--addons/website/static/src/img/library/gears.pngbin0 -> 140768 bytes
-rw-r--r--addons/website/static/src/js/website.ace.js41
-rw-r--r--addons/website/static/src/js/website.backend.js32
-rw-r--r--addons/website/static/src/js/website.editor.js34
-rw-r--r--addons/website/static/src/js/website.menu.js2
-rw-r--r--addons/website/static/src/js/website.snippets.animation.js3
-rw-r--r--addons/website/static/src/js/website.snippets.editor.js240
-rw-r--r--addons/website/static/src/js/website.tour.banner.js2
-rw-r--r--addons/website/static/src/xml/website.backend.xml25
-rw-r--r--addons/website/static/src/xml/website.xml2
16 files changed, 371 insertions, 113 deletions
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css
index 7a71740671b..f05db4c88b8 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;
@@ -85,6 +86,10 @@
display: none;
}
+.cke_editable .css_editable_mode_hidden {
+ display: none;
+}
+
.oe_carousel_options {
cursor: pointer;
position: absolute;
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index ea7bbb1480a..1e35c352374 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -70,6 +70,9 @@
.css_non_editable_mode_hidden
display: none
+.cke_editable .css_editable_mode_hidden
+ display: none
+
.oe_carousel_options
cursor: pointer
position: absolute
diff --git a/addons/website/static/src/css/website.backend.css b/addons/website/static/src/css/website.backend.css
new file mode 100644
index 00000000000..e6601788bcc
--- /dev/null
+++ b/addons/website/static/src/css/website.backend.css
@@ -0,0 +1,6 @@
+.oe_WidgetWebsiteButton .btn-danger .oe_publish {
+ display: none;
+}
+.oe_WidgetWebsiteButton .btn-success .oe_unpublish {
+ display: none;
+} \ No newline at end of file
diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css
index b5c176ee173..71f030a8bec 100644
--- a/addons/website/static/src/css/website.css
+++ b/addons/website/static/src/css/website.css
@@ -254,6 +254,13 @@ footer {
content: "Drag Building Blocks Here";
}
+.oe_structure.oe_editable [data-snippet-id]:empty {
+ background: rgba(255, 0, 0, 0.1);
+}
+.oe_structure.oe_editable [data-snippet-id]:empty:before {
+ content: "Please Edit This Empty Block";
+}
+
/* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */
.navbar .nav > li > p {
margin-bottom: 0px;
@@ -406,14 +413,14 @@ ul.nav-stacked > li > a {
}
/* Parallax Theme */
-.parallax_quote {
+.parallax_quote, [data-snippet-id="slider"] {
background: center center no-repeat fixed;
background-size: contain;
}
-.parallax_quote .carousel-indicators li {
+.parallax_quote .carousel-indicators li, [data-snippet-id="slider"] .carousel-indicators li {
border: 1px solid grey;
}
-.parallax_quote .carousel-indicators .active {
+.parallax_quote .carousel-indicators .active, [data-snippet-id="slider"] .carousel-indicators .active {
background-color: grey;
}
@@ -456,3 +463,40 @@ ul.nav-stacked > li > a {
height: 100%;
background-size: 100%;
}
+
+.texttop {
+ vertical-align: top;
+}
+
+table.well tr th {
+ text-align: right;
+ padding-right: 10px;
+}
+table.well tr td {
+ padding-right: 5px;
+}
+
+.logo-img {
+ width: 220px;
+}
+
+.oe_demo {
+ position: relative;
+}
+.oe_demo img {
+ width: 100%;
+}
+.oe_demo div {
+ position: absolute;
+ left: 0;
+ background-color: rgba(0, 0, 0, 0.4);
+ opacity: 0.85;
+ bottom: 0px;
+ width: 100%;
+ padding: 7px;
+ color: white;
+ font-weight: bold;
+}
+.oe_demo div a {
+ color: white;
+}
diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass
index fc309da3281..157fd19148c 100644
--- a/addons/website/static/src/css/website.sass
+++ b/addons/website/static/src/css/website.sass
@@ -171,6 +171,11 @@ footer
.oe_structure.oe_editable.oe_empty:empty:before, .oe_editable[data-oe-type=html]:empty:before, .oe_structure.oe_editable.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before
content: 'Drag Building Blocks Here'
+.oe_structure.oe_editable [data-snippet-id]:empty
+ background: rgba(255,0,0,0.1)
+ &:before
+ content: 'Please Edit This Empty Block'
+
/* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */
.navbar .nav > li > p
@@ -304,7 +309,7 @@ ul.nav-stacked > li > a
/* Parallax Theme */
-.parallax_quote
+.parallax_quote, [data-snippet-id="slider"]
background: center center no-repeat fixed
background-size: contain
.carousel-indicators
@@ -337,4 +342,34 @@ ul.nav-stacked > li > a
background-color: rgba(255, 0, 0, 0.8)
.oe_img_bg
height: 100%
- background-size: 100% \ No newline at end of file
+ background-size: 100%
+
+.texttop
+ vertical-align: top
+
+table.well tr
+ th
+ text-align: right
+ padding-right: 10px
+ td
+ padding-right: 5px
+
+.logo-img
+ width: 220px
+
+.oe_demo
+ position: relative
+ img
+ width: 100%
+ div
+ position: absolute
+ left: 0
+ background-color: rgba(0,0,0,0.4)
+ opacity: 0.85
+ bottom: 0px
+ width: 100%
+ padding: 7px
+ color: white
+ font-weight: bold
+ a
+ color: white
diff --git a/addons/website/static/src/img/library/gears.jpg b/addons/website/static/src/img/library/gears.jpg
deleted file mode 100644
index 868c2532c41..00000000000
--- a/addons/website/static/src/img/library/gears.jpg
+++ /dev/null
Binary files differ
diff --git a/addons/website/static/src/img/library/gears.png b/addons/website/static/src/img/library/gears.png
new file mode 100644
index 00000000000..1d3c7d85ca0
--- /dev/null
+++ b/addons/website/static/src/img/library/gears.png
Binary files differ
diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js
index 685ace69467..1156ac5165e 100644
--- a/addons/website/static/src/js/website.ace.js
+++ b/addons/website/static/src/js/website.ace.js
@@ -59,8 +59,12 @@
website.ace.ViewOption = openerp.Widget.extend({
template: 'website.ace_view_option',
init: function (parent, options) {
+ var indent = "- ";
this.view_id = options.id;
this.view_name = options.name;
+ for (var i = 0; i<options.level; i++) {
+ this.view_name = indent + this.view_name;
+ }
this._super(parent);
},
});
@@ -133,18 +137,47 @@
},
loadViews: function (views) {
var self = this;
+ var $viewList = self.$('#ace-view-list');
+ var views = this.buildViewGraph(views);
+ _.each(views, function (view) {
+ if (view.id) {
+ new website.ace.ViewOption(self, view).appendTo($viewList);
+ self.loadView(view.id);
+ }
+ });
+ },
+ buildViewGraph: function (views) {
var activeViews = _.uniq(_.filter(views, function (view) {
return view.active;
}), false, function (view) {
return view.id;
});
- var $viewList = self.$('#ace-view-list');
+ var index = {};
+ var roots = [];
_.each(activeViews, function (view) {
- if (view.id) {
- new website.ace.ViewOption(self, view).appendTo($viewList);
- self.loadView(view.id);
+ index[view.id] = view;
+ view.children = [];
+ });
+ _.each(index, function (view) {
+ var parentId = view.inherit_id;
+ if (parentId) {
+ index[parentId].children.push(view);
+ } else {
+ roots.push(view);
}
});
+ var result = [];
+ function visit (node, level) {
+ node.level = level;
+ result.push(node);
+ _.each(node.children, function (child) {
+ visit(child, level + 1);
+ });
+ }
+ _.each(roots, function (node) {
+ visit(node, 0);
+ });
+ return result;
},
loadView: function (id) {
var viewId = parseInt(id, 10);
diff --git a/addons/website/static/src/js/website.backend.js b/addons/website/static/src/js/website.backend.js
new file mode 100644
index 00000000000..43347b85cb7
--- /dev/null
+++ b/addons/website/static/src/js/website.backend.js
@@ -0,0 +1,32 @@
+openerp.website = function(instance) {
+var _t = instance.web._t;
+
+instance.web.form.WidgetWebsiteButton = instance.web.form.AbstractField.extend({
+ template: 'WidgetWebsiteButton',
+ render_value: function() {
+ this._super();
+ this.$("button:first")
+ .toggleClass("btn-success", this.get_value())
+ .toggleClass("btn-danger", !this.get_value());
+ this.$("a:first").attr("href", this.view.datarecord.website_url || "/" );
+ if (this.node.attrs.class) {
+ this.$el.addClass(this.node.attrs.class);
+ }
+ },
+ start: function() {
+ var self = this;
+ this._super.apply(this, arguments);
+
+ this.$("button:first").on("click", function () {
+ console.log("click", !!$(this).hasClass("btn-danger"));
+ self.set_value(!!$(this).hasClass("btn-danger"));
+ return self.view.recursive_save();
+ });
+ },
+});
+
+instance.web.form.widgets = instance.web.form.widgets.extend({
+ 'website_button': 'instance.web.form.WidgetWebsiteButton',
+});
+
+};
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index c50ad392887..b5caac71d74 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -104,6 +104,7 @@
left: $el.width() / 2 + image_left - $btn.outerWidth() / 2,
});
}).on('mouseleave', 'img', function (e) {
+ if (!previousSelection) { return; }
var $previous = $(previousSelection.$);
var $button = $previous.next('button');
$button.css('visibility', 'hidden');
@@ -1370,6 +1371,11 @@
// a/@href, ...)
_(mutations).chain()
.filter(function (m) {
+ // ignore any change related to mundane image-edit-button
+ if (m.target && m.target.className
+ && m.target.className.indexOf('image-edit-button') !== -1) {
+ return false;
+ }
switch(m.type) {
case 'attributes': // ignore .cke_focus being added or removed
// if attribute is not a class, can't be .cke_focus change
@@ -1383,8 +1389,11 @@
// ignore mutation if the *only* change is .cke_focus
return change.length !== 1 || change[0] === 'cke_focus';
case 'childList':
- // <br type="_moz"> appears when focusing RTE in FF, ignore
- return m.addedNodes.length !== 1 || m.addedNodes[0].nodeName !== 'BR';
+ // Remove ignorable nodes from addedNodes or removedNodes,
+ // if either set remains non-empty it's considered to be an
+ // impactful change. Otherwise it's ignored.
+ return !!remove_mundane_nodes(m.addedNodes).length ||
+ !!remove_mundane_nodes(m.removedNodes).length;
default:
return true;
}
@@ -1394,11 +1403,30 @@
while (node && !$(node).hasClass('oe_editable')) {
node = node.parentNode;
}
- $(m.target).trigger('node_changed');
return node;
})
.compact()
.uniq()
.each(function (node) { $(node).trigger('content_changed'); })
});
+ function remove_mundane_nodes(nodes) {
+ if (!nodes || !nodes.length) { return []; }
+
+ var output = [];
+ for(var i=0; i<nodes.length; ++i) {
+ var node = nodes[i];
+ if (node.nodeName === 'BR' && node.getAttribute('type') === '_moz') {
+ // <br type="_moz"> appears when focusing RTE in FF, ignore
+ continue;
+ }
+ if (node.className.indexOf('image-edit-button') !== -1) {
+ // [Edit] button added and removed on image hover, don't count
+ // as making parent node dirty
+ continue;
+ }
+
+ output.push(node);
+ }
+ return output;
+ }
})();
diff --git a/addons/website/static/src/js/website.menu.js b/addons/website/static/src/js/website.menu.js
index b3554b9e7c5..87dd46dafe9 100644
--- a/addons/website/static/src/js/website.menu.js
+++ b/addons/website/static/src/js/website.menu.js
@@ -15,7 +15,7 @@
openerp.jsonRpc('/web/dataset/call_kw', 'call', {
model: 'website.menu',
method: 'get_tree',
- args: [[context.website_id]],
+ args: [context.website_id],
kwargs: {
context: context
},
diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js
index e491912da15..1dbb2d7426e 100644
--- a/addons/website/static/src/js/website.snippets.animation.js
+++ b/addons/website/static/src/js/website.snippets.animation.js
@@ -51,7 +51,8 @@
},
});
- website.snippet.animationRegistry.carousel = website.snippet.Animation.extend({
+ website.snippet.animationRegistry.carousel =
+ website.snippet.animationRegistry.slider = website.snippet.Animation.extend({
start: function () {
this.$target.carousel({interval: 10000});
},
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index e296850e54b..ebbe0bf5dd8 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -350,7 +350,18 @@
website.snippet.start_animation();
self.create_overlay($target);
- $target.data("snippet-editor").drop_and_build_snippet($target);
+ if ($snippet.data("snippet-editor")) {
+ $target.data("snippet-editor").drop_and_build_snippet($target);
+ }
+
+ $target.find("[data-snippet-id]").each(function () {
+ var $snippet = $(this);
+ var snippet_id = $snippet.data("data-snippet-id");
+ self.create_overlay($snippet);
+ if ($snippet.data("snippet-editor")) {
+ $snippet.data("snippet-editor").drop_and_build_snippet($snippet);
+ }
+ });
} else {
$target = $(this).data('target');
@@ -837,15 +848,6 @@
setTimeout(function () {self.parent.create_overlay(self.$target);},0);
},
- _clone: function () {
- var self = this;
- this.$overlay.on('click', '.oe_snippet_clone', function () {
- var $clone = self.$target.clone(false);
- self.$target.after($clone);
- return false;
- });
- },
-
load_style_options: function () {
var self = this;
var $styles = this.$overlay.find('.oe_options');
@@ -887,16 +889,24 @@
*/
start: function () {
var self = this;
- this.$overlay.on('click', '.oe_snippet_remove', function () {
- self.onBlur();
- var index = _.indexOf(self.parent.snippets, self.$target.get(0));
- delete self.parent.snippets[index];
- self.$target.remove();
- self.$overlay.remove();
- return false;
- });
+ this.$overlay.on('click', '.oe_snippet_clone', _.bind(this.on_clone, this));
+ this.$overlay.on('click', '.oe_snippet_remove', _.bind(this.on_remove, this));
this._drag_and_drop();
- this._clone();
+ },
+
+ on_clone: function () {
+ var $clone = this.$target.clone(false);
+ this.$target.after($clone);
+ return false;
+ },
+
+ on_remove: function () {
+ this.onBlur();
+ var index = _.indexOf(this.parent.snippets, this.$target.get(0));
+ delete this.parent.snippets[index];
+ this.$target.remove();
+ this.$overlay.remove();
+ return false;
},
/*
@@ -925,7 +935,7 @@
* function called just before save vue
*/
clean_for_save: function () {
-
+ this.$target.find(".row:empty").remove();
},
});
@@ -1059,7 +1069,6 @@
return this.grid;
},
-
_drag_and_drop_after_insert_dropzone: function(){
var self = this;
var $zones = $(".row:has(> .oe_drop_zone)").each(function () {
@@ -1088,7 +1097,24 @@
this.$target.addClass("col-md-offset-" + this.$target.prevAll(".oe_drop_to_remove").length);
this._super();
},
-
+ onFocus : function () {
+ this._super();
+ this.$overlay.find('.oe_snippet_remove').toggleClass("hidden", !this.$target.siblings().length);
+ },
+ on_clone: function () {
+ var $clone = this.$target.clone(false);
+ var _class = $clone.attr("class").replace(/\s*(col-md-|col-lg-offset-|col-md-offset-)([0-9-]+)/g, '');
+ _class += ' col-md-1';
+ $clone.attr("class", _class);
+ this.$target.after($clone);
+ return false;
+ },
+ on_remove: function () {
+ if (!this.$target.siblings().length){
+ return false;
+ }
+ return this._super();
+ },
on_resize: function (compass, beginClass, current) {
if (compass !== 'w')
return;
@@ -1113,12 +1139,12 @@
}
},
});
-
- website.snippet.editorRegistry.carousel = website.snippet.editorRegistry.resize.extend({
+
+ website.snippet.editorRegistry.slider = website.snippet.editorRegistry.resize.extend({
drop_and_build_snippet: function() {
var id = 0;
- $("body .carousel").each(function () {
- var _id = +$(this).attr("id").replace(/^myCarousel/, '');
+ $(".carousel").each(function () {
+ var _id = +$(this).attr("id").replace(/^[^a-z]+/i, '');
if (id <= _id) {
id = _id + 1;
}
@@ -1126,44 +1152,108 @@
this.id = "myCarousel" + id;
this.$target.attr("id", this.id);
this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);
- this.$target.find("[data-target='#myCarousel']").attr("data-target", "#myCarousel" + id);
+ this.$target.find("[data-target]").attr("data-target", "#myCarousel" + id);
this.rebind_event();
},
- onFocus: function () {
- this._super();
+ // rebind event to active carousel on edit mode
+ rebind_event: function () {
+ var self = this;
+ this.$target.find('.carousel-indicators [data-target]').off('click').on('click', function () {
+ self.$target.carousel(+$(this).data('slide-to')); });
+
+ this.$target.attr('contentEditable', 'false')
+ .find('.oe_structure, blockquote').attr('contentEditable', 'true');
+
this.$target.carousel('pause');
},
- onBlur: function () {
- this._super();
- this.$target.carousel('cycle');
- },
clean_for_save: function () {
this._super();
this.$target.find(".item").removeClass("next prev left right");
if(!this.$target.find(".item.active").length) {
this.$target.find(".item:first").addClass("active");
}
- this.$target.css("background-image", "");
- console.log(this._class);
- this.$target.removeClass(this._class);
this.$target.removeAttr('contentEditable')
- .find('.content, .carousel-image img')
- .removeAttr('contentEditable');
+ .find('*').removeAttr('contentEditable');
+ },
+ onFocus: function () {
+ this._super();
+ this.$target.carousel('pause');
+ },
+ onBlur: function () {
+ this._super();
+ this.$target.carousel('cycle');
},
start : function () {
- var self = this;
this._super();
-
this.id = this.$target.attr("id");
-
this.$inner = this.$target.find('.carousel-inner');
this.$indicators = this.$target.find('.carousel-indicators');
- this.$editor.find(".js_add").on('click', _.bind(this.on_add, this));
- this.$editor.find(".js_remove").on('click', _.bind(this.on_remove, this));
+ this.$editor.find(".js_add").on('click', _.bind(this.on_add_slide, this));
+ this.$editor.find(".js_remove").on('click', _.bind(this.on_remove_slide, this));
this.rebind_event();
+ },
+ on_add_slide: function () {
+ var self = this;
+ var cycle = this.$inner.find('.item').length;
+ var $active = this.$inner.find('.item.active, .item.prev, .item.next').first();
+ var index = $active.index();
+ 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.$el.find(".item.active").clone();
+
+ // insert
+ $clone.removeClass('active').insertAfter($active);
+ setTimeout(function() {
+ self.$target.carousel().carousel(++index);
+ self.rebind_event();
+ },0);
+ return $clone;
+ },
+ on_remove_slide: function () {
+ if (this.remove_process) {
+ return;
+ }
+ var self = this;
+ var new_index = 0;
+ var cycle = this.$inner.find('.item').length - 1;
+ var index = this.$inner.find('.item.active').index();
+
+ if (cycle > 0) {
+ this.remove_process = true;
+ var $el = this.$inner.find('.item.active');
+ self.$target.on('slid.bs.carousel', function (event) {
+ $el.remove();
+ self.$indicators.find("li:last").remove();
+ self.$target.off('slid.bs.carousel');
+ self.rebind_event();
+ self.remove_process = false;
+ if (cycle == 1) {
+ self.on_remove_slide(event);
+ }
+ });
+ setTimeout(function () {
+ self.$target.carousel( index > 0 ? --index : cycle );
+ }, 500);
+ } else {
+ this.$target.find('.carousel-control, .carousel-indicators').addClass("hidden");
+ }
+ },
+ });
+
+ website.snippet.editorRegistry.carousel = website.snippet.editorRegistry.slider.extend({
+ clean_for_save: function () {
+ 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;
+ this._super();
// set background and prepare to clean for save
var add_class = function (c){
@@ -1196,27 +1286,8 @@
});
this.$target.trigger('slid');
},
- // rebind event to active carousel on edit mode
- rebind_event: function () {
- var self = this;
- this.$target.off('click').on('click', '.carousel-control', function () {
- self.$target.carousel($(this).data('slide')); });
- this.$target.off('click').on('click', '.carousel-indicators [data-target]', function () {
- self.$target.carousel(+$(this).data('slide-to')); });
-
- this.$target.attr('contentEditable', 'false')
- .find('.content, .carousel-image img')
- .attr('contentEditable', 'true');
- },
- on_add: function (e) {
- e.preventDefault();
- var cycle = this.$inner.find('.item').length;
- var $active = this.$inner.find('.item.active, .item.prev, .item.next').first();
- var index = $active.index();
- 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.$el.find(".item.active").clone();
+ on_add_slide: function () {
+ var $clone = this._super();
// choose an other background
var $styles = this.$target.data("snippet-style-ids").background.$el.find("li[data-class]:not(.oe_custom_bg)");
@@ -1225,40 +1296,14 @@
$clone.css("background-image", $select.data("src") ? "url('"+ $select.data("src") +"')" : "");
$clone.addClass($select.data("class") || "");
- // insert
- $clone.removeClass('active').insertAfter($active);
- this.$target.carousel().carousel(++index);
- this.rebind_event();
+ return $clone;
},
- on_remove: function (e) {
- e.preventDefault();
- if (this.remove_process) {
- return;
- }
+ // rebind event to active carousel on edit mode
+ rebind_event: function () {
var self = this;
- var new_index = 0;
- var cycle = this.$inner.find('.item').length - 1;
- var index = this.$inner.find('.item.active').index();
-
- if (cycle > 0) {
- this.remove_process = true;
- var $el = this.$inner.find('.item.active');
- self.$target.on('slid.bs.carousel', function (event) {
- $el.remove();
- self.$indicators.find("li:last").remove();
- self.$target.off('slid.bs.carousel');
- self.rebind_event();
- self.remove_process = false;
- if (cycle == 1) {
- self.on_remove(e);
- }
- });
- setTimeout(function () {
- self.$target.carousel( index > 0 ? --index : cycle );
- }, 500);
- } else {
- this.$target.find('.carousel-control, .carousel-indicators').addClass("hidden");
- }
+ this.$target.find('.carousel-control').off('click').on('click', function () {
+ self.$target.carousel( $(this).data('slide')); });
+ this._super();
},
});
@@ -1300,7 +1345,8 @@
* Don't need to add data-snippet-id="..." into the views
*/
- website.snippet.selector.push([".row > div[class*='col-md-']", 'colmd']);
+ website.snippet.selector.push([".row > [class*='col-md-']", 'colmd']);
website.snippet.selector.push(['hr', 'hr']);
+ website.snippet.selector.push(['blockquote', 'quote']);
})();
diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js
index 3c812b00268..0632eab3cc9 100644
--- a/addons/website/static/src/js/website.tour.banner.js
+++ b/addons/website/static/src/js/website.tour.banner.js
@@ -76,7 +76,7 @@
element: '.oe_overlay_options .oe_options',
placement: 'left',
title: "Customize the banner",
- content: "You can customize characteristic of any blocks through the Customize menu. For instance, change the background of the banner.",
+ content: "Customize any block through this menu. Try to change the background of the banner.",
template: self.popover({ next: "Continue" }),
},
{
diff --git a/addons/website/static/src/xml/website.backend.xml b/addons/website/static/src/xml/website.backend.xml
new file mode 100644
index 00000000000..e7f83c23740
--- /dev/null
+++ b/addons/website/static/src/xml/website.backend.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vim:fdl=1:
+-->
+<templates id="template" xml:space="preserve">
+
+ <t t-name="WidgetWebsiteButton">
+
+ <div class="btn-group oe_WidgetWebsiteButton">
+ <button class="btn btn-success">
+ <span class="oe_unpublish">Not Published</span>
+ <span class="oe_publish">Published</span>
+ </button>
+ <button id="dopprod-6" data-toggle="dropdown" type="button" class="btn btn-default dropdown-toggle">
+ <span class="caret"></span>
+ </button>
+ <ul role="menu" class="dropdown-menu" aria-labelledby="dopprod-6">
+ <li>
+ <a href="#" title="View in frontend">Website</a>
+ </li>
+ </ul>
+ </div>
+
+ </t>
+
+</templates>
diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml
index 17f8dbd5d89..4ff2384d222 100644
--- a/addons/website/static/src/xml/website.xml
+++ b/addons/website/static/src/xml/website.xml
@@ -36,7 +36,7 @@
<!-- filled in JS -->
</ul>
</li>
- <li class="dropdown">
+ <li class="dropdown js_hide_on_translate">
<a id="help-menu-button" class="dropdown-toggle" data-toggle="dropdown" href="#">Help <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" id="help-menu">
<!-- filled in JS -->