diff options
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/css/mail.css | 11 | ||||
| -rw-r--r--[-rwxr-xr-x] | addons/mail/static/src/img/email_icon.png | bin | 924 -> 924 bytes | |||
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 62 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail.xml | 4 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail_followers.xml | 2 |
5 files changed, 45 insertions, 34 deletions
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 6bc086a5b58..958c2bccd5f 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -564,13 +564,6 @@ text-align: center; width:100%; } -.openerp .oe_followers button.oe_invite{ - margin: 5px 0; - padding: 2px 8px; - font-size: 12px; - text-shadow: none; - width: 100%; -} .openerp .oe_followers button.oe_follower.oe_following{ color: white; background-color: #3465A4; @@ -624,8 +617,12 @@ margin-top: 12px; margin-bottom: 4px; } +.openerp .oe_followers .oe_invite{ + float: right; +} .openerp .oe_followers .oe_partner { height: 32px; + margin-right: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/addons/mail/static/src/img/email_icon.png b/addons/mail/static/src/img/email_icon.png Binary files differindex 78c131c0ff2..78c131c0ff2 100755..100644 --- a/addons/mail/static/src/img/email_icon.png +++ b/addons/mail/static/src/img/email_icon.png diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index b1a579ba057..8631bc70baa 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -1056,9 +1056,7 @@ openerp.mail = function (session) { msg.renderElement(); msg.start(); } - if( self.options.root_thread.__parentedParent.__parentedParent.do_reload_menu_emails ) { - self.options.root_thread.__parentedParent.__parentedParent.do_reload_menu_emails(); - } + self.options.root_thread.MailWidget.do_reload_menu_emails(); }); }); @@ -1198,6 +1196,7 @@ openerp.mail = function (session) { init: function (parent, datasets, options) { var self = this; this._super(parent, options); + this.MailWidget = parent.__proto__ == mail.Widget.prototype ? parent : false; this.domain = options.domain || []; this.context = _.extend(options.context || {}); @@ -1431,11 +1430,16 @@ openerp.mail = function (session) { message_fetch_set_read: function (message_list) { if (! this.context.mail_read_set_read) return; - this.render_mutex.exec(_.bind(function() { + var self = this; + this.render_mutex.exec(function() { msg_ids = _.pluck(message_list, 'id'); - return this.ds_message.call('set_message_read', [ - msg_ids, true, false, this.context]); - }, this)); + return self.ds_message.call('set_message_read', [msg_ids, true, false, self.context]) + .then(function (nb_read) { + if (nb_read) { + self.options.root_thread.MailWidget.do_reload_menu_emails(); + } + }); + }); }, /** @@ -1701,6 +1705,22 @@ openerp.mail = function (session) { }, /** + * create an object "related_menu" + * contains the menu widget and the sub menu related of this wall + */ + do_reload_menu_emails: function () { + var menu = session.webclient.menu; + if (!menu || !menu.current_menu) { + return $.when(); + } + return menu.rpc("/web/menu/load_needaction", {'menu_ids': [menu.current_menu]}).done(function(r) { + menu.on_needaction_loaded(r); + }).then(function () { + menu.trigger("need_action_reloaded"); + }); + }, + + /** *Create the root thread and display this object in the DOM. * Call the no_message method then c all the message_fetch method * of this root thread to display the messages. @@ -1749,6 +1769,7 @@ openerp.mail = function (session) { init: function (parent, node) { this._super.apply(this, arguments); + this.ParentViewManager = parent; this.node = _.clone(node); this.node.params = _.extend({ 'display_indented_thread': -1, @@ -1768,7 +1789,7 @@ openerp.mail = function (session) { this.domain = this.node.params && this.node.params.domain || []; - if (!this.__parentedParent.is_action_enabled('edit')) { + if (!this.ParentViewManager.is_action_enabled('edit')) { this.node.params.show_link = false; } }, @@ -1839,12 +1860,20 @@ openerp.mail = function (session) { */ init: function (parent, action) { this._super(parent, action); + this.ActionManager = parent; this.action = _.clone(action); this.domain = this.action.params.domain || this.action.domain || []; this.context = _.extend(this.action.params.context || {}, this.action.context || {}); + // filter some parameters that we will propagate as search_default this.defaults = {}; + for (var key in this.action.context.params) { + if (_.indexOf(['model', 'res_id'], key) == -1) { + continue; + } + this.context['search_default_' + key] = this.action.context.params[key]; + } for (var key in this.context) { if (key.match(/^search_default_/)) { this.defaults[key.replace(/^search_default_/, '')] = this.context[key]; @@ -1872,23 +1901,6 @@ openerp.mail = function (session) { }, /** - * crete an object "related_menu" - * contain the menu widget and the the sub menu related of this wall - */ - do_reload_menu_emails: function () { - var menu = this.__parentedParent.__parentedParent.menu; - // return this.rpc("/web/menu/load", {'menu_id': 100}).done(function(r) { - // _.each(menu.data.data.children, function (val) { - // if (val.id == 100) { - // val.children = _.find(r.data.children, function (r_val) {return r_val.id == 100;}).children; - // } - // }); - // var r = menu.data; - // window.setTimeout(function(){menu.do_reload();}, 0); - // }); - }, - - /** * Load the mail.message search view * @param {Object} defaults ?? */ diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 7e7d772397a..ab82d650f30 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -144,7 +144,9 @@ <t t-foreach='widget.recipients' t-as='recipient'> <label t-attf-title="Add as recipient and follower (reason: #{recipient.reason})"> <input type="checkbox" t-att-checked="recipient.checked ? 'checked' : undefined" t-att-data="recipient.email_address"/> - <t t-raw="recipient.name"/> (<t t-raw="recipient.email_address"/>) + <t t-raw="recipient.name"/> + <t t-if="recipient.email_address">(<t t-raw="recipient.email_address"/>)</t> + <t t-if="!recipient.email_address">(no email address)</t> </label> </t> </div> diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index f3317223f1d..5ad3ff09bb3 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -19,7 +19,7 @@ </div> <div class='oe_follower_title_box'> <h4 class='oe_follower_title'>Followers</h4> - <button t-if="widget.view_is_editable" href='#' class="oe_invite">Invite people</button> + <a t-if="widget.view_is_editable" href='#' class="oe_invite">Add others</a> </div> <div class="oe_follower_list"></div> </div> |
