social/mail_preview_base/static/src/xml/preview.xml

37 lines
1.4 KiB
XML
Raw Normal View History

2021-01-26 15:06:17 +01:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-09-01 21:57:16 +02:00
<templates xml:space="preserve">
<t t-extend="DocumentViewer.Content">
<t t-jquery=".o_viewer_img" t-operation="attributes">
2021-01-26 15:06:17 +01:00
<attribute
name="t-attf-src"
>#{widget.activeAttachment.source_url}?unique=1&amp;signature=#{widget.activeAttachment.checksum}</attribute>
2020-09-01 21:57:16 +02:00
</t>
<t t-jquery=".o_viewer_pdf" t-operation="attributes">
2021-01-26 15:06:17 +01:00
<attribute
name="t-attf-src"
>/web/static/lib/pdfjs/web/viewer.html?file=#{widget.activeAttachment.source_url}</attribute>
2020-09-01 21:57:16 +02:00
</t>
<t t-jquery=".o_viewer_video > source" t-operation="attributes">
2021-01-26 15:06:17 +01:00
<attribute
name="t-attf-src"
>#{widget.activeAttachment.source_url}</attribute>
2020-09-01 21:57:16 +02:00
</t>
<t t-jquery=".o_viewer_text:first" t-operation="attributes">
2021-01-26 15:06:17 +01:00
<attribute
name="t-attf-src"
>#{widget.activeAttachment.source_url}</attribute>
2020-09-01 21:57:16 +02:00
</t>
</t>
<t t-extend="mail.Attachment">
<t t-jquery="t[t-set='has_preview']" t-operation="after">
<!--
We have added integration to text, as it was already
defined on the preview.
TODO: Set the has_preview on a function...
-->
2021-01-26 15:06:17 +01:00
<t t-set="has_preview" t-value="has_preview || attachment.has_preview" />
2020-09-01 21:57:16 +02:00
</t>
</t>
</templates>