Browse Source

[FIX] default icons opacity - 0.4, mouseover on message - 0.7, mouseover on icon - 1

[FIX] more recipients moved to tooltip
pull/12/head
x620 9 years ago
parent
commit
5c3ebca3c6
  1. 26
      mail_to/static/src/css/mail_to.css
  2. 15
      mail_to/static/src/js/mail_to.js
  3. 22
      mail_to/static/src/xml/recipient.xml

26
mail_to/static/src/css/mail_to.css

@ -8,26 +8,16 @@
.o_mail_thread .o_thread_message span.recipients_info,
.o_mail_thread .o_thread_message i.o_thread_message_star,
.o_mail_thread .o_thread_message i.o_thread_message_reply,
.o_mail_thread .o_thread_message i.o_thread_message_needaction
{
opacity: 0.5;
.o_mail_thread .o_thread_message i.o_thread_message_needaction {
opacity: 0.4;
}
.o_mail_thread .o_thread_message:hover span.recipients_info,
.o_mail_thread .o_thread_message:hover i.o_thread_message_star,
.o_mail_thread .o_thread_message:hover i.o_thread_message_reply,
.o_mail_thread .o_thread_message:hover i.o_thread_message_needaction
{
opacity: 1;
}
.more_4 {
display: none;
.o_mail_thread .o_thread_message:hover i.o_thread_message_needaction {
opacity: 0.7;
}
.more_4_link {
display: block;
}
.o_mail_thread .o_thread_message:hover span.more_4_link {
display: none;
.o_mail_thread .o_thread_message:hover span.recipients_info {
opacity: 1;
}
.o_mail_thread .o_thread_message:hover span.more_4 {
display: block;
}

15
mail_to/static/src/js/mail_to.js

@ -8,6 +8,21 @@ odoo.define('mail_to.MailTo', function (require) {
var msg = this._super(data);
msg.partner_ids = data.partner_ids;
// msg.needaction_partner_ids = data.needaction_partner_ids;
var more_recipients = '';
// value which define more recipients
msg.more_recipients_value = 4;
for (var i = 0; i < msg.partner_ids.length; i++){
if (i >= msg.more_recipients_value){
// append names
more_recipients += msg.partner_ids[i][1];
// separate them with semicolon
if (i < msg.partner_ids.length - 1){
more_recipients += '; ';
}
}
}
msg.more_recipients = more_recipients;
return msg;
}
});

22
mail_to/static/src/xml/recipient.xml

@ -5,20 +5,16 @@
<span class="recipients_info">
<t t-if="message.partner_ids.length > 0">To: </t>
<t t-foreach="message.partner_ids.length" t-as="i">
<a t-att-href="_.str.sprintf('/web?#id=%s&amp;view_type=form&amp;model=res.partner', message.partner_ids[i][0])"
class="recipient_link">
<t t-if="i &lt; 4">
<t t-if="i &lt; message.more_recipients_value">
<a t-att-href="_.str.sprintf('/web?#id=%s&amp;view_type=form&amp;model=res.partner', message.partner_ids[i][0])" class="recipient_link">
<i t-esc="message.partner_ids[i][1]"/><t t-if="i &lt; message.partner_ids.length - 1">; </t>
</t>
<t t-if="i &gt; 3">
<span class="more_4">
<i t-esc="message.partner_ids[i][1]"/><t t-if="i &lt; message.partner_ids.length - 1">; </t>
</span>
</t>
<t t-if="i == 4">
<span class="more_4_link"><b>and <t t-esc="message.partner_ids.length - 4"> more...</t></b></span>
</t>
</a>
</a>
</t>
</t>
<t t-if="message.partner_ids.length &gt; message.more_recipients_value - 1">
<span t-att-title="message.more_recipients">
and <t t-esc="message.partner_ids.length - message.more_recipients_value"/> more
</span>
</t>
</span>
</t>

Loading…
Cancel
Save