diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-04-15 12:34:31 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-04-15 12:34:31 +0200 |
| commit | ed4b70dfe33605fde42cccd788bb0f43ffefbec6 (patch) | |
| tree | 970ec3a89a382a0d2d8182710081206fb815ef4d /addons/mail/static/src | |
| parent | 177f51cb541f6f635d445ca24ce4453d79eb6d39 (diff) | |
| parent | 53f168daaf989d97a4e514934afc7fe04d21193b (diff) | |
[MERGE] from trunk
bzr revid: chm@openerp.com-20130415103431-y96fhba0502b6aqc
Diffstat (limited to 'addons/mail/static/src')
| -rw-r--r-- | addons/mail/static/src/css/mail.css | 6 | ||||
| -rw-r--r-- | addons/mail/static/src/css/mail_group.css | 6 | ||||
| -rw-r--r-- | addons/mail/static/src/js/mail.js | 20 | ||||
| -rw-r--r-- | addons/mail/static/src/js/mail_followers.js | 2 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail.xml | 27 | ||||
| -rw-r--r-- | addons/mail/static/src/xml/mail_followers.xml | 2 |
6 files changed, 49 insertions, 14 deletions
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 51306727a09..6bc086a5b58 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -57,6 +57,9 @@ .openerp .oe_mail .oe_msg.oe_msg_nobody{ background: #F8F8F8; } +.openerp .oe_mail .oe_msg.oe_msg_notification{ + background: #F8F8F8; +} .openerp .oe_mail .oe_msg .oe_msg_left{ position: absolute; left:0; top: 0; bottom: 0; width: 40px; @@ -568,7 +571,6 @@ text-shadow: none; width: 100%; } -.openerp .oe_followers button.oe_invite, .openerp .oe_followers button.oe_follower.oe_following{ color: white; background-color: #3465A4; @@ -626,6 +628,8 @@ height: 32px; overflow: hidden; white-space: nowrap; + text-overflow: ellipsis; + margin-right: 10px; } .openerp .oe_followers .oe_partner img{ width: 32px; diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css index c1cefee9070..4f2b8a16dd0 100644 --- a/addons/mail/static/src/css/mail_group.css +++ b/addons/mail/static/src/css/mail_group.css @@ -14,6 +14,10 @@ padding: 0px 18px; } +.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_avatar { + padding-top: 3px; +} + /* Resize footer width */ .openerp .oe_form div.oe_mail_group_footer { max-width: 80%; @@ -21,7 +25,7 @@ /* Resize group description */ .openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_text > textarea { - height: 40px; + height: 60px; } /* ------------------------------ */ diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index ad69f7e41c3..b1a579ba057 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -217,6 +217,7 @@ openerp.mail = function (session) { this.res_id = datasets.res_id || this.context.default_res_id || false, this.parent_id = datasets.parent_id || false, this.type = datasets.type || false, + this.subtype = datasets.subtype || false, this.is_author = datasets.is_author || false, this.is_private = datasets.is_private || false, this.subject = datasets.subject || false, @@ -619,7 +620,10 @@ openerp.mail = function (session) { // have unknown names -> call message_get_partner_info_from_emails to try to find partner_id var find_done = $.Deferred(); if (names_to_find.length > 0) { - find_done = self.parent_thread.ds_thread._model.call('message_get_partner_info_from_emails', [names_to_find]); + var values = { + 'res_id': this.context.default_res_id, + } + find_done = self.parent_thread.ds_thread._model.call('message_get_partner_info_from_emails', [names_to_find], values); } else { find_done.resolve([]); @@ -665,7 +669,11 @@ openerp.mail = function (session) { var new_names_to_find = _.difference(names_to_find, names_to_remove); find_done = $.Deferred(); if (new_names_to_find.length > 0) { - find_done = self.parent_thread.ds_thread._model.call('message_get_partner_info_from_emails', [new_names_to_find, true]); + var values = { + 'link_mail': true, + 'res_id': self.context.default_res_id, + } + find_done = self.parent_thread.ds_thread._model.call('message_get_partner_info_from_emails', [new_names_to_find], values); } else { find_done.resolve([]); @@ -1208,7 +1216,7 @@ openerp.mail = function (session) { this.author_id = datasets.author_id || false; this.thread_level = (datasets.thread_level+1) || 0; datasets.partner_ids = datasets.partner_ids || []; - if (datasets.author_id && ! _.contains(datasets.partner_ids, datasets.author_id) && datasets.author_id[0]) { + if (datasets.author_id && !_.contains(_.flatten(datasets.partner_ids),datasets.author_id[0]) && datasets.author_id[0]) { datasets.partner_ids.push(datasets.author_id); } this.partner_ids = datasets.partner_ids; @@ -1389,7 +1397,10 @@ openerp.mail = function (session) { if (this.options.help) { no_message.html(this.options.help); } - no_message.appendTo(this.$el); + if (!this.$el.find(".oe_view_nocontent").length) + { + no_message.appendTo(this.$el); + } }, /** @@ -1934,6 +1945,7 @@ openerp.mail = function (session) { this.$(".oe_write_full").click(function (event) { event.stopPropagation(); var action = { + name: _t('Compose Email'), type: 'ir.actions.act_window', res_model: 'mail.compose.message', view_mode: 'form', diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index 6fc2f0fdfcd..f812844194b 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -148,8 +148,6 @@ openerp_mail_followers = function(session, mail) { }).then(self.proxy('display_generic')); }, _format_followers: function(count){ - // TDE note: why redefining _t ? - function _t(str) { return str; } var str = ''; if(count <= 0){ str = _t('No followers'); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index b26ef06f5e4..7e7d772397a 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -226,7 +226,7 @@ <!-- default layout --> <t t-name="mail.thread.message"> - <div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} #{widget.partner_ids.length == 0 ? 'oe_msg_nobody' : ''} oe_msg_#{widget.type}"> + <div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} #{widget.subtype ? '' : 'oe_msg_nobody'} oe_msg_#{widget.type}"> <div class='oe_msg_left'> <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]"> @@ -246,7 +246,11 @@ <!-- message itself --> <div class="oe_msg_content"> <h1 t-if="(widget.show_record_name or widget.subject) and !widget.thread_level" class="oe_msg_title"> - <a t-if="widget.options.show_link and widget.show_record_name" class="oe_mail_action_model" t-attf-href="#model=#{widget.model}&id=#{widget.res_id}"><t t-raw="widget.record_name"/></a><span t-if="!widget.options.show_link and widget.show_record_name"><t t-raw="widget.record_name"/></span><t t-if="widget.show_record_name">: </t> + <a t-if="widget.options.show_link and widget.show_record_name" class="oe_mail_action_model" t-attf-href="#model=#{widget.model}&id=#{widget.res_id}"> + <t t-raw="widget.record_name"/> + </a> + <span t-if="!widget.options.show_link and widget.show_record_name"><t t-raw="widget.record_name"/></span> + <t t-if="widget.show_record_name and widget.subject">: </t> <t t-if="widget.subject" t-raw="widget.subject"/> </h1> <div class="oe_msg_body"> @@ -259,13 +263,23 @@ </t> <a t-if="widget.author_id and widget.options.show_link and widget.author_id[0]" t-attf-href="#model=res.partner&id=#{widget.author_id[0]}"><t t-raw="widget.author_id[2]"/></a> <span t-if="widget.author_id and (!widget.options.show_link or !widget.author_id[0])"><t t-raw="widget.author_id[2]"/></span> - <t t-if="widget.partner_ids.length == 0"> + <t t-if="widget.type == 'notification'"> + updated document + <t t-if="widget.partner_ids.length > 0"> + <span class='oe_subtle'>•</span> + </t> + </t> + <t t-if="widget.type == 'comment' and ! widget.subtype"> logged a note </t> - <t t-if="widget.partner_ids.length > 0"> + <t t-if="(widget.type == 'comment' or widget.type == 'email') and widget.subtype"> to + <t t-if="widget.partner_ids.length == 0"> + nobody + </t> </t> - <t t-foreach="widget.partner_ids.slice(0, 3)" t-as="partner"> + <t t-if="widget.type == 'notification' or ( (widget.type == 'email' or widget.type == 'comment') and widget.subtype)" + t-foreach="widget.partner_ids.slice(0, 3)" t-as="partner"> <span t-attf-class="oe_partner_follower"> <a t-if="widget.options.show_link" t-attf-href="#model=res.partner&id=#{partner[0]}"><t t-raw="partner[1]"/></a> <t t-if="!widget.options.show_link" t-raw="partner[1]"/> @@ -275,6 +289,9 @@ <t t-if="widget.partner_ids.length > 3"> <span t-att-title="widget.extra_partners_str">and <t t-raw="widget.extra_partners_nbr"/> more</span> </t> + <t t-if="widget.type == 'notification' and widget.partner_ids.length > 0"> + notified + </t> <span class='oe_subtle'>•</span> <span t-att-title="widget.date"><t t-if="widget.timerelative" t-raw="widget.timerelative"/><t t-if="!widget.timerelative" t-raw="widget.date"/></span> <span t-if="!widget.options.readonly" class='oe_subtle'>•</span> diff --git a/addons/mail/static/src/xml/mail_followers.xml b/addons/mail/static/src/xml/mail_followers.xml index 16bef174470..f3317223f1d 100644 --- a/addons/mail/static/src/xml/mail_followers.xml +++ b/addons/mail/static/src/xml/mail_followers.xml @@ -30,7 +30,7 @@ --> <div t-name="mail.followers.partner" class='oe_partner'> <img class="oe_mail_thumbnail oe_mail_frame" t-attf-src="{record.avatar_url}"/> - <a t-attf-href="#model=res.partner&id=#{record.id}"><t t-raw="record.name"/></a> + <a t-attf-href="#model=res.partner&id=#{record.id}" t-att-title="record.name"><t t-esc="record.name"/></a> <span t-if="widget.view_is_editable" class="oe_remove_follower oe_e" title="Remove this follower" t-att-data-id="record.id">X</span> </div> |
