[IMP] mail: remove deprecated annoucement bar
This bar was never displayed as the remote css was always empty. When using the enterprise web client, the printing stylesheet show the target of links (<a> tags) between parentheses, including the one from the annoucement bar that should be kept hidden.
This commit is contained in:
@@ -64,6 +64,5 @@ Main Features
|
||||
'static/src/xml/systray.xml',
|
||||
'static/src/xml/thread.xml',
|
||||
'static/src/xml/chat_window.xml',
|
||||
'static/src/xml/announcement.xml',
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
odoo.define('mail.announcement', function (require) {
|
||||
"use strict";
|
||||
|
||||
var core = require('web.core');
|
||||
var Model = require('web.DataModel');
|
||||
var session = require('web.session');
|
||||
var WebClient = require('web.WebClient');
|
||||
|
||||
var QWeb = core.qweb;
|
||||
|
||||
WebClient.include({
|
||||
show_application: function() {
|
||||
return $.when(this._super.apply(this, arguments)).then(this.proxy('show_announcement_bar'));
|
||||
},
|
||||
_ab_location: function(dbuuid) {
|
||||
return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid);
|
||||
},
|
||||
show_announcement_bar: function() {
|
||||
if (session.get_cookie('ab') === 'c') {
|
||||
return;
|
||||
}
|
||||
var self = this;
|
||||
var config_parameter = new Model('ir.config_parameter');
|
||||
$(QWeb.render('WebClient.announcement_bar')).prependTo($('body'));
|
||||
var $bar = $('#announcement_bar_table');
|
||||
|
||||
return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) {
|
||||
if (!dbuuid) {
|
||||
return;
|
||||
}
|
||||
var $link = $bar.find('.url a');
|
||||
$link.attr('href', _.str.sprintf('%s/%s', $link.attr('href'), dbuuid));
|
||||
var $css = $('<link />').attr({
|
||||
rel : 'stylesheet',
|
||||
type: 'text/css',
|
||||
media: 'screen',
|
||||
href: self._ab_location(dbuuid)
|
||||
});
|
||||
$css.on('load', function() {
|
||||
var close = function() {
|
||||
var ttl = 7*24*60*60;
|
||||
session.set_cookie('ab', 'c', ttl);
|
||||
$bar.slideUp();
|
||||
setTimeout(function () {
|
||||
$('.openerp_webclient_container').css('height', 'calc(100% - 34px)');
|
||||
}, 400);
|
||||
};
|
||||
/*
|
||||
We need a timeout of at least 350ms because the announcement bar appears
|
||||
with an animation of 350ms and the computed height might be wrong if we don't wait
|
||||
*/
|
||||
setTimeout(function(){
|
||||
var height = $('#announcement_bar_table').outerHeight()
|
||||
+ $('#oe_main_menu_navbar').outerHeight();
|
||||
$('.openerp_webclient_container').css('height', 'calc(100% - ' + height + 'px)');
|
||||
$bar.find('.close').on('click', close);
|
||||
self.trigger('ab_loaded', $bar);
|
||||
}, 400);
|
||||
});
|
||||
|
||||
$('head').append($css);
|
||||
}).fail(function(result, ev){
|
||||
ev.preventDefault();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
.openerp .annoucement_bar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#announcement_bar_table > table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="WebClient.announcement_bar">
|
||||
<div class="openerp" id="announcement_bar_table">
|
||||
<table class="oe_webclient">
|
||||
<tr>
|
||||
<td colspan="2" class="announcement_bar">
|
||||
<span class="message"></span>
|
||||
<span class="url">
|
||||
<a href="https://services.openerp.com/openerp-enterprise/ab/register" target="_blank"></a>
|
||||
</span>
|
||||
<span class="close"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -4,7 +4,6 @@
|
||||
<template id="assets_backend" name="mail assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/mail/static/src/js/many2many_tags_email.js"></script>
|
||||
<script type="text/javascript" src="/mail/static/src/js/announcement.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/mail/static/src/js/client_action.js"></script>
|
||||
<script type="text/javascript" src="/mail/static/src/js/chat_window.js"></script>
|
||||
@@ -15,7 +14,6 @@
|
||||
<script type="text/javascript" src="/mail/static/src/js/systray.js"></script>
|
||||
<script type="text/javascript" src="/mail/static/src/js/window_manager.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="/mail/static/src/less/announcement.less"/>
|
||||
<link rel="stylesheet" href="/mail/static/src/less/client_action.less" type="text/less"/>
|
||||
<link rel="stylesheet" href="/mail/static/src/less/chat_window.less" type="text/less"/>
|
||||
<link rel="stylesheet" href="/mail/static/src/less/composer.less" type="text/less"/>
|
||||
|
||||
Reference in New Issue
Block a user