[Merge]with trunk

bzr revid: mba@tinyerp.com-20140314052050-f1hvupy51x5id1ph
This commit is contained in:
Mahendra Barad (OpenERP) 2014-03-14 10:50:50 +05:30
commit df2c6ea488
29 changed files with 937 additions and 696 deletions

View File

@ -401,7 +401,7 @@
</div>
<div style="height: 50px;text-align: left;font-size : 14px;border-collapse: separate;margin-top:10px">
<strong style="margin-left:12px">Dear ${object.cn}</strong> ,<br/>
<p style="margin-left:12px">this it a reminder for the event below : </p>
<p style="margin-left:12px">That is a reminder for the event below : </p>
</div>
<div style="height: auto;margin-left:12px;margin-top:30px;">
<table>

View File

@ -25,7 +25,7 @@
<t t-set="additional_title">Partner Detail</t>
<div id="wrap">
<div class="oe_structure">
<section data-snippet-id="title">
<section>
<div class="container">
<div class="row">
<div class="col-md-12">
@ -73,7 +73,7 @@ response = request.website.render("website.template_partner_post", values)
<t t-set="additional_title">Partners</t>
<div id="wrap">
<div class="oe_structure">
<section data-snippet-id="title">
<section>
<div class="container">
<div class="row">
<div class="col-md-12">

View File

@ -344,6 +344,12 @@
-moz-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
}
.oe_overlay .oe_handle.readonly {
cursor: auto !important;
}
.oe_overlay .oe_handle.readonly:before, .oe_overlay .oe_handle.readonly.size {
display: none !important;
}
.oe_overlay .icon.btn {
display: inline-block;
}
@ -351,7 +357,7 @@
position: absolute;
left: 50% !important;
text-align: center;
top: -11px;
top: -20px;
z-index: 1002;
}
.oe_overlay .oe_overlay_options > .btn-group {
@ -618,8 +624,3 @@
height: 16px;
display: inline-block;
}
[data-snippet-id] {
min-height: 10px;
min-width: 10px;
}

View File

@ -252,6 +252,10 @@
background: rgba(30, 30, 30, .8)
color: #fff
+box-shadow(0 0 5px 3px rgba(255,255,255,.7))
&.readonly
cursor: auto !important
&:before, &.size
display: none !important
.icon.btn
display: inline-block
@ -260,7 +264,7 @@
position: absolute
left: 50% !important
text-align: center
top: -11px
top: -20px
z-index: 1002
> .btn-group
left: -50%
@ -485,10 +489,6 @@
height: 16px
display: inline-block
[data-snippet-id]
min-height: 10px
min-width: 10px

View File

