[FIX] mail: read more show original message
Instead of html cleaned html, to allow display blockquotes opw-614729
This commit is contained in:
parent
8abd003ef0
commit
0790682296
|
@ -373,6 +373,7 @@ class mail_message(osv.Model):
|
||||||
'type': message.type,
|
'type': message.type,
|
||||||
'subtype': message.subtype_id.name if message.subtype_id else False,
|
'subtype': message.subtype_id.name if message.subtype_id else False,
|
||||||
'body': body_html,
|
'body': body_html,
|
||||||
|
'body_original': message.body if message.type == 'email' else None,
|
||||||
'model': message.model,
|
'model': message.model,
|
||||||
'res_id': message.res_id,
|
'res_id': message.res_id,
|
||||||
'record_name': message.record_name,
|
'record_name': message.record_name,
|
||||||
|
|
|
@ -225,6 +225,7 @@ openerp.mail = function (session) {
|
||||||
this.name = datasets.name || false,
|
this.name = datasets.name || false,
|
||||||
this.record_name = datasets.record_name || false,
|
this.record_name = datasets.record_name || false,
|
||||||
this.body = datasets.body || '',
|
this.body = datasets.body || '',
|
||||||
|
this.body_original = datasets.body_original || '',
|
||||||
this.vote_nb = datasets.vote_nb || 0,
|
this.vote_nb = datasets.vote_nb || 0,
|
||||||
this.has_voted = datasets.has_voted || false,
|
this.has_voted = datasets.has_voted || false,
|
||||||
this.is_favorite = datasets.is_favorite || false,
|
this.is_favorite = datasets.is_favorite || false,
|
||||||
|
@ -976,6 +977,7 @@ openerp.mail = function (session) {
|
||||||
},
|
},
|
||||||
|
|
||||||
expender: function () {
|
expender: function () {
|
||||||
|
var self = this;
|
||||||
this.$('.oe_msg_body:first').expander({
|
this.$('.oe_msg_body:first').expander({
|
||||||
slicePoint: this.options.truncate_limit,
|
slicePoint: this.options.truncate_limit,
|
||||||
expandText: _t('read more'),
|
expandText: _t('read more'),
|
||||||
|
@ -983,7 +985,15 @@ openerp.mail = function (session) {
|
||||||
detailClass: 'oe_msg_tail',
|
detailClass: 'oe_msg_tail',
|
||||||
moreClass: 'oe_mail_expand',
|
moreClass: 'oe_mail_expand',
|
||||||
lessClass: 'oe_mail_reduce',
|
lessClass: 'oe_mail_reduce',
|
||||||
});
|
afterExpand: function(){
|
||||||
|
self.$('.oe_msg_body').hide();
|
||||||
|
self.$('.oe_msg_original').show();
|
||||||
|
},
|
||||||
|
onCollapse: function(){
|
||||||
|
self.$('.oe_msg_body').show();
|
||||||
|
self.$('.oe_msg_original').hide();
|
||||||
|
},
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -257,7 +257,10 @@
|
||||||
<t t-if="widget.subject" t-esc="widget.subject"/>
|
<t t-if="widget.subject" t-esc="widget.subject"/>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="oe_msg_body">
|
<div class="oe_msg_body">
|
||||||
<t t-raw="widget.body"/>
|
<t t-raw="!widget.body_original || widget.body.length > widget.options.truncate_limit ? widget.body: widget.body_original"/>
|
||||||
|
</div>
|
||||||
|
<div t-if="widget.body_original" class="oe_msg_original" style="display:none;">
|
||||||
|
<t t-raw="widget.body_original"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="oe_msg_footer">
|
<div class="oe_msg_footer">
|
||||||
|
|
Loading…
Reference in New Issue