[MIG] attachment_preview: Migration to 15.0

This commit is contained in:
vancouver29
2022-08-23 16:36:54 +02:00
parent 2c8d04f636
commit 51dbf6e827
14 changed files with 882 additions and 506 deletions

View File

@@ -1,24 +1,47 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
<t t-extend="mail.Attachment">
<t t-jquery=".o_attachment_download" t-operation="after">
<span
t-if="!attachment.callback and attachment.url"
class="fa fa-search ml4 o_attachment_preview"
t-att-data-id="attachment.id"
t-att-data-url="attachment.url"
t-attf-title="Preview #{attachment.name} in side panel"
/>
<span
t-if="!attachment.callback and attachment.url"
class="fa fa-external-link ml4 o_attachment_preview o_attachment_preview_new_tab"
data-target="new"
t-att-data-id="attachment.id"
t-att-data-url="attachment.url"
t-attf-title="Open preview #{attachment.name} in a new tab"
/>
</t>
<t
t-name="Attachment"
t-inherit="mail.AttachmentCard"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div[hasclass('o_AttachmentCard_aside')]" position="before">
<div
class="o_AttachmentCard_aside position-relative overflow-hidden"
t-att-class="{ 'o-has-multiple-action d-flex flex-column': !attachmentCard.attachmentList.composerView and attachmentCard.attachment.isEditable }"
>
<div
t-if="attachmentCard.attachment.downloadUrl"
class="o_AttachmentCard_asideItem d-flex justify-content-center align-items-center ml4 o_attachment_preview"
t-att-data-id="attachmentCard.attachment.id"
t-att-data-url="attachmentCard.attachment.defaultSource"
t-on-click="attachmentCard._onPreviewAttachment"
t-att-data-original-title="attachmentCard.attachment.name"
t-attf-title="Preview {{attachmentCard.attachment.displayName}} in side panel"
tabindex="0"
role="menuitem"
aria-label="Preview"
>
<i class="fa fa-search" />
</div>
<div
t-if="attachmentCard.attachment.downloadUrl"
class="o_AttachmentCard_asideItem d-flex justify-content-center align-items-center ml4 o_attachment_preview o_attachment_preview_new_tab"
data-target="new"
t-att-data-id="attachmentCard.attachment.id"
t-att-data-url="attachmentCard.attachment.defaultSource"
t-on-click="attachmentCard._onPreviewAttachment"
t-att-data-original-title="attachmentCard.attachment.name"
t-attf-title="Open preview {{attachmentCard.attachment.name}} in a new tab"
tabindex="0"
role="menuitem"
aria-label="Open in new page"
>
<i class="fa fa-external-link" />
</div>
</div>
</xpath>
</t>
<t t-name="attachment_preview.AttachmentPreviewWidget">
@@ -38,7 +61,6 @@
<button
class="btn btn-sm btn-secondary pull-left ml8 attachment_preview_popout"
><i class="fa fa-external-link" /></button>
<button
class="btn btn-sm btn-secondary pull-right attachment_preview_close"
><i class="fa fa-times" /></button>