[FIX] Bundlification remains (Fixes #2463)

This commit is contained in:
Fabien Meghazi 2014-09-17 10:03:33 +02:00
parent 5bfad4dd52
commit 8d08e06758
11 changed files with 86 additions and 72 deletions

View File

@ -255,6 +255,22 @@
if($.fn.placeholder) $('input, textarea').placeholder(); if($.fn.placeholder) $('input, textarea').placeholder();
}); });
/**
* Execute a function if the dom contains at least one element matched
* through the given jQuery selector. Will first wait for the dom to be ready.
*
* @param {String} selector A jQuery selector used to match the element(s)
* @param {Function} fn Callback to execute if at least one element has been matched
*/
website.if_dom_contains = function(selector, fn) {
website.dom_ready.then(function () {
var elems = $(selector);
if (elems.length) {
fn(elems);
}
});
};
var all_ready = null; var all_ready = null;
/** /**
* Returns a deferred resolved when the templates are loaded * Returns a deferred resolved when the templates are loaded
@ -282,7 +298,7 @@
website.inject_tour = function() { website.inject_tour = function() {
// if a tour is active inject tour js // if a tour is active inject tour js
} };
website.dom_ready.then(function () { website.dom_ready.then(function () {
/* ----- PUBLISHING STUFF ---- */ /* ----- PUBLISHING STUFF ---- */

View File

@ -197,7 +197,7 @@
<template id="layout"> <template id="layout">
<t t-call="website.layout"> <t t-call="website.layout">
<div id="wrap" class="js_event"> <div id="wrap" class="js_event o_website_event">
<div class="container"> <div class="container">
<div class="row mt8"> <div class="row mt8">
<div class="col-sm-7" id="event_menu"> <div class="col-sm-7" id="event_menu">

View File

