Browse Source

[FIX] fix error channel_seen function in base.js

[FIX] fix error inline method in base.js
[ADD] add css file for make grey color for link and display recipients when overmouse
[IMP] add "To:" before recipients and make link on recipient name
[DOC] add info about old messages in index.rst
pull/12/head
x620 8 years ago
parent
commit
bc20db1c54
  1. 4
      mail_base/static/src/js/base.js
  2. 3
      mail_to/doc/index.rst
  3. 9
      mail_to/static/src/css/mail_to.css
  4. 10
      mail_to/static/src/xml/recipient.xml
  5. 1
      mail_to/templates.xml

4
mail_base/static/src/js/base.js

@ -845,7 +845,7 @@ chat_manager.undo_mark_as_read = function (message_ids, channel) {
chat_manager.mark_channel_as_seen = function (channel) {
if (channel.unread_counter > 0 && channel.type !== 'static') {
chat_manager.mail_tools.update_channel_unread_counter(channel, 0);
chat_manager.mail_tools.channel_seen(channel);
channel_seen(channel);
}
};
chat_manager.get_channels = function () {
@ -1043,7 +1043,7 @@ chat_manager.get_channels_preview = function (channels) {
});
};
chat_manager.get_message_body_preview = function (message_body) {
return chat_manager.mail_tools.parse_and_transform(message_body, inline);
return chat_manager.mail_tools.parse_and_transform(message_body, chat_manager.mail_tools.inline);
};
chat_manager.search_partner = function (search_val, limit) {
return PartnerModel.call('im_search', [search_val, limit || 20], {}, {shadow: true}).then(function(result) {

3
mail_to/doc/index.rst

@ -6,4 +6,5 @@ Usage
=====
* Open Discuss menu
* All messages have Recipients info
* All messages have Recipients info
* For messages created before install module it not will work where the recipients is not set

9
mail_to/static/src/css/mail_to.css

@ -0,0 +1,9 @@
.grey {
color: grey;
}
.o_mail_thread .o_thread_message span.recipients_info {
opacity: 0;
}
.o_mail_thread .o_thread_message:hover span.recipients_info {
opacity: 1;
}

10
mail_to/static/src/xml/recipient.xml

@ -1,10 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<template>
<t t-extend="mail.ChatThread.Message">
<t t-jquery="p[class=o_mail_info]>span" t-operation="before">
<t t-jquery="p[class=o_mail_info]>span" t-operation="after">
<span class="recipients_info">
<t t-if="message.partner_ids.length > 0">To: </t>
<t t-foreach="message.partner_ids" t-as="p">
<i t-att-data-message-id="message.id" title="Recipients Info" t-esc="p[1]"/>
<a t-att-href="_.str.sprintf('/web?#id=%s&amp;view_type=form&amp;model=res.partner', p[0])"
t-att-data-oe-model="message.model"
t-att-data-oe-id="message.res_id"
class="grey">
<i t-att-data-message-id="message.id" title="Recipients Info" t-esc="p[1]"/>
</a>
</t>
</span>
</t>

1
mail_to/templates.xml

@ -5,6 +5,7 @@
name="mail_to_assets_backend"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_to/static/src/css/mail_to.css"/>
<script src="/mail_to/static/src/js/mail_to.js" type="text/javascript"></script>
</xpath>
</template>

Loading…
Cancel
Save