[MERGE] Sync with website-al

bzr revid: tde@openerp.com-20131120140414-zf1qiepxueyrhn4j
This commit is contained in:
Thibault Delavallée
2013-11-20 15:04:14 +01:00
26 changed files with 591 additions and 271 deletions
+25
View File
@@ -0,0 +1,25 @@
@import "compass/css3"
@import "compass/css3/user-interface"
@import "compass/css3/transition"
//smartphones, iPhone, portrait 480x320 phones
$smart_phone: 320px
//portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide.*/
$small-tablet: 481px
//portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones
$portrait-tablet: 641px
//tablet, landscape iPad, lo-res laptops ands desktops
$tablet: 961px
//big landscape tablets, laptops, and desktops
$desktop: 1025px
@mixin editor-font
font-size: 14px
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace
line-height: normal
@mixin selection()
::-moz-selection
@content
::selection
@content
+4 -1
View File
@@ -1,4 +1,3 @@
@charset "utf-8";
/* ---- CKEditor Minimal Reset ---- */
.navbar.navbar-inverse .cke_chrome {
border: none;
@@ -380,6 +379,10 @@ ul.oe_menu_editor .disclose {
margin: 0px -24px !important;
}
.oe_drop_zone.oe_insert.oe_overlay {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-ms-border-radius: 3px;
-o-border-radius: 3px;
border-radius: 3px;
background: rgba(153, 0, 255, 0.5);
}
+2 -19
View File
@@ -1,19 +1,6 @@
@charset "utf-8"
@import "compass/css3"
@import "compass/css3/user-interface"
@import "compass/css3/transition"
//smartphones, iPhone, portrait 480x320 phones
$smart_phone: 320px
//portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide.*/
$small-tablet: 481px
//portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones
$portrait-tablet: 641px
//tablet, landscape iPad, lo-res laptops ands desktops
$tablet: 961px
//big landscape tablets, laptops, and desktops
$desktop: 1025px
@import "common"
/* ---- CKEditor Minimal Reset ---- */
@@ -303,7 +290,7 @@ ul.oe_menu_editor
position: relative
margin: 0px -24px !important
&.oe_overlay
border-radius: 3px
+border-radius(3px)
//@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.1) ,rgba(255,255,255,.1) 35px, rgba(0,0,0,.1) 35px, rgba(0,0,0,.1) 75px))
//background-size: 100px 100px
background: rgba(153, 0, 255,.5)
@@ -507,10 +494,6 @@ $editorbar_height: 30px
// TODO Fix => might break with themes
$navbar_height: 51px
@mixin editor-font
font-size: 14px
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace
line-height: normal
.oe_ace_view_editor
position: fixed
top: $navbar_height
+94 -65
View File
@@ -1,4 +1,3 @@
@charset "utf-8";
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
*
* css for editor buttons, openerp widget included in the website and other
@@ -192,6 +191,8 @@ h1.text-muted, h2.text-muted, h3.text-muted {
/* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */
html, body, #wrapwrap {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 100%;
}
@@ -257,6 +258,78 @@ footer {
margin-bottom: 0px;
}
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
.nav-hierarchy {
padding-left: 16px;
}
#themes-list .well {
padding: 0 0 20px 0;
}
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal {
overflow: hidden;
overflow-y: hidden;
}
ul.nav-stacked > li > a {
padding: 2px 15px;
}
#customize-menu .dropdown-header {
text-transform: uppercase;
}
/* ---- PUBLISH ---- */
.css_unpublish, .css_publish {
display: none;
}
.css_published .css_unpublish, .css_unpublished .css_publish {
display: block;
}
[data-publish='off'] {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50);
opacity: 0.5;
}
/* ---- END of PUBLISH ---- */
::-moz-selection {
background: rgba(150, 150, 220, 0.3);
}
::selection {
background: rgba(150, 150, 220, 0.3);
}
.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;
}
/* ---- SNIPPETS --- */
.carousel-inner .item {
height: 100%;
background-size: 100%;
@@ -331,23 +404,6 @@ footer {
right: 10px;
}
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
.dark {
background: #eff8f8;
background: rgba(100, 200, 200, 0.14);
-webkit-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
-moz-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
}
.nav-hierarchy {
padding-left: 16px;
}
#themes-list .well {
padding: 0 0 20px 0;
}
/* Parallax Theme */
.parallax_quote {
background: url("/website/static/src/img/parallax/quote.png") center center no-repeat fixed;
@@ -374,59 +430,32 @@ footer {
height: 450px;
}
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal {
overflow: hidden;
overflow-y: hidden;
/* Background */
.oe_dark {
background: #eff8f8;
background: rgba(100, 200, 200, 0.14);
background-image: none !important;
-webkit-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
-moz-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
}
ul.nav-stacked > li > a {
padding: 2px 15px;
.oe_black {
background-color: rgba(0, 0, 0, 0.9);
background-image: none !important;
}
#customize-menu .dropdown-header {
text-transform: uppercase;
.oe_green {
background-color: rgba(0, 128, 0, 0.8);
background-image: none !important;
}
/* ---- PUBLISH ---- */
.css_unpublish, .css_publish {
display: none;
.oe_red {
background-color: rgba(255, 0, 0, 0.8);
background-image: none !important;
}
.css_published .css_unpublish, .css_unpublished .css_publish {
display: block;
}
[data-publish='off'] {
opacity: 0.5;
}
/* ---- END of PUBLISH ---- */
::selection {
background: rgba(150, 150, 220, 0.3);
}
.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;
.oe_custom_bg {
height: 100%;
background-size: 100%;
}
+80 -69
View File
@@ -1,5 +1,7 @@
@charset "utf-8"
@import "common"
/*
* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
*
@@ -103,14 +105,8 @@
/* Extra Styles */
img.shadow
-webkit-border-radius: 3px
-moz-border-radius: 3px
-ms-border-radius: 3px
-o-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)
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2)
+border-radius(3px)
+box-shadow(0px 3px 8px rgba(0, 0, 0, 0.2))
margin: 0 auto
h1.text-muted, h2.text-muted, h3.text-muted
@@ -124,7 +120,7 @@ h1.text-muted, h2.text-muted, h3.text-muted
/* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */
html,body, #wrapwrap
box-sizing: border-box
+box-sizing(border-box)
height: 100%
#wrapwrap
@@ -186,6 +182,62 @@ footer
// .nav > li a
// display: block
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
.nav-hierarchy
padding-left: 16px
#themes-list .well
padding: 0 0 20px 0
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal
overflow: hidden
overflow-y: hidden
ul.nav-stacked > li > a
padding: 2px 15px
#customize-menu .dropdown-header
text-transform: uppercase
/* ---- PUBLISH ---- */
.css_unpublish, .css_publish
display: none
.css_published .css_unpublish, .css_unpublished .css_publish
display: block
[data-publish='off']
+opacity(0.5)
/* ---- END of PUBLISH ---- */
@include selection
background: rgba(150, 150, 220, 0.3)
.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
/* ---- SNIPPETS --- */
.carousel-inner .item
height: 100%
background-size: 100%
@@ -249,20 +301,6 @@ footer
&.right span
right: 10px
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
.dark
background: #eff8f8
background: rgba(100, 200, 200, 0.14)
-webkit-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset
-moz-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset
box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset
.nav-hierarchy
padding-left: 16px
#themes-list .well
padding: 0 0 20px 0
/* Parallax Theme */
@@ -284,50 +322,23 @@ footer
height: 300px
&.oe_big
height: 450px
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal
overflow: hidden
overflow-y: hidden
ul.nav-stacked > li > a
padding: 2px 15px
#customize-menu .dropdown-header
text-transform: uppercase
/* ---- PUBLISH ---- */
.css_unpublish, .css_publish
display: none
.css_published .css_unpublish, .css_unpublished .css_publish
display: block
[data-publish='off']
opacity: 0.5
/* ---- END of PUBLISH ---- */
::selection
background: rgba(150, 150, 220, 0.3)
.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
/* Background */
.oe_dark
background: #eff8f8
background: rgba(100, 200, 200, 0.14)
background-image: none !important
+box-shadow(0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset)
.oe_black
background-color: rgba(0, 0, 0, 0.9)
background-image: none !important
.oe_green
background-color: rgba(0, 128, 0, 0.8)
background-image: none !important
.oe_red
background-color: rgba(255, 0, 0, 0.8)
background-image: none !important
.oe_custom_bg
height: 100%
background-size: 100%
@@ -834,6 +834,7 @@
events: {
'hidden.bs.modal': 'destroy',
'click button.save': 'save',
'click button[data-dismiss="modal"]': 'cancel',
},
init: function (editor) {
this._super();
@@ -847,6 +848,8 @@
save: function () {
this.close();
},
cancel: function () {
},
close: function () {
this.$el.modal('hide');
},
@@ -1127,6 +1130,9 @@
});
return this._super();
},
cancel: function () {
this.trigger('cancel');
},
/**
* Sets the provided image url as the dialog's value-to-save and
@@ -151,11 +151,12 @@
self.style_templates[snipped_id] = {
'snipped-id' : snipped_id,
'selector': $style.data('selector'),
'class': $style.find(".oe_snippet_class").text(),
'label': $style.find(".oe_snippet_label").text()
'class': $style.data("class"),
'label': $style.find(".oe_snippet_label").text(),
'group': $style.find(".oe_snippet_group").text()
};
});
$styles.remove();
$styles.addClass("hidden");
self.$snippets = $html.find(".tab-content > div > div").addClass("oe_snippet");
self.$el.append($html);
@@ -530,11 +531,11 @@
website.snippet.editorRegistry = {};
website.snippet.Editor = openerp.Class.extend({
init: function (parent, dom) {
init: function (parent, dom, force_snippet_id) {
this.parent = parent;
this.$target = $(dom);
this.$overlay = this.$target.data('overlay');
this.snippet_id = this.$target.data("snippet-id");
this.snippet_id = force_snippet_id || this.$target.data("snippet-id");
this._readXMLData();
this.load_style_options();
this.get_parent_block();
@@ -651,6 +652,10 @@
},
load_style_options: function () {
if (this.$target.data('snippetStyles')) {
return;
}
var self = this;
var $styles = this.$overlay.find('.oe_options');
var $ul = $styles.find('ul:first');
@@ -660,30 +665,77 @@
}
var $li = $("<li class='oe_style'/>").data(val);
$li.append($('<a/>').text(val.label));
$ul.append($li);
if (self.$target.hasClass( "oe_snippet_" + $li.data("snipped-id") )) {
if (self.$target.hasClass( val.class )) {
$li.addClass("active");
}
$styles.removeClass("hidden");
});
$styles.on('click', 'li.oe_style a', _.bind(this.change_style, this));
},
change_style: function (event) {
var $li = $(event.currentTarget).parent();
var snipped_id = $li.data("snipped-id");
var active = $li.hasClass("active");
if (website.snippet.editorRegistry[snipped_id]) {
var snippet = new website.snippet.editorRegistry[snipped_id](this, this.$target);
snippet.drop_and_build_snippet(this.$target);
if (val.group.length) {
var $group = $ul.find("li.dropdown-submenu").filter(function () {
return $("a:first", this).text() === val.group;
});
if (!$group.length) {
$group = $('<li class="dropdown-submenu"><a href="#" tabindex="-1"/><ul class="dropdown-menu"/></li>');
$group.find("a").text(val.group);
$ul.append($group);
}
$group.find("ul").append($li);
} else {
$ul.append($li);
}
});
if ($ul.find("li").length) {
$styles.removeClass("hidden");
// il they are only one group, display in flat mode
var $groups = $ul.find("li.dropdown-submenu");
if ($groups.length === 1) {
$ul.append($groups.find("ul li"));
$groups.remove();
}
}
var _class = "oe_snippet_" + snipped_id + " " + ($li.data("class") || "");
if (active) {
this.$target.removeClass(_class);
} else {
this.$target.addClass(_class);
}
$li.toggleClass("active");
this.$target.data('snippetStyles', $styles);
this.change_style();
},
change_style: function () {
var self = this;
this.$overlay.find('.oe_options li.oe_style a')
.on('click', function (event) {
var $li = $(event.currentTarget).parent();
var active = $li.hasClass("active");
if ($li.hasClass("active")) {
self.$target.removeClass($li.data('class'));
} else {
var $prev = $li.parent("ul").find("li.active").removeClass("active");
if ($prev.length) {
self.$target.removeClass($prev.data('class'));
// active snippet after remove class
if (website.snippet.editorRegistry[$prev.data("snipped-id")]) {
new website.snippet.editorRegistry[$prev.data("snipped-id")](self.parent, self.$target, $prev.data("snipped-id"))
.drop_and_build_snippet(self.$target);
}
}
self.$target.addClass($li.data('class'));
}
// active snippet after add or remove class
if (website.snippet.editorRegistry[$li.data("snipped-id")]) {
new website.snippet.editorRegistry[$li.data("snipped-id")](self.parent, self.$target, $li.data("snipped-id"))
.drop_and_build_snippet(self.$target);
}
$li.toggleClass("active");
})
.on('mouseover', function (event) {
self.$target.removeClass(self.$overlay.find('.oe_options li.oe_style.active').data('class') || "");
self.$target.addClass($(event.currentTarget).parent().data('class') || "");
})
.on('mouseout', function (event) {
self.$target.removeClass($(event.currentTarget).parent().data('class') || "");
self.$target.addClass(self.$overlay.find('.oe_options li.oe_style.active').data('class') || "");
});
},
get_parent_block: function () {
@@ -792,7 +844,7 @@
set_options_background: function (bg, ul_options) {
var $ul = this.$editor.find(ul_options);
var bg_value = (typeof bg === 'string' ? this.$target.find(bg) : $(bg)).css("background-image").replace(/url\(['"]*|['"]*\)/g, "");
var bg_value = (typeof bg === 'string' ? this.$target.find(bg) : $(bg)).css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, "");
// select in ul options
$ul.find("li").removeClass("active");
@@ -1231,6 +1283,32 @@
}
});
website.snippet.editorRegistry.custom_background = website.snippet.Editor.extend({
drop_and_build_snippet: function() {
var self = this;
var active = this.$target.hasClass(this.$el.data("class"));
if (active) {
var bg_value = this.$target.css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, "");
var editor = new website.editor.ImageDialog();
editor.on('start', self, function (o) {o.url = bg_value;});
editor.on('save', self, function (o) {
self.$target.css("background-image", "url(" + o.url + ")");
});
editor.on('cancel', self, function () {
if (bg_value === "") {
self.$target.data("snippetStyles").find(".oe_style").filter(function () {
return $(this).data('snipped-id') === 'custom_background';
}).removeClass('active');
self.$target.removeClass(self.$el.data("class"));
}
});
editor.appendTo($('body'));
} else {
this.$target.css("background-image", "");
}
}
});
/*
* data-snippet-id automatically setted
* Don't need to add data-snippet-id="..." into the views
@@ -5,13 +5,19 @@
var render = website.tour.render;
website.EditorBannerTour = website.EditorTour.extend({
website.EditorBar.include({
start: function () {
this.registerTour(new website.AddBannerTour(this));
return this._super();
},
});
website.AddBannerTour = website.Tour.extend({
id: 'banner-tutorial',
name: "Insert a banner",
startPath: '/page/website.homepage',
init: function (editor) {
var self = this;
var $body = $(document.body);
self.steps = [
{
stepId: 'welcome',
@@ -55,6 +61,7 @@
content: "Drag the Banner block and drop it in your page.",
template: render('website.tour_popover'),
onShow: function () {
var $body = $(document.body);
function beginDrag () {
$('.popover.tour').remove();
function goToNextStep () {
@@ -65,7 +72,6 @@
$body.off('mousedown', beginDrag);
$body.on('mouseup', goToNextStep);
}
$body.on('mousedown', beginDrag);
},
},
@@ -127,21 +133,8 @@
];
return this._super();
},
startOfPart2: function () {
var currentStepIndex = this.currentStepIndex();
var secondPartIndex = this.indexOfStep('part-2');
var showTutorialsIndex = this.indexOfStep('show-tutorials');
return (currentStepIndex === secondPartIndex || currentStepIndex === showTutorialsIndex) && !this.tour.ended();
},
continueTour: function () {
return this.startOfPart2() || this._super();
},
});
website.EditorBar.include({
start: function () {
this.registerTour(new website.EditorBannerTour(this));
return this._super();
return (this.isCurrentStep('part-2') || this.isCurrentStep('show-tutorials')) && !this.tour.ended();
},
});
@@ -5,12 +5,18 @@
var render = website.tour.render;
website.InstallAppTour = website.EditorTour.extend({
website.EditorBar.include({
start: function () {
this.registerTour(new website.InstallAppTour(this));
return this._super();
},
});
website.InstallAppTour = website.Tour.extend({
id: 'install-app',
name: "Install a new App",
init: function (editor) {
var self = this;
var $body = $(document.body);
self.steps = [
{
stepId: 'welcome-install-app',
@@ -47,11 +53,4 @@
},
});
website.EditorBar.include({
start: function () {
this.registerTour(new website.InstallAppTour(this));
return this._super();
},
});
}());
+9 -5
View File
@@ -10,7 +10,7 @@
}
};
website.EditorTour = openerp.Class.extend({
website.Tour = openerp.Class.extend({
tour: undefined,
steps: [],
tourStorage: window.localStorage,
@@ -32,13 +32,10 @@
$('.popover.tour').remove();
},
start: function () {
if (this.canResume()) {
if (this.continueTour() || ((this.currentStepIndex() === 0) && !this.tour.ended())) {
this.tour.start();
}
},
canResume: function () {
return this.continueTour() || ((this.currentStepIndex() === 0) && !this.tour.ended());
},
currentStepIndex: function () {
var index = this.tourStorage.getItem(this.id+'_current_step') || 0;
return parseInt(index, 10);
@@ -52,6 +49,9 @@
});
return index;
},
isCurrentStep: function (stepId) {
return this.currentStepIndex() === this.indexOfStep(stepId);
},
movetoStep: function (stepId) {
$('.popover.tour').remove();
var index = this.indexOfStep(stepId);
@@ -83,6 +83,10 @@
var urlTrigger = this.id + "=true";
return url.search.indexOf(urlTrigger) >= 0;
},
testUrl: function (pattern) {
var url = new website.UrlParser(window.location.href);
return pattern.test(url.pathname+url.search);
},
});
website.UrlParser = openerp.Class.extend({
@@ -5,12 +5,18 @@
var render = website.tour.render;
website.EditorBuilderTour = website.EditorTour.extend({
website.EditorBar.include({
start: function () {
this.registerTour(new website.EditorBuilderTour(this));
return this._super();
},
});
website.EditorBuilderTour = website.Tour.extend({
id: 'menu-editor',
name: "Add a new page",
init: function (editor) {
var self = this;
var $body = $(document.body);
self.steps = [
{
stepId: 'welcome-menu-editor',
@@ -98,11 +104,4 @@
},
});
website.EditorBar.include({
start: function () {
this.registerTour(new website.EditorBuilderTour(this));
return this._super();
},
});
}());
+21 -7
View File
@@ -236,7 +236,7 @@
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_big_picture.png"/>
<span class="oe_snippet_thumbnail_title">Big Picture</span>
</div>
<section class="oe_snippet_body dark mt16 mb16">
<section class="oe_snippet_body oe_dark mt16 mb16">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt32 mb32">
@@ -555,7 +555,7 @@
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Button</span>
</div>
<section class="oe_snippet_body oe_snippet_darken dark">
<section class="oe_snippet_body oe_snippet_darken oe_dark">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt16 mb16">
@@ -792,12 +792,26 @@
</div>
<div id="snippet_styles" class="hidden">
<div data-snippet-id='darken' data-selector='section'>
<div class='oe_snippet_label'>Enlight Background</div>
<div class='oe_snippet_class'>dark</div>
<div data-snippet-id='darken' data-selector='section' data-class="oe_dark">
<div class='oe_snippet_label'>Darken</div>
<div class='oe_snippet_group'>Background</div>
</div>
<div data-snippet-id='green' data-selector='section' data-class="oe_green">
<div class='oe_snippet_label'>Green</div>
<div class='oe_snippet_group'>Background</div>
</div>
<div data-snippet-id='red' data-selector='section' data-class="oe_red">
<div class='oe_snippet_label'>Red</div>
<div class='oe_snippet_group'>Background</div>
</div>
<div data-snippet-id='black' data-selector='section' data-class="oe_black">
<div class='oe_snippet_label'>Black</div>
<div class='oe_snippet_group'>Background</div>
</div>
<div data-snippet-id='custom_background' data-selector='section' data-class="oe_custom_bg">
<div class='oe_snippet_label'>Custom Picture...</div>
<div class='oe_snippet_group'>Background</div>
</div>
</div>
</div>
+2 -2
View File
@@ -38,7 +38,7 @@ class WebsiteBlog(http.Controller):
def nav_list(self):
blog_post_obj = request.registry['blog.post']
groups = blog_post_obj.read_group(request.cr, request.uid, [], ['name', 'create_date'],
groups = blog_post_obj.read_group(request.cr, request.uid, [], ['name', 'create_date'],
groupby="create_date", orderby="create_date asc", context=request.context)
for group in groups:
group['date'] = "%s_%s" % (group['__domain'][0][2], group['__domain'][1][2])
@@ -76,7 +76,7 @@ class WebsiteBlog(http.Controller):
'/blog/cat/<model("blog.category"):category>/tag/<model("blog.tag"):tag>/date/<string(length=21):date>/',
'/blog/cat/<model("blog.category"):category>/tag/<model("blog.tag"):tag>/date/<string(length=21):date>/page/<int:page>/',
], type='http', auth="public", multilang=True)
def blog(self, category=None, tag=None, date=None, page=1):
def blog(self, category=None, tag=None, date=None, page=1, **opt):
""" Prepare all values to display the blog.
:param category: category currently browsed.
@@ -21,7 +21,7 @@
<record id="action_open_website" model="ir.actions.act_url">
<field name="name">Website Blogs</field>
<field name="target">self</field>
<field name="url" eval="'/blog/cat/'+str(ref('website_blog.blog_category_1'))"/>
<field name="url" eval="'/blog/cat/'+str(ref('website_blog.blog_category_1'))+'/?blog-tutorial=true'"/>
</record>
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="action_open_website"/>
@@ -73,7 +73,7 @@
</div>
</div>
</section>
<section class="dark mt16 mb16" data-snippet-id='big-picture'>
<section class="oe_dark mt16 mb16" data-snippet-id='big-picture'>
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt32 mb32">
@@ -0,0 +1,91 @@
(function () {
'use strict';
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.BlogTour(this));
return this._super();
},
});
website.BlogTour = website.Tour.extend({
id: 'blog-tutorial',
name: "Create a blog post",
startPath: '/blog/cat/1/',
init: function (editor) {
var self = this;
self.steps = [
{
stepId: 'welcome-blog',
orphan: true,
backdrop: true,
title: "Blog",
content: "We will show how to create a new blog post.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
element: '#content-menu-button',
placement: 'left',
reflex: true,
title: "Edit the content",
content: "Click here to add content to your site.",
template: render('website.tour_popover'),
},
{
stepId: 'new-post-entry',
element: 'a[data-action=new_blog_post]',
placement: 'left',
title: "New blog post",
content: "Click here to create a blog post.",
template: render('website.tour_popover'),
onShow: function () {
$(document).one('shown.bs.modal', function () {
$('.modal button.btn-primary').click(function () {
self.movetoStep('post-page');
});
self.movetoStep('choose-category');
});
},
},
{
stepId: 'choose-category',
element: '.modal select',
placement: 'right',
title: "Choose the post category",
content: "Select the 'News' category and click 'Continue'.",
template: render('website.tour_popover'),
},
{
stepId: 'post-page',
orphan: true,
backdrop: true,
title: "New blog post created",
content: "You just created a new blog post. We are now going to edit it.",
template: render('website.tour_popover', { next: "OK" }),
},
{
stepId: 'add-block',
element: 'button[data-action=snippet]',
placement: 'bottom',
reflex: true,
title: "Layout your blog post",
content: "Insert blocks like text-image to layout the body of your blog post.",
template: render('website.tour_popover'),
},
];
return this._super();
},
continueTour: function () {
return this.isCurrentStep('post-page') && !this.tour.ended();
},
isTriggerUrl: function () {
return (this.continueTour() && this.testUrl(/^\/blog\/[0-9]+\/\?enable_editor=1/)) || this._super();
},
});
}());
@@ -4,6 +4,7 @@
<template id="website_blog_script" inherit_id="website.layout" name="Website Blog script">
<xpath expr="//t[@id='editable_scripts_hook']" position="inside">
<script type="text/javascript" src="/website_blog/static/src/js/website_blog.editor.js" t-ignore="true"></script>
<script type="text/javascript" src="/website_blog/static/src/js/website.tour.blog.js" t-ignore="true"></script>
</xpath>
</template>
@@ -59,7 +60,7 @@
</h4>
<div class="text-muted">
<span class="icon-calendar"> <span t-field="blog.create_date"/> &amp;nbsp;</span>
<span class="icon-folder-open"> In
<span class="icon-folder-open"> In
<a t-href="/blog/cat/#{blog.category_id.id}">
<span t-field="blog.category_id"/>
</a> &amp;nbsp;
+2 -2
View File
@@ -11,14 +11,14 @@
<record id="action_open_website" model="ir.actions.act_url">
<field name="name">Website Home</field>
<field name="target">self</field>
<field name="url">/event</field>
<field name="url">/event?event-tutorial=true</field>
</record>
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="action_open_website"/>
<field name="state">open</field>
</record>
<record id="view_event_twitter_form" model="ir.ui.view">
<field name="name">view_event_twitter_form</field>
<field name="model">event.event</field>
+3 -3
View File
@@ -142,7 +142,7 @@
</div>
<div class="container dark">
<div class="container oe_dark">
<div class="row">
<div class="col-md-12" data-snippet-id="colmd">
<h1 class="text-center">A great content...</h1>
@@ -305,7 +305,7 @@
</div>
<div class="container dark">
<div class="container oe_dark">
<div class="row">
<div class="col-md-12" data-snippet-id="colmd">
<h1 class="text-center">A great content...</h1>
@@ -480,7 +480,7 @@
</div>
<div class="container dark">
<div class="container oe_dark">
<div class="row">
<div class="col-md-12" data-snippet-id="colmd">
<h1 class="text-center">A great content...</h1>
@@ -0,0 +1,91 @@
(function () {
'use strict';
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.EventTour(this));
return this._super();
},
});
website.EventTour = website.Tour.extend({
id: 'event-tutorial',
name: "Create an event",
startPath: '/event',
init: function (editor) {
var self = this;
self.steps = [
{
stepId: 'welcome-event',
orphan: true,
backdrop: true,
title: "Event",
content: "We will show how to create a new event.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
element: '#content-menu-button',
placement: 'left',
reflex: true,
title: "Edit the content",
content: "Click here to add content to your site.",
template: render('website.tour_popover'),
},
{
stepId: 'new-post-entry',
element: 'a[data-action=new_event]',
placement: 'left',
title: "New event",
content: "Click here to create an event.",
template: render('website.tour_popover'),
onShow: function () {
$(document).one('shown.bs.modal', function () {
$('.modal button.btn-primary').click(function () {
self.movetoStep('event-page');
});
self.movetoStep('choose-category');
});
},
},
{
stepId: 'choose-name',
element: '.modal input',
placement: 'right',
title: "Choose the event name",
content: "Choose a name for the new event and click 'Continue'.",
template: render('website.tour_popover'),
},
{
stepId: 'event-page',
orphan: true,
backdrop: true,
title: "New event created",
content: "You just created a new event. We are now going to edit it.",
template: render('website.tour_popover', { next: "OK" }),
},
{
stepId: 'add-block',
element: 'button[data-action=snippet]',
placement: 'bottom',
reflex: true,
title: "Layout your event",
content: "Insert blocks like text-image to layout the body of your event.",
template: render('website.tour_popover'),
},
];
return this._super();
},
continueTour: function () {
return this.isCurrentStep('event-page') && !this.tour.ended();
},
isTriggerUrl: function () {
return (this.continueTour() && this.testUrl(/^\/event\/[0-9]+\/\?enable_editor=1/)) || this._super();
},
});
}());
@@ -5,6 +5,7 @@
<template id="website_event_script" inherit_id="website.layout" name="Website Event script">
<xpath expr="//t[@id='editable_scripts_hook']" position="inside">
<script type="text/javascript" src="/website_event/static/src/js/website_event.editor.js" t-ignore="true"></script>
<script type="text/javascript" src="/website_event/static/src/js/website.tour.event.js" t-ignore="true"></script>
</xpath>
</template>
@@ -5,7 +5,7 @@
<record id="hr.job_marketing" model="hr.job">
<field name="website_published">True</field>
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -137,7 +137,7 @@
<record id="hr.job_developer" model="hr.job">
<field name="website_published">True</field>
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -270,7 +270,7 @@
<record id="hr.job_consultant" model="hr.job">
<field name="website_published">True</field>
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -403,7 +403,7 @@
<record id="hr.job_ceo" model="hr.job">
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -532,7 +532,7 @@
<record id="hr.job_cto" model="hr.job">
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -660,7 +660,7 @@
<record id="hr.job_trainee" model="hr.job">
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -788,7 +788,7 @@
<record id="hr.job_hrm" model="hr.job">
<field name="website_description" type="html">
<section data-snippet-id="text-block" class="mt16 mb16 dark">
<section data-snippet-id="text-block" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-md-10 mb16 mt16">
@@ -86,7 +86,7 @@
</div>
<div class="oe_structure">
<section data-snippet-id="cta" class="darken">
<section data-snippet-id="cta" class="oe_dark">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt16 mb16">
@@ -220,7 +220,7 @@
we will get back to you soon.
</p>
</div>
<section data-snippet-id="cta" class="darken">
<section data-snippet-id="cta" class="oe_dark">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt16 mb16">
@@ -5,13 +5,19 @@
var render = website.tour.render;
website.EditorShopTour = website.EditorTour.extend({
website.EditorBar.include({
start: function () {
this.registerTour(new website.EditorShopTour(this));
return this._super();
},
});
website.EditorShopTour = website.Tour.extend({
id: 'shop-tutorial',
name: "Create a product",
startPath: '/shop',
init: function (editor) {
var self = this;
var $body = $(document.body);
self.steps = [
{
stepId: 'welcome-shop',
@@ -83,25 +89,11 @@
];
return this._super();
},
productPage: function () {
var currentStepIndex = this.currentStepIndex();
var productPageIndex = this.indexOfStep('product-page');
return (currentStepIndex === productPageIndex) && !this.tour.ended();
},
continueTour: function () {
return this.productPage();
return this.isCurrentStep('product-page') && !this.tour.ended();
},
isTriggerUrl: function (url) {
url = url || new website.UrlParser(window.location.href);
var addProductPattern = /^\/shop\/product\/[0-9]+\/\?enable_editor=1/;
return (this.productPage() && addProductPattern.test(url.pathname+url.search)) || this._super();
},
});
website.EditorBar.include({
start: function () {
this.registerTour(new website.EditorShopTour(this));
return this._super();
return (this.continueTour() && this.testUrl(/^\/shop\/product\/[0-9]+\/\?enable_editor=1/)) || this._super();
},
});
+7 -7
View File
@@ -13,7 +13,7 @@
<field name="website_sequence">5</field>
<field name="website_style_ids" eval="[(6,0,[ref('website_sale.image_full')])]"/>
<field name="website_description" type="html">
<section data-snippet-id="text-image" class="mt16 mb16 dark">
<section data-snippet-id="text-image" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-1 mt64">
@@ -97,7 +97,7 @@
</div>
</div>
</section>
<section data-snippet-id="text-image" class="mt16 mb16 dark">
<section data-snippet-id="text-image" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-1 mt16">
@@ -175,7 +175,7 @@ Ultrafast wireless
iOS7
</field>
<field name="website_description" type="html">
<section data-snippet-id="text-image" class="mt16 mb16 dark">
<section data-snippet-id="text-image" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-1 mt64">
@@ -213,7 +213,7 @@ iOS7
</div>
</div>
</section>
<section data-snippet-id="text-image" class="mb16 dark">
<section data-snippet-id="text-image" class="mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-1 mt32">
@@ -251,7 +251,7 @@ iOS7
</div>
</div>
</section>
<section data-snippet-id="text-image" class="mt16 mb16 dark">
<section data-snippet-id="text-image" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-1 mt64">
@@ -358,7 +358,7 @@ Weight: 0.4 ounce
</div>
</div>
</section>
<section data-snippet-id="text-image" class="mb16 dark">
<section data-snippet-id="text-image" class="mb16 oe_dark">
<div class="container">
<div class="row">
<div class="text-center col-md-8 col-md-offset-2 mt16">
@@ -450,7 +450,7 @@ Weight: 1.1 ounces</field>
</div>
</div>
</section>
<section data-snippet-id="text-image" class="mt16 mb16 dark">
<section data-snippet-id="text-image" class="mt16 mb16 oe_dark">
<div class="container">
<div class="row">
<div class="col-md-5 col-md-offset-1 mt64">