diff options
| author | Kishan Gajjar <kig@odoo.com> | 2017-09-08 11:10:27 +0530 |
|---|---|---|
| committer | fwi-odoo <fwi@odoo.com> | 2017-09-13 12:46:52 +0200 |
| commit | c1fa3b8ab3dfa1306dbdd3b6dc910405a3357d16 (patch) | |
| tree | 40fe4a46d24b7d2fab067569f36269f8e1a5a6aa /addons/mail/static/src/xml/thread.xml | |
| parent | 6552ae68d11329374adee58b9b8d502e625372ba (diff) | |
[IMP] mail: pdf preview and small improvement
When you click on pdf it should show preview of pdf.
Don't show the previous/next arrows if there is only one attachment.
Diffstat (limited to 'addons/mail/static/src/xml/thread.xml')
| -rw-r--r-- | addons/mail/static/src/xml/thread.xml | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 43cf896e1cc..8237658e99e 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -42,6 +42,7 @@ <i class="fa fa-spinner fa-spin fa-3x fa-fw" aria-hidden="true"/> </div> <img t-if="widget.activeAttachment.type == 'image'" class="o_viewer_img" t-attf-src="/web/image/#{widget.activeAttachment.id}?unique=1"/> + <iframe class="mb48 o_viewer_pdf" t-if="widget.activeAttachment.type == 'application/pdf'" t-attf-src="/web/static/lib/pdfjs/web/viewer.html?file=/web/content/#{widget.activeAttachment.id}" /> <video t-if="widget.activeAttachment.type == 'video'" class="o_viewer_video" controls="controls"> <source t-attf-src="/web/image/#{widget.activeAttachment.id}" t-att-data-type="widget.activeAttachment.mimetype"/> </video> @@ -72,12 +73,15 @@ <t t-name="DocumentViewer"> <div class="modal o_modal_fullscreen" tabindex="-1" role="dialog" aria-hidden="true"> <t t-call="DocumentViewer.Content"/> - <a class="arrow arrow-left move_previous" href="#"> - <span class="fa fa-3x fa-chevron-left"/> - </a> - <a class="arrow arrow-right move_next" href="#"> - <span class="fa fa-3x fa-chevron-right"/> - </a> + + <t t-if="widget.attachment.length != 1"> + <a class="arrow arrow-left move_previous" href="#"> + <span class="fa fa-3x fa-chevron-left"/> + </a> + <a class="arrow arrow-right move_next" href="#"> + <span class="fa fa-3x fa-chevron-right"/> + </a> + </t> </div> </t> <t t-name="PrintImage"> @@ -281,6 +285,18 @@ </div> </div> </t> + <t t-elif="attachment.mimetype == 'application/pdf'"> + <div class="o_image_box"> + <div class="o_image_box"> + <img src="/web/static/src/img/mimetypes/pdf.png"/> + <div class="o_image_overlay o_attachment_view" t-att-data-id="attachment.id"> + <a class="o_attachment_download" t-att-href='attachment.url' target="_blank"> + <i t-attf-class="fa fa-2x fa-arrow-circle-o-down" title="Download this PDF" aria-hidden="true"></i> + </a> + </div> + </div> + </div> + </t> <t t-else=""> <div class="o_image_box"> <img class="o_image" t-att-data-mimetype="attachment.mimetype"/> |
