Browse Source

[IMP] :hover for move button

[IMP] highlight move button for moved messages
pull/2/head
Ivan Yelizariev 10 years ago
parent
commit
6549415f0a
  1. 5
      mail_move_message_models.py
  2. 9
      static/src/css/mail_move_message.css
  3. 7
      static/src/js/mail_move_message.js
  4. 2
      static/src/xml/mail_move_message_main.xml

5
mail_move_message_models.py

@ -181,3 +181,8 @@ class mail_message(models.Model):
extended_name = ' [%s] ID %s' % (record.get('model', 'UNDEF'), record.get('res_id', 'UNDEF'))
res.append((record['id'], name + extended_name))
return res
def _message_read_dict(self, cr, uid, message, parent_id=False, context=None):
res = super(mail_message, self)._message_read_dict(cr, uid, message, parent_id, context)
res['is_moved'] = bool(message.moved_by_user_id)
return res

9
static/src/css/mail_move_message.css

@ -0,0 +1,9 @@
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_move.oe_moved a {
color: #ffefe;
text-shadow: 0px 1px #961b1b,0px -1px #961b1b, -1px 0px #961b1b, 1px 0px #961b1b, 0px 3px 3px rgba(0,0,0,0.1);
}
.openerp .oe_mail .oe_msg .oe_msg_icons .oe_move:hover a {
color: #ffa1a1;
text-shadow: 0px 1px #ff0000,0px -1px #ff0000, -1px 0px #ff0000, 1px 0px #ff0000, 0px 3px 3px rgba(0,0,0,0.1);
}

7
static/src/js/mail_move_message.js

@ -26,4 +26,11 @@ openerp.mail_move_message = function (session) {
this.do_action(action);
}
})
mail.MessageCommon.include({
init: function (parent, datasets, options) {
this._super(parent, datasets, options);
this.is_moved = datasets.is_moved || false;
}
})
}

2
static/src/xml/mail_move_message_main.xml

@ -2,7 +2,7 @@
<template>
<t t-extend="mail.thread.message">
<t t-jquery=".oe_msg_icons" t-operation="append">
<span t-attf-class="oe_move"><a title="Move to thread" class="oe_e">f</a></span>
<span t-attf-class="oe_move #{widget.is_moved?'oe_moved':''}"><a title="Move to thread" class="oe_e">f</a></span>
</t>
</t>
</template>
Loading…
Cancel
Save