[IMP] mail: preview documents (doc, pdf...) on openchatter
bzr revid: chm@openerp.com-20121024140910-88gj3t5efhc7pzzi
This commit is contained in:
@@ -187,6 +187,9 @@
|
||||
.openerp .oe_mail .oe_msg_attachments .oe_attachment:nth-child(even){
|
||||
background: #F4F5FA;
|
||||
}
|
||||
.openerp .oe_mail .oe_msg_images {
|
||||
display: block;
|
||||
}
|
||||
.openerp .oe_mail .oe_msg_footer button{
|
||||
display: inline;
|
||||
height: 24px;
|
||||
|
||||
@@ -636,11 +636,16 @@ openerp.mail = function(session) {
|
||||
}
|
||||
for (var l in this.attachment_ids) {
|
||||
var attach = this.attachment_ids[l];
|
||||
attach['url'] = mail.ChatterUtils.get_attachment_url(this.session, attach);
|
||||
|
||||
if((attach.filename || attach.name).match(/[.](jpg|jpg|gif|png|tif|svg)$/i)) {
|
||||
attach.is_image = true;
|
||||
|
||||
}
|
||||
attach['url'] = mail.ChatterUtils.get_attachment_url(this.session, attach);
|
||||
if((attach.filename || attach.name).match(/[.](pdf|doc|docx|xls|xlsx|ppt|pptx|psd|tiff|dxf|svg)$/i)) {
|
||||
attach.is_document = true;
|
||||
attach.url_escape = escape(attach.url);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
-->
|
||||
<t t-name="mail.thread.message.attachments">
|
||||
<span t-attf-class="oe_msg_attachments">
|
||||
<t t-foreach="widget.attachment_ids" t-as="attachment" t-if="!attachment.is_image">
|
||||
<t t-foreach="widget.attachment_ids" t-as="attachment" t-if="!attachment.is_image and !attachment.is_document">
|
||||
<div class="oe_attachment">
|
||||
<span t-if="(attachment.upload or attachment.percent_loaded<100)" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}" t-attf-name="{attachment.name || attachment.filename}">
|
||||
<div class="oe_upload_in_process">
|
||||
@@ -97,6 +97,14 @@
|
||||
</a>
|
||||
</t>
|
||||
</span>
|
||||
<span t-attf-class="oe_msg_document">
|
||||
<t t-foreach="widget.attachment_ids" t-as="attachment" t-if="attachment.is_document">
|
||||
<a t-att-href="attachment.url" t-attf-title="{(attachment.name || attachment.filename) + (attachment.date?' \n('+attachment.date+')':'' )}">
|
||||
<t t-raw="attachment.name || attachment.filename"/>
|
||||
</a>
|
||||
<iframe t-attf-src="http://docs.google.com/viewer?url=#{ attachment.url_escape }&embedded=true" width="600" height="400" style="border: none;"></iframe>
|
||||
</t>
|
||||
</span>
|
||||
</t>
|
||||
|
||||
<t t-name="mail.thread.message.private">
|
||||
|
||||
Reference in New Issue
Block a user