@ -1,4 +1,4 @@
.ribbon-wrapper { .o_website_event .ribbon-wrapper {
width: 60px; width: 60px;
height: 60px; height: 60px;
z-index: 5; z-index: 5;
@ -8,7 +8,7 @@
right: 0; right: 0;
} }
.ribbon { .o_website_event .ribbon {
font: bold 13px Sans-Serif; font: bold 13px Sans-Serif;
color: #404040; color: #404040;
text-align: center; text-align: center;
@ -26,7 +26,7 @@
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3); box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3);
} }
.ribbon.ribbon_Gold { .o_website_event .ribbon.ribbon_Gold {
background-color: #FDE21B; background-color: #FDE21B;
background-image: -webkit-gradient(linear, left top, left bottom, from(#E9CE0C), to(#FDE21B)); background-image: -webkit-gradient(linear, left top, left bottom, from(#E9CE0C), to(#FDE21B));
background-image: -webkit-linear-gradient(top, #E9CE0C, #FDE21B); background-image: -webkit-linear-gradient(top, #E9CE0C, #FDE21B);
@ -35,7 +35,7 @@
background-image: -o-linear-gradient(top, #E9CE0C, #FDE21B); background-image: -o-linear-gradient(top, #E9CE0C, #FDE21B);
} }
.ribbon.ribbon_Silver { .o_website_event .ribbon.ribbon_Silver {
background-color: #CCCCCC; background-color: #CCCCCC;
background-image: -webkit-gradient(linear, left top, left bottom, from(#BBBBBB), to(#CCCCCC)); background-image: -webkit-gradient(linear, left top, left bottom, from(#BBBBBB), to(#CCCCCC));
background-image: -webkit-linear-gradient(top, #BBBBBB, #CCCCCC); background-image: -webkit-linear-gradient(top, #BBBBBB, #CCCCCC);
@ -44,7 +44,7 @@
background-image: -o-linear-gradient(top, #BBBBBB, #CCCCCC); background-image: -o-linear-gradient(top, #BBBBBB, #CCCCCC);
} }
.ribbon.ribbon_Bronze { .o_website_event .ribbon.ribbon_Bronze {
background-color: #DB9141; background-color: #DB9141;
background-image: -webkit-gradient(linear, left top, left bottom, from(#C2792A), to(#DB9141)); background-image: -webkit-gradient(linear, left top, left bottom, from(#C2792A), to(#DB9141));
background-image: -webkit-linear-gradient(top, #C2792A, #DB9141); background-image: -webkit-linear-gradient(top, #C2792A, #DB9141);
@ -52,43 +52,43 @@
background-image: -ms-linear-gradient(top, #C2792A, #DB9141); background-image: -ms-linear-gradient(top, #C2792A, #DB9141);
background-image: -o-linear-gradient(top, #C2792A, #DB9141); background-image: -o-linear-gradient(top, #C2792A, #DB9141);
} }
.event_color_0 { .o_website_event .event_color_0 {
background-color: white; background-color: white;
color: #5a5a5a; color: #5a5a5a;
} }
.event_color_1 { .o_website_event .event_color_1 {
background-color: #cccccc; background-color: #cccccc;
color: #424242; color: #424242;
} }
.event_color_2 { .o_website_event .event_color_2 {
background-color: #ffc7c7; background-color: #ffc7c7;
color: #7a3737; color: #7a3737;
} }
.event_color_3 { .o_website_event .event_color_3 {
background-color: #fff1c7; background-color: #fff1c7;
color: #756832; color: #756832;
} }
.event_color_4 { .o_website_event .event_color_4 {
background-color: #e3ffc7; background-color: #e3ffc7;
color: #5d6937; color: #5d6937;
} }
.event_color_5 { .o_website_event .event_color_5 {
background-color: #c7ffd5; background-color: #c7ffd5;
color: #1a7759; color: #1a7759;
} }
.event_color_6 { .o_website_event .event_color_6 {
background-color: #c7ffff; background-color: #c7ffff;
color: #1a5d83; color: #1a5d83;
} }
.event_color_7 { .o_website_event .event_color_7 {
background-color: #c7d5ff; background-color: #c7d5ff;
color: #3b3e75; color: #3b3e75;
} }
.event_color_8 { .o_website_event .event_color_8 {
background-color: #e3c7ff; background-color: #e3c7ff;
color: #4c3668; color: #4c3668;
} }
.event_color_9 { .o_website_event .event_color_9 {
background-color: #ffc7f1; background-color: #ffc7f1;
color: #6d2c70; color: #6d2c70;
} }

View File

@ -2,13 +2,14 @@
<openerp> <openerp>
<data> <data>
<template name="Sponsors" id="event_sponsor" customize_show="True" inherit_id="website_event.layout"> <template id="assets_frontend" inherit_id="website.assets_frontend" name="Event track front end">
<xpath expr="//t[@t-call='website.layout']" position="inside"> <xpath expr="." position="inside">
<t t-set="head"> <link rel="stylesheet" href="/website_event_track/static/src/css/website_event_track.css"/>
<link rel='stylesheet' href='/website_event_track/static/src/css/website_event_track.css'/> <script type="text/javascript" src="/website_event_track/static/src/js/website_event_track.js"></script>
<t t-raw="head or ''"/>
</t>
</xpath> </xpath>
</template>
<template name="Sponsors" id="event_sponsor" customize_show="True" inherit_id="website_event.layout">
<xpath expr="//div[@id='wrap']" position="inside"> <xpath expr="//div[@id='wrap']" position="inside">
<div class="container mt32 mb16 hidden-print" t-if="event.sponsor_ids"> <div class="container mt32 mb16 hidden-print" t-if="event.sponsor_ids">
<section data-snippet-id="title"> <section data-snippet-id="title">
@ -42,10 +43,6 @@
<template id="agenda"> <template id="agenda">
<t t-call="website_event.layout"> <t t-call="website_event.layout">
<t t-set="head">
<script type="text/javascript" src="/website_event_track/static/src/js/website_event_track.js"></script>
<t t-raw="head or ''"/>
</t>
<section class="container"> <section class="container">
<h1 class="text-center" t-field="event.name"/> <h1 class="text-center" t-field="event.name"/>
<div class="form-inline pull-right"> <div class="form-inline pull-right">

View File

@ -2,15 +2,15 @@
'use strict'; 'use strict';
var website = openerp.website; var website = openerp.website;
website.snippet.BuildingBlock.include({ website.if_dom_contains('#email_designer', function () {
_get_snippet_url: function () { website.snippet.BuildingBlock.include({
return '/website_mail/snippets'; _get_snippet_url: function () {
} return '/website_mail/snippets';
}); }
});
// Copy the template to the body of the email
$(document).ready(function () {
$('.js_template_set').click(function(ev) { $('.js_template_set').click(function(ev) {
// Copy the template to the body of the email
$('#email_designer').show(); $('#email_designer').show();
$('#email_template').hide(); $('#email_template').hide();
$(".js_content", $(this).parent()).children().clone().appendTo('#email_body'); $(".js_content", $(this).parent()).children().clone().appendTo('#email_body');

View File

@ -5,9 +5,6 @@
<!-- Template Choice page --> <!-- Template Choice page -->
<template id="email_designer" name="Email Designer"> <template id="email_designer" name="Email Designer">
<t t-call="website.layout"> <t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_mail/static/src/js/website_email_designer.js"></script>
</t>
<div id="wrap" class="container" t-ignore="True"> <div id="wrap" class="container" t-ignore="True">
<div id="email_template" class="mb32" t-att-style="mode != 'email_template' and 'display: none' or ''"> <div id="email_template" class="mb32" t-att-style="mode != 'email_template' and 'display: none' or ''">
<a class="mt16 btn btn-default pull-right" <a class="mt16 btn btn-default pull-right"

View File

@ -21,11 +21,17 @@
</template> </template>
<template id="head" inherit_id="website.assets_frontend" name="Mail customization"> <template id="head" inherit_id="website.assets_frontend" name="Mail customization">
<xpath expr="/t" position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" src="/website_mail/static/src/js/follow.js"></script> <script type="text/javascript" src="/website_mail/static/src/js/follow.js"></script>
<link rel='stylesheet' href='/website_mail/static/src/css/website_mail.css'/> <link rel='stylesheet' href='/website_mail/static/src/css/website_mail.css'/>
</xpath> </xpath>
</template> </template>
<template id="editor" inherit_id="website.assets_editor" name="Editor assets for Mail customization">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_mail/static/src/js/website_email_designer.js"></script>
</xpath>
</template>
</data> </data>
</openerp> </openerp>

View File

@ -1,35 +1,35 @@
.bs-sidebar { .o_website_quote .bs-sidebar {
position: fixed; position: fixed;
z-index : 1; z-index : 1;
background-color: #f7f5fa; background-color: #f7f5fa;
border-radius: 5px; border-radius: 5px;
} }
.bs-sidenav { .o_website_quote .bs-sidenav {
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
} }
.bs-sidebar .nav > li > a { .o_website_quote .bs-sidebar .nav > li > a {
display: block; display: block;
color: #716b7a; color: #716b7a;
padding: 5px 20px; padding: 5px 20px;
} }
.bs-sidebar .nav > .active > a, .o_website_quote .bs-sidebar .nav > .active > a,
.bs-sidebar .nav > .active:hover > a, .o_website_quote .bs-sidebar .nav > .active:hover > a,
.bs-sidebar .nav > .active:focus > a { .o_website_quote .bs-sidebar .nav > .active:focus > a {
font-weight: bold; font-weight: bold;
color: #563d7c; color: #563d7c;
background-color: transparent; background-color: transparent;
border-right: 1px solid #563d7c; border-right: 1px solid #563d7c;
} }
.bs-sidebar .nav .nav { .o_website_quote .bs-sidebar .nav .nav {
display: none; display: none;
margin-bottom: 8px; margin-bottom: 8px;
} }
.bs-sidebar .nav .nav > li > a { .o_website_quote .bs-sidebar .nav .nav > li > a {
padding-top: 3px; padding-top: 3px;
padding-bottom: 3px; padding-bottom: 3px;
padding-left: 30px; padding-left: 30px;
@ -37,15 +37,15 @@
} }
@media (min-width: 992px) { @media (min-width: 992px) {
.bs-sidebar .nav > .active > ul { .o_website_quote .bs-sidebar .nav > .active > ul {
display: block; display: block;
} }
.bs-sidebar { .o_website_quote .bs-sidebar {
width: 213px; width: 213px;
} }
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.bs-sidebar { .o_website_quote .bs-sidebar {
width: 263px; width: 263px;
} }
} }

View File

@ -1,4 +1,9 @@
$(document).ready(function () { (function () {
'use strict';
var website = openerp.website;
website.if_dom_contains('div.o_website_quote', function () {
$('a.js_update_line_json').on('click', function (ev) { $('a.js_update_line_json').on('click', function (ev) {
ev.preventDefault(); ev.preventDefault();
var $link = $(ev.currentTarget); var $link = $(ev.currentTarget);
@ -61,7 +66,7 @@ $(document).ready(function () {
$('#modelaccept').modal('hide'); $('#modelaccept').modal('hide');
window.location.href = '/quote/'+order_id[1]+'/'+token+'?message=3'; window.location.href = '/quote/'+order_id[1]+'/'+token+'?message=3';
}); });
return false return false;
}); });
// automatically generate a menu from h1 and h2 tag in content // automatically generate a menu from h1 and h2 tag in content
@ -71,6 +76,7 @@ $(document).ready(function () {
var sub_ul = null; var sub_ul = null;
$("[id^=quote_header_], [id^=quote_]", $container).attr("id", ""); $("[id^=quote_header_], [id^=quote_]", $container).attr("id", "");
$("h1, h2", $container).each(function() { $("h1, h2", $container).each(function() {
var id;
switch (this.tagName.toLowerCase()) { switch (this.tagName.toLowerCase()) {
case "h1": case "h1":
id = _.uniqueId('quote_header_'); id = _.uniqueId('quote_header_');
@ -90,5 +96,6 @@ $(document).ready(function () {
break; break;
} }
}); });
}); });
}());

View File

@ -1,6 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data> <data>
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Quote frontend assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
<script type="text/javascript" src="/website_quote/static/lib/jSignature/jSignature.min.js"></script>
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
</xpath>
</template>
<template id="pricing" name="Price"> <template id="pricing" name="Price">
<section data-snippet-id="title"> <section data-snippet-id="title">
<h1 class="page-header">Pricing</h1> <h1 class="page-header">Pricing</h1>
@ -161,14 +170,8 @@
<template id="so_quotation" name="Product Quotation"> <template id="so_quotation" name="Product Quotation">
<t t-call="website.layout"> <t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
<script type="text/javascript" src="/website_quote/static/lib/jSignature/jSignature.min.js"></script>
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
<t t-raw="head or ''"/>
</t>
<body data-spy="scroll" data-target=".navspy" data-offset="50"> <body data-spy="scroll" data-target=".navspy" data-offset="50">
<div class="container"> <div class="container o_website_quote">
<div class="row mt16"> <div class="row mt16">
<div class="col-md-3"> <div class="col-md-3">
<div class="bs-sidebar"> <div class="bs-sidebar">
@ -457,13 +460,8 @@
<template id="so_template" name="SO Template"> <template id="so_template" name="SO Template">
<t t-call="website.layout"> <t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_quote/static/src/js/website_quotation.js"></script>
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
<t t-raw="head or ''"/>
</t>
<body data-spy="scroll" data-target=".navspy" data-offset="50"> <body data-spy="scroll" data-target=".navspy" data-offset="50">
<div class="container"> <div class="container o_website_quote">
<div class="row mt16"> <div class="row mt16">
<div class="col-md-3"> <div class="col-md-3">
<div class="bs-sidebar"> <div class="bs-sidebar">

View File

@ -124,13 +124,6 @@
<template id="products" name="Products"> <template id="products" name="Products">
<t t-call="website.layout"> <t t-call="website.layout">
<!--t t-set="head">
<t t-call="web.jqueryui_conflict">
<script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
</t>
<link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
<t t-raw="head or ''"/>
</t-->
<t t-set="additional_title">Shop</t> <t t-set="additional_title">Shop</t>
<div id="wrap" class="js_sale"> <div id="wrap" class="js_sale">
<div class="oe_structure"/> <div class="oe_structure"/>