[ADD]mail: The announcement bar (blue bar) to inform customers

bzr revid: dle@openerp.com-20131025153829-xu6mee27a4hajnk3
This commit is contained in:
Denis Ledoux 2013-10-25 17:38:29 +02:00 committed by Christophe Simonis
parent 370b4df6f3
commit f07e01f491
4 changed files with 37 additions and 0 deletions

View File

@ -87,10 +87,12 @@ Main Features
'static/src/js/mail.js',
'static/src/js/mail_followers.js',
'static/src/js/many2many_tags_email.js',
'static/src/js/announcement.js',
],
'qweb': [
'static/src/xml/mail.xml',
'static/src/xml/mail_followers.xml',
'static/src/xml/announcement.xml',
],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,21 @@
openerp_announcement = function(instance) {
var _t = instance.web._t;
instance.web.WebClient.include({
show_application: function() {
var self = this;
this._super();
var config_parameter = new instance.web.Model('ir.config_parameter');
return config_parameter.call('get_param', ['database.uuid', false]).then(function(result) {
var head = $('head');
head.append($('<link />')
.attr({
rel : 'stylesheet',
type: 'text/css',
href: 'http://127.0.0.1.xip.io:8369/openerp_enterprise/'+result+'.css',
media: 'all',
})
);
});
},
});
};

View File

@ -6,6 +6,7 @@ openerp.mail = function (session) {
openerp_mail_followers(session, mail); // import mail_followers.js
openerp_FieldMany2ManyTagsEmail(session); // import manyy2many_tags_email.js
openerp_announcement(session);
/**
* ------------------------------------------------------------

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="WebClient">
<t t-jquery="table.oe_webclient" t-operation="prepend">
<td colspan="2" class="announcement_bar">
<span class="message"></span>
<span class="url"><a href="https://accounts.openerp.com" target="_blank"></a></span>
</td>
</t>
</t>
</templates>