@ -119,6 +119,7 @@ header a.navbar-brand img {
.container .container {
padding-left: 0;
padding-right: 0;
width: auto;
}
/* ----- BOOTSTRAP HACK FOR HEADER NAV BAR ----- */
@ -280,12 +281,13 @@ ul.nav-stacked > li > a {
background-size: 100%;
}
[data-snippet-id], .colmd, .hr, .blockquote {
section, .carousel, .parallax, .row, .hr, .blockquote {
min-height: 30px;
overflow: hidden;
}
@media (max-width: 400px) {
[data-snippet-id]:not([data-snippet-id="carousel"]) {
section, .parallax, .row, .hr, .blockquote {
height: auto !important;
}
}
@ -380,10 +382,10 @@ ul.nav-stacked > li > a {
}
/* Parallax Theme */
div.carousel[data-snippet-id="slider"] .carousel-indicators li {
div.carousel .carousel-indicators li {
border: 1px solid grey;
}
div.carousel[data-snippet-id="slider"] .carousel-indicators .active {
div.carousel .carousel-indicators .active {
background-color: grey;
}

View File

@ -89,6 +89,7 @@ header
.container
padding-left: 0
padding-right: 0
width: auto
/* ----- BOOTSTRAP HACK FOR HEADER NAV BAR ----- */
@ -230,11 +231,12 @@ ul.nav-stacked > li > a
.oe_img_bg
background-size: 100%
[data-snippet-id],.colmd,.hr,.blockquote
section, .carousel, .parallax, .row, .hr, .blockquote
min-height: 30px
overflow: hidden
@media (max-width: 400px)
[data-snippet-id]:not([data-snippet-id="carousel"])
section, .parallax, .row, .hr, .blockquote
height: auto !important
.carousel-inner
@ -312,7 +314,7 @@ ul.nav-stacked > li > a
/* Parallax Theme */
div.carousel[data-snippet-id="slider"]
div.carousel
.carousel-indicators
li
border: 1px solid grey

View File

@ -106,6 +106,7 @@
},
canUndo: false,
editorFocus: true,
context: 'a',
});
//noinspection JSValidateTypes
editor.addCommand('image', {
@ -115,6 +116,7 @@
},
canUndo: false,
editorFocus: true,
context: 'img',
});
editor.ui.addButton('Link', {
@ -205,8 +207,9 @@
icon: '/website/static/src/img/bglink.png',
modes: { wysiwyg: true },
editorFocus: true,
context: 'a',
panel: {
css: '/website/static/lib/bootstrap/css/bootstrap.css',
css: '/web/static/lib/bootstrap/css/bootstrap.css',
attributes: { 'role': 'listbox', 'aria-label': label },
},
@ -346,14 +349,40 @@
requires: 'widget',
init: function (editor) {
var specials = {
// Can't find the correct ACL rule to only allow img tags
image: { content: '*' },
html: { text: '*' },
monetary: {
text: {
selector: 'span.oe_currency_value',
allowedContent: { }
}
}
};
_(specials).each(function (editable, type) {
editor.widgets.add(type, {
draggable: false,
editables: editable,
upcast: function (el) {
return el.attributes['data-oe-type'] === type;
}
});
});
editor.widgets.add('oeref', {
editables: { text: '*' },
draggable: false,
editables: {
text: {
selector: '*',
allowedContent: { }
},
},
upcast: function (el) {
var matches = el.attributes['data-oe-type'] && el.attributes['data-oe-type'] !== 'monetary';
if (!matches) { return false; }
var type = el.attributes['data-oe-type'];
if (!type || (type in specials)) {
return false;
}
if (el.attributes['data-oe-original']) {
while (el.children.length) {
el.children[0].remove();
@ -363,16 +392,9 @@
));
}
return true;
},
});
editor.widgets.add('monetary', {
editables: { text: 'span.oe_currency_value' },
draggable: false,
upcast: function (el) {
return el.attributes['data-oe-type'] === 'monetary';
}
});
editor.widgets.add('icons', {
draggable: false,

View File

@ -231,11 +231,13 @@
dialog.on('click', '.btn-primary', function () {
def.resolve(field.val(), field, dialog);
dialog.remove();
$('.modal-backdrop').remove();
});
});
dialog.on('hidden.bs.modal', function () {
def.reject();
dialog.remove();
$('.modal-backdrop').remove();
});
if (field.is('input[type="text"], select')) {
field.keypress(function (e) {

View File

@ -5,20 +5,26 @@
if (!website.snippet) website.snippet = {};
website.snippet.readyAnimation = [];
website.snippet.start_animation = function () {
website.snippet.start_animation = function (editable_mode, $target) {
for (var k in website.snippet.animationRegistry) {
var Animation = website.snippet.animationRegistry[k];
var selector = "[data-snippet-id='"+k+"']";
var selector = "";
if (Animation.prototype.selector) {
selector += ", " + Animation.prototype.selector;
if (selector != "") selector += ", "
selector += Animation.prototype.selector;
}
if ($target) {
if ($target.is(selector)) selector = $target;
else continue;
}
$(selector).each(function() {
var $snipped_id = $(this);
if ( !$snipped_id.parents("#oe_snippets").length &&
!$snipped_id.parent("body").length &&
!$snipped_id.data("snippet-view")) {
website.snippet.readyAnimation.push($snipped_id);
$snipped_id.data("snippet-view", new Animation($snipped_id));
$snipped_id.data("snippet-view", new Animation($snipped_id, editable_mode));
}
});
}
@ -32,7 +38,9 @@
}
});
};
$(document).ready(website.snippet.start_animation);
$(document).ready(function () {
website.snippet.start_animation();
});
website.snippet.animationRegistry = {};
@ -41,9 +49,9 @@
$: function () {
return this.$el.find.apply(this.$el, arguments);
},
init: function (dom) {
init: function (dom, editable_mode) {
this.$el = this.$target = $(dom);
this.start();
this.start(editable_mode);
},
/*
* start
@ -71,7 +79,7 @@
});
website.snippet.animationRegistry.parallax = website.snippet.Animation.extend({
parallax: ".parallax",
selector: ".parallax",
start: function () {
var self = this;
setTimeout(function () {self.set_values();});
@ -108,7 +116,7 @@
img.onload = function () {
var offset = 0;
var padding = parseInt($(document.body).css("padding-top"));
if (speed < 1) {
if (speed > 1) {
var inner_offset = - self.$target.outerHeight() + this.height / this.width * document.body.clientWidth;
var outer_offset = self.$target.offset().top - (document.body.clientHeight - self.$target.outerHeight()) - padding;
offset = - outer_offset * speed + inner_offset;
@ -123,4 +131,21 @@
}
});
website.snippet.animationRegistry.share = website.snippet.Animation.extend({
selector: ".oe_share",
start: function () {
var url = encodeURIComponent(window.location.href);
var title = encodeURIComponent($("title").text());
this.$target.find("a").each(function () {
var $a = $(this);
$a.attr("href", $(this).attr("href").replace("{url}", url).replace("{title}", title));
if ($a.attr("target") && $a.attr("target").match(/_blank/i)) {
$a.click(function () {
window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600');
return false;
});
}
});
},
});
})();

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@
popover: { fixed: true },
},
{
snippet: 'carousel',
snippet: '#snippet_structure .oe_snippet:first',
placement: 'bottom',
title: _t("Drag & Drop a Banner"),
content: _t("Drag the Banner block and drop it in your page."),
@ -47,14 +47,14 @@
},
{
waitFor: '.oe_overlay_options .oe_options:visible',
element: '#wrap [data-snippet-id=carousel]:first .carousel-caption > div',
element: '#wrap .carousel:first .carousel-caption > div',
placement: 'top',
title: _t("Customize banner's text"),
content: _t("Click in the text and start editing it."),
popover: { next: _t("Continue") },
},
{
element: '.oe_overlay_options .oe_options',
element: '.oe_overlay_options .oe_options:visible',
placement: 'left',
title: _t("Customize the banner"),
content: _t("Customize any block through this menu. Try to change the background of the banner."),
@ -69,14 +69,7 @@
popover: { fixed: true },
},
{
element: 'a[href="#snippet_feature"]',
placement: 'bottom',
title: _t("Feature blocks list"),
content: _t("Click on 'Features' to see the feature blocks list."),
popover: { fixed: true },
},
{
snippet: 'features',
snippet: '#snippet_structure .oe_snippet:eq(6)',
placement: 'bottom',
title: _t("Drag & Drop This Block"),
content: _t("Drag the <em>'Features'</em> block and drop it below the banner."),
@ -92,8 +85,8 @@
},
{
waitFor: 'button[data-action=edit]:visible',
title: _("Good Job!"),
content: _("Well done, you created your homepage."),
title: _t("Good Job!"),
content: _t("Well done, you created your homepage."),
popover: { next: _t("Continue") },
},
{

View File

@ -205,7 +205,7 @@ website.Tour = openerp.Class.extend({
if (!step.element) step.orphan = true;
if (step.snippet) {
step.element = '#oe_snippets div.oe_snippet[data-snippet-id="'+step.snippet+'"] .oe_snippet_thumbnail';
step.element = '#oe_snippets '+step.snippet+' .oe_snippet_thumbnail';
}
}
@ -377,7 +377,7 @@ website.Tour = openerp.Class.extend({
if (step.snippet) {
var selector = '#oe_snippets div.oe_snippet[data-snippet-id="'+step.snippet+'"] .oe_snippet_thumbnail';
var selector = '#oe_snippets '+step.snippet+' .oe_snippet_thumbnail';
self.autoDragAndDropSnippet(selector);
} else if (step.element.match(/#oe_snippets .* \.oe_snippet_thumbnail/)) {

View File

@ -57,7 +57,7 @@
},
{
title: 'add snippets',
snippet: 'carousel',
snippet: '#snippet_structure .oe_snippet:first',
},
{
title: 'try to save',

View File

@ -97,7 +97,7 @@
target="fileframe"
class="col-sm-8">
<div class="text-center">
<input type="file" name="upload" style="position: absolute; opacity: 0; width: 1px; height: 1px;"/>
<input type="file" name="upload" accept="image/*" style="position: absolute; opacity: 0; width: 1px; height: 1px;"/>
<button type="button" class="btn btn-primary btn-lg filepicker">
Upload an image from your computer
</button>

View File

@ -22,7 +22,7 @@
<t t-name="website.snippet_overlay">
<div class="oe_overlay">
<div class="oe_overlay_options">
<div class="oe_overlay_options" contentEditable="false">
<div class="btn-group">
<a href="#" class="btn btn-default btn-sm oe_snippet_parent" title="Select Container Block"><i class="fa fa-upload"></i></a>
<div class="dropdown oe_options hidden btn-group">
@ -34,6 +34,13 @@
<a href="#" class="btn btn-default btn-sm oe_snippet_remove" title="Remove Block">&amp;nbsp;<i class="fa fa-trash-o"></i>&amp;nbsp; </a>
</div>
</div>
<div class='oe_handles'>
<div class='oe_handle n readonly'><div></div></div>
<div class='oe_handle e readonly'><div></div></div>
<div class='oe_handle w readonly'><div></div></div>
<div class='oe_handle size readonly'><div class="oe_handle_button size">Resize</div></div>
<div class='oe_handle s readonly'><div></div></div>
</div>
</div>
</t>
@ -45,13 +52,6 @@
<div t-name="website.snippets.resize" data-snippet-id='resize'>
<!-- custom data for the widget -->
<div class='oe_handles'>
<div class='oe_handle n'><div></div></div>
<div class='oe_handle e'><div></div></div>
<div class='oe_handle w'><div></div></div>
<div class='oe_handle size'><div class="oe_handle_button size">Resize</div></div>
<div class='oe_handle s'><div></div></div>
</div>
<div class='oe_snippet_thumbnail'>Margin resize</div>
</div>

View File

@ -13,14 +13,7 @@
<div id="snippet_structure" class="tab-pane fade in active">
<div data-snippet-id="carousel" data-selector-children=".oe_structure, [data-oe-type=html]">
<li class="oe_snippet_options divider"></li>
<li class="oe_snippet_options">
<a href="#" class="button js_add">Add Slide</a>
</li>
<li class="oe_snippet_options">
<a href="#" class="button js_remove">Remove Slide</a>
</li>
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_banner.png"/>
<span class="oe_snippet_thumbnail_title">Banner</span>
@ -51,7 +44,7 @@
</div>
</div>
<div data-snippet-id="text-image" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_text_image.png"/>
<span class="oe_snippet_thumbnail_title">Text-Image</span>
@ -79,7 +72,7 @@
</div>
<div data-snippet-id="image-text" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_image_text.png"/>
<span class="oe_snippet_thumbnail_title">Image-Text</span>
@ -107,7 +100,7 @@
</div>
<div data-snippet-id="jumbotron" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_jumbotron.png"/>
<span class="oe_snippet_thumbnail_title">Big Message</span>
@ -128,7 +121,7 @@
</div>
<div data-snippet-id="text-block" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_text_block.png"/>
<span class="oe_snippet_thumbnail_title">Text Block</span>
@ -166,7 +159,7 @@
</div>
<div data-snippet-id="title" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_title.png"/>
<span class="oe_snippet_thumbnail_title">Title</span>
@ -183,7 +176,7 @@
</section>
</div>
<div data-snippet-id="features" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_features.png"/>
<span class="oe_snippet_thumbnail_title">Features</span>
@ -214,7 +207,7 @@
</section>
</div>
<div data-snippet-id="big-picture" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<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>
@ -246,7 +239,7 @@
</section>
</div>
<div data-snippet-id="three-columns" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_three_columns.png"/>
<span class="oe_snippet_thumbnail_title">Three Columns</span>
@ -291,7 +284,7 @@
<div id="snippet_content" class="tab-pane fade">
<div data-snippet-id="well" data-selector-siblings="p, h1, h2, h3, blockquote" data-selector-children=".content">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_well.png"/>
<span class="oe_snippet_thumbnail_title">Well</span>
@ -303,7 +296,7 @@
</div>
<div data-snippet-id="quote" data-selector-siblings="p, h1, h2, h3, blockquote" data-selector-children=".content">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_quote.png"/>
<span class="oe_snippet_thumbnail_title">Quote</span>
@ -318,7 +311,7 @@
</div>
<div data-snippet-id="panel" data-selector-siblings="p, h1, h2, h3, blockquote" data-selector-children=".content">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_panel.png"/>
<span class="oe_snippet_thumbnail_title">Panel</span>
@ -335,7 +328,7 @@
</div>
<div data-snippet-id="hr" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_separator.png"/>
<span class="oe_snippet_thumbnail_title">Separator</span>
@ -343,11 +336,29 @@
<hr class="oe_snippet_body"/>
</div>
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Share</span>
</div>
<div class="oe_snippet_body oe_share">
<h3>
Share
<a target="_Blank" class="oe_share_facebook" href="https://www.facebook.com/sharer/sharer.php?u={url}"><i class="fa fa-facebook-square"></i></a>
<a target="_Blank" class="oe_share_twitter" href="https://twitter.com/intent/tweet?text={title}&amp;url={url}"><i class="fa fa-twitter"></i></a>
<a target="_Blank" class="oe_share_linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url={url}&amp;title={title}&amp;"><i class="fa fa-linkedin"></i></a>
<a target="_Blank" class="oe_share_google" href="https://plus.google.com/share?url={url}"><i class="fa fa-google-plus-square"></i></a>
<a href="mailto:?body={url}&amp;subject={title}"><i class="fa fa-envelope-o"></i></a>
</h3>
</div>
</div>
</div>
<div id="snippet_feature" class="tab-pane fade">
<div data-snippet-id="portfolio" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_portfolio.png"/>
<span class="oe_snippet_thumbnail_title">Portfolio</span>
@ -380,7 +391,7 @@
</div>
<div data-snippet-id="image-gallery" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_image_gallery.png"/>
<span class="oe_snippet_thumbnail_title">Image Gallery</span>
@ -422,7 +433,7 @@
</div>
<div data-snippet-id="pricing" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_comparison.png"/>
<span class="oe_snippet_thumbnail_title">Comparisons</span>
@ -528,7 +539,7 @@
</div>
<div data-snippet-id="cta" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Button</span>
@ -545,7 +556,7 @@
</div>
<div data-snippet-id="faq" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_faq.png"/>
<span class="oe_snippet_thumbnail_title">FAQ</span>
@ -592,7 +603,7 @@
</div>
<div data-snippet-id="references" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_references.png"/>
<span class="oe_snippet_thumbnail_title">References</span>
@ -609,7 +620,7 @@
</h3>
</div>
<div class="col-md-4 col-md-offset-1 mt16 mb32">
<blockquote data-snippet-id="quote">
<blockquote>
<p>
Write a quote here from one of your customers. Quotes are a
great way to build confidence in your products or services.
@ -618,7 +629,7 @@
</blockquote>
</div>
<div class="col-md-4 col-md-offset-2 mt16 mb32">
<blockquote data-snippet-id="quote">
<blockquote>
<p>
OpenERP provides essential platform for our project management.
Things are better organized and more visible with it.
@ -646,14 +657,7 @@
</section>
</div>
<div data-snippet-id="slider" data-selector-children=".oe_structure, [data-oe-type=html]">
<li class="oe_snippet_options divider"></li>
<li class="oe_snippet_options">
<a href="#" class="button js_add">Add Slide</a>
</li>
<li class="oe_snippet_options">
<a href="#" class="button js_remove">Remove Slide</a>
</li>
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_quotes_slider.png"/>
<span class="oe_snippet_thumbnail_title">Quotes Slider</span>
@ -706,7 +710,7 @@
</div>
</div>
<div data-snippet-id="features-list" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_features.png"/>
<span class="oe_snippet_thumbnail_title">Feature Grid</span>
@ -766,22 +770,11 @@
<div id="snippet_effect" class="tab-pane fade">
<div data-snippet-id="parallax" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_parallax.png"/>
<span class="oe_snippet_thumbnail_title">Parallax</span>
</div>
<li class="oe_snippet_options dropdown-submenu">
<a tabindex="-1" href="#">Scroll Speed</a>
<ul class="dropdown-menu" name="parallax-scroll">
<li data-value="0"><a>Static</a></li>
<li data-value="0.3"><a>Very Slow</a></li>
<li data-value="0.6"><a>Slow</a></li>
<li data-value="1"><a>Fixed</a></li>
<li data-value="1.4"><a>Fast</a></li>
<li data-value="1.7"><a>Very Fast</a></li>
</ul>
</li>
<section class="oe_snippet_body parallax"
style="background-image: url('/website/static/src/img/banner/mountains.jpg')"
data-scroll-background-ratio="0.3">
@ -789,16 +782,16 @@
</section>
</div>
<div data-snippet-id="parallax_quote" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_quotes_slider.png"/>
<span class="oe_snippet_thumbnail_title">Parallax Slider</span>
</div>
<section class="oe_snippet_body parallax" data-snippet-id="parallax"
<section class="oe_snippet_body parallax"
style="background-image: url('/website/static/src/img/parallax/quote.png')"
data-scroll-background-ratio="0.3">
<div><div><div class="oe_structure">
<div id="myQuoteCarousel" class="carousel quotecarousel slide mb0" data-snippet-id="slider">
<div id="myQuoteCarousel" class="carousel quotecarousel slide mb0">
<!-- Indicators -->
<ol class="carousel-indicators mb0">
<li data-target="#myQuoteCarousel" data-slide-to="0" class="active"></li>
@ -850,30 +843,20 @@
</div>
<!-- use to declare snippet for snippet editor -->
<div id="snippet_hidden" class="hidden">
<div id="snippet_options" class="hidden">
<div data-snippet-id='colmd' data-selector-vertical-children='.row'>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_column.png"/>
<span class="oe_snippet_thumbnail_title">Add Column</span>
</div>
<div class="oe_snippet_body col-md-4">
<img class="img img-rounded img-responsive" src="/website/static/src/img/china_thumb.jpg"/>
<h4 class="mt16">Feature</h4>
<p>
Delete the above image or replace it with a picture
that illustrates your message. Click on the picture to
change it's <em>rounded corner</em> style.
</p>
</div>
</div>
<t t-call="website.snippet_options"/>
</div>
<div id="snippet_styles" class="hidden">
</div>
</div>
</template>
<div data-snippet-style-id='text-style' data-selector="section">
<template id="snippet_options">
<div data-snippet-option-id='blog-style'
data-selector="section:not(.carousel):not(.parallax)">
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Style</a>
<ul class="dropdown-menu">
@ -882,18 +865,8 @@
</li>
</div>
<div data-snippet-style-id='carousel-style' data-selector="div[data-snippet-id='carousel']">
<li class="dropdown-submenu" data-required="true">
<a tabindex="-1" href="#">Layout</a>
<ul class="dropdown-menu">
<li data-class="text_only"><a>Text Only</a></li>
<li data-class="image_text"><a>Image - Text</a></li>
<li data-class="text_image"><a>Text - Image</a></li>
</ul>
</li>
</div>
<div data-snippet-style-id='background' data-selector="section, section[data-snippet-id='parallax'], div[data-snippet-id='carousel'], div[data-snippet-id='slider']">
<div data-snippet-option-id='background'
data-selector="section, .carousel, .parallax">
<li class="dropdown-submenu" data-required="true">
<a tabindex="-1" href="#">Background</a>
<ul class="dropdown-menu">
@ -949,10 +922,69 @@
</li>
</div>
</div>
<div data-snippet-option-id='carousel-style'
data-selector="div[data-snippet-id='carousel']">
<li class="dropdown-submenu" data-required="true">
<a tabindex="-1" href="#">Layout</a>
<ul class="dropdown-menu">
<li data-class="text_only"><a>Text Only</a></li>
<li data-class="image_text"><a>Image - Text</a></li>
<li data-class="text_image"><a>Text - Image</a></li>
</ul>
</li>
</div>
</div>
<div data-snippet-option-id='carousel'
data-selector=".carousel">
<li class="divider"></li>
<li>
<a href="#" class="button js_add">Add Slide</a>
</li>
<li>
<a href="#" class="button js_remove">Remove Slide</a>
</li>
</div>
<div data-snippet-option-id='margin-y'
data-selector="section, .row > [class*='col-md-'], .carousel, .parallax, hr">
</div>
<div data-snippet-option-id='resize'
data-selector="section, .carousel, .parallax"
data-selector-children=".oe_structure, [data-oe-type=html]">
<li>
<a href="#" class="button js_size_auto">Size Automatic</a>
</li>
</div>
<div data-snippet-option-id='margin-x'
data-selector=".row > [class*='col-md-']"
data-selector-vertical-children='.row'>
</div>
<div data-snippet-option-id='content'
data-selector="blockquote, .well, .panel, .oe_share"
data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel, .oe_share"
data-selector-children=".content">
</div>
<div data-snippet-option-id='parallax'
data-selector=".parallax">
<li class="dropdown-submenu">
<a tabindex="-1" href="#">Scroll Speed</a>
<ul class="dropdown-menu" name="parallax-scroll">
<li data-value="0"><a>Static</a></li>
<li data-value="0.3"><a>Very Slow</a></li>
<li data-value="0.6"><a>Slow</a></li>
<li data-value="1"><a>Fixed</a></li>
<li data-value="1.4"><a>Fast</a></li>
<li data-value="1.7"><a>Very Fast</a></li>
</ul>
</li>
</div>
</template>
</data>
</openerp>
</openerp>

View File

@ -65,7 +65,7 @@
popover: { fixed: true },
},
{
snippet: 'image-text',
snippet: '#snippet_structure .oe_snippet:eq(2)',
placement: 'bottom',
title: _t("Drag & Drop a Block"),
content: _t("Drag this block and drop it in your page."),
@ -79,7 +79,7 @@
popover: { fixed: true },
},
{
snippet: 'text-block',
snippet: '#snippet_structure .oe_snippet:eq(4)',
placement: 'bottom',
title: _t("Drag & Drop a block"),
content: _t("Drag this block and drop it below the image block."),

View File

@ -187,7 +187,7 @@ class website_event(http.Controller):
}
return request.website.render("website_event.event_description_full", values)
@http.route('/event/add_event/', type='http', auth="user", multilang=True, methods=['POST'], website=True)
@http.route('/event/add_event', type='http', auth="user", multilang=True, methods=['POST'], website=True)
def add_event(self, event_name="New Event", **kwargs):
return self._add_event(event_name, request.context, **kwargs)

View File

@ -65,7 +65,7 @@
popover: { fixed: true },
},
{
snippet: 'image-text',
snippet: '#snippet_structure .oe_snippet:eq(2)',
placement: 'bottom',
title: _t("Drag & Drop a block"),
content: _t("Drag the 'Image-Text' block and drop it in your page."),
@ -80,7 +80,7 @@
popover: { fixed: true },
},
{
snippet: 'text-block',
snippet: '#snippet_structure .oe_snippet:eq(4)',
placement: 'bottom',
title: _t("Drag & Drop a block"),
content: _t("Drag the 'Text Block' in your event page."),

View File

@ -32,14 +32,9 @@
'views/website_mail.xml',
'views/website_email_designer.xml',
'views/email_template_view.xml',
'data/mail_groups.xml',
'security/website_mail.xml',
],
'css': [
'static/src/css/website_mail.css',
],
'js': [
'static/src/js/website_mail.js',
],
'qweb': [
'static/src/xml/website_mail.xml'
],

View File

@ -56,3 +56,13 @@ class WebsiteMail(http.Controller):
follower_ids = [p.id for p in obj.message_follower_ids]
return partner_ids[0] in follower_ids and 1 or 0
@http.route(['/website_mail/is_follower/'], type='json', auth="public", website=True)
def call(self, model, id, **post):
email = request.registry['res.users'].browse(request.cr, request.uid, request.uid, request.context).partner_id.email
value = request.registry.get(model).read(request.cr, request.uid, [id], ['message_is_follower'], request.context)
return {
'email': email,
'is_follower': value and value[0]['message_is_follower'] or False
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record model="mail.group" id="group_all_employees">
<field name="name">Newsletter</field>
<field name="public">public</field>
<field name="description">Public Newsletter.</field>
</record>
</data>
</openerp>

View File

@ -1,4 +1,5 @@
.js_follow[data-follow='on'] .js_follow_btn ,
.js_follow[data-follow='on'] .js_follow_email,
.js_follow[data-follow='off'] .js_unfollow_btn {
display: none;
}

View File

@ -0,0 +1,40 @@
(function () {
'use strict';
var website = openerp.website;
var _t = openerp._t;
website.snippet.options.subscribe = website.snippet.Option.extend({
on_prompt: function () {
var self = this;
return website.prompt({
id: "editor_new_subscribe_button",
window_title: _t("Add a Subscribe Button"),
select: _t("Mailing List"),
init: function (field) {
return website.session.model('mail.group')
.call('name_search', ['', [['public','=','public']]], { context: website.get_context() });
},
}).then(function (mail_group_id) {
self.$target.attr("data-id", mail_group_id);
});
},
drop_and_build_snippet: function() {
var self = this;
this._super();
this.on_prompt().fail(function () {
self.editor.on_remove();
});
},
start : function () {
var self = this;
this.$el.find(".js_mailing_list").on("click", _.bind(this.on_prompt, this));
this._super();
},
clean_for_save: function () {
this.$target.addClass("hidden");
},
});
})();

View File

@ -1,30 +1,56 @@
$(document).ready(function () {
(function () {
'use strict';
$(document).on('click', '.js_follow_btn, .js_unfollow_btn', function (ev) {
ev.preventDefault();
var website = openerp.website;
var self = this;
var $data = $(this).parents("div.js_follow");
var $email = $data.find(".js_follow_email");
website.snippet.animationRegistry.follow = website.snippet.Animation.extend({
selector: ".js_follow",
start: function (editable_mode) {
var self = this;
if ($email.length && !$email.val().match(/.+@.+/)) {
return false;
}
// set value and display button
openerp.jsonRpc('/website_mail/is_follower/', 'call', {
model: this.$target.data('object'),
id: +this.$target.data('id'),
}).always(function (data) {
self.$target.find('input.js_follow_email')
.val(data.email ? data.email : "")
.attr("disabled", data.email.length ? "disabled" : false);
self.$target.attr("data-follow", data.is_follower ? 'on' : 'off');
self.$target.removeClass("hidden");
});
var message_is_follower = $data.attr("data-follow") || "off";
$data.attr("data-follow", message_is_follower == 'off' ? 'on' : 'off');
openerp.jsonRpc('/website_mail/follow', 'call', {
'id': $data.data('id'),
'object': $data.data('object'),
'message_is_follower': message_is_follower,
'email': $email.length ? $email.val() : false,
}).then(function (result) {
if (result) {
$data.find(" > *").toggleClass("hidden");
// not if editable mode to allow designer to edit alert field
if (!editable_mode) {
$('.js_follow > .alert').addClass("hidden");
$('.js_follow > .input-group-btn.hidden').removeClass("hidden");
this.$target.find('.js_follow_btn, .js_unfollow_btn').on('click', function (event) {
event.preventDefault();
self.on_click();
});
}
$data.attr("data-follow", result ? 'on' : 'off');
});
});
},
on_click: function () {
var self = this;
var $email = this.$target.find(".js_follow_email:visible");
});
if ($email.length && !$email.val().match(/.+@.+/)) {
this.$target.addClass('has-error');
return false;
}
this.$target.removeClass('has-error');
openerp.jsonRpc('/website_mail/follow', 'call', {
'id': +this.$target.data('id'),
'object': this.$target.data('object'),
'message_is_follower': this.$target.attr("data-follow") || "off",
'email': $email.length ? $email.val() : false,
}).then(function (follow) {
if (follow) {
self.$target.find(" > *").toggleClass("hidden");
}
self.$target.attr("data-follow", follow ? 'on' : 'off');
});
},
});
})();

View File

@ -13,7 +13,7 @@
<div id="snippet_email_structure" class="tab-pane fade in active">
<div data-snippet-id="text-image" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_text_block.png"/>
<span class="oe_snippet_thumbnail_title">Text Block</span>
@ -63,7 +63,7 @@
</div>
<div data-snippet-id="text-image" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_text_image.png"/>
<span class="oe_snippet_thumbnail_title">Text-Image</span>
@ -104,7 +104,7 @@
</div>
<div data-snippet-id="image-text" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_image_text.png"/>
<span class="oe_snippet_thumbnail_title">Image-Text</span>
@ -145,7 +145,7 @@
</div>
<div data-snippet-id="three-columns" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website_mail/static/src/img/blocks/block_two_columns.png"/>
<span class="oe_snippet_thumbnail_title">Two Columns</span>
@ -185,7 +185,7 @@
</div>
<div data-snippet-id="three-columns" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website_mail/static/src/img/blocks/block_three_columns.png"/>
<span class="oe_snippet_thumbnail_title">Three Columns</span>
@ -236,7 +236,7 @@
</div>
<div data-snippet-id="hr" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_separator.png"/>
<span class="oe_snippet_thumbnail_title">Separator</span>
@ -262,7 +262,7 @@
<div id="snippet_email_feature" class="tab-pane fade">
<div data-snippet-id="big-picture" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<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>
@ -298,7 +298,7 @@
</div>
<div data-snippet-id="pricing" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_comparison.png"/>
<span class="oe_snippet_thumbnail_title">Comparisons</span>
@ -389,7 +389,7 @@
</div>
<div data-snippet-id="text-image" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_jumbotron.png"/>
<span class="oe_snippet_thumbnail_title">Big Message</span>
@ -413,7 +413,7 @@
</div>
<div data-snippet-id="cta" data-selector-children=".oe_structure, [data-oe-type=html]">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Button</span>
@ -478,18 +478,59 @@
</table>
</div>
</div>
</div>
<div id="snippet_styles" class="hidden">
<div id="snippet_options" class="hidden">
<t t-call="website.snippet_options"/>
</div>
</div>
</div>
</template>
<template id="subscribe" inherit_id="website.snippets" name="Snippet Subscribe">
<xpath expr="//div[@id='snippet_content']" position="inside">
<div>
<div class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Subscribe Button</span>
</div>
<div class="oe_snippet_body input-group js_follow"
data-id="0"
data-object="mail.group"
data-follow="off">
<input
type="email"
name="email"
class="js_follow_email form-control"
placeholder="your email..."/>
<span class="input-group-btn">
<a href="#" class="btn btn-default js_unfollow_btn">Unsubscribe</a>
<a href="#" class="btn btn-primary js_follow_btn">Subscribe</a>
</span>
<div class="alert alert-success hidden">Thanks for your subscription!</div>
</div>
</div>
</xpath>
<xpath expr="//div[@id='snippet_options']" position="inside">
<div data-snippet-option-id='subscribe'
data-selector=".js_follow"
data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
>
<li>
<a href="#" class="button js_mailing_list">Change mailing list</a>
</li>
</div>
</xpath>
</template>
</data>
</openerp>

View File

@ -9,7 +9,6 @@
<input
type="email" name="email"
class="js_follow_email form-control"
t-att-value="email or ''"
placeholder="your email..."
groups="base.group_public"/>
<span class="input-group-btn">
@ -22,6 +21,7 @@
<template id="head" inherit_id="website.layout" name="Mail customization">
<xpath expr="//head" position="inside">
<script type="text/javascript" src="/website_mail/static/src/js/website_mail.editor.js" groups="base.group_website_publisher"></script>
<script type="text/javascript" src="/website_mail/static/src/js/website_mail.js"></script>
<link rel='stylesheet' href='/website_mail/static/src/css/website_mail.css'/>
</xpath>

View File

@ -321,7 +321,7 @@ class Ecommerce(http.Controller):
context=dict(context, mail_create_nosubcribe=True))
return werkzeug.utils.redirect(request.httprequest.referrer + "#comments")
@http.route(['/shop/add_product/'], type='http', auth="user", methods=['POST'], website=True, multilang=True)
@http.route(['/shop/add_product'], type='http', auth="user", methods=['POST'], website=True, multilang=True)
def add_product(self, name=None, category=0, **post):
if not name:
name = _("New Product")

View File

@ -109,7 +109,7 @@
popover: { fixed: true },
},
{
snippet: 'big-picture',
snippet: '#snippet_structure .oe_snippet:eq(7)',
placement: 'bottom',
title: _t("Drag & Drop a block"),
content: _t("Drag the 'Big Picture' block and drop it in your page."),