[MIG] document_url: Migration to 17.0

This commit is contained in:
Franco Leyes
2024-05-22 15:42:24 -03:00
parent 5dac599ec5
commit 42167a5d50
4 changed files with 94 additions and 91 deletions

View File

@@ -4,67 +4,67 @@
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<templates>
<t t-inherit="mail.AttachmentBox" t-inherit-mode="extension" owl="1">
<xpath
expr="//button[hasclass('o_AttachmentBox_buttonAdd')]"
position="replace"
>
<div align="center">
<button
class="o_AttachmentBox_buttonAdd btn btn-link"
type="button"
t-on-click="attachmentBoxView.onClickAddAttachment"
t-att-disabled="!attachmentBoxView.chatter.isTemporary and !attachmentBoxView.chatter.hasWriteAccess"
>
<i class="fa fa-plus-square" />
Attach files
</button>
<button
type="button"
class="o_add_url_button btn btn-link"
t-on-click="attachmentBoxView._onAddUrl"
>
<i class="fa fa-plus-square" />
Add URL
</button>
</div>
<t t-inherit="mail.Chatter" t-inherit-mode="extension">
<xpath expr="//AttachmentList//..//FileUploader/t" position="replace">
<t t-set-slot="toggler">
<div class="d-flex mx-auto">
<button
class="btn btn-link"
type="button"
t-att-disabled="!state.thread.hasWriteAccess"
>
<i class="fa fa-plus-square" />
Attach files
</button>
<button
class="btn btn-link"
type="button"
t-att-disabled="!state.thread.hasWriteAccess"
t-on-click="_onAddUrl"
>
<i class="fa fa-plus-square" />
Add URL
</button>
</div>
</t>
</xpath>
</t>
<t t-inherit="mail.AttachmentCard" t-inherit-mode="extension" owl="1">
<t t-inherit="mail.AttachmentList" t-inherit-mode="extension">
<xpath
expr="//button[hasclass('o_AttachmentCard_asideItemDownload')]"
expr="//div[contains(@class, 'o-mail-AttachmentCard-aside')]//button[@title='Download']"
position="attributes"
>
<attribute name="t-if">attachment.mimetype != 'application/link'</attribute>
</xpath>
<xpath
expr="//div[hasclass('o-mail-AttachmentCard-aside')]//button[@title='Download']"
position="after"
>
<button
class="btn d-flex justify-content-center align-items-center w-100 h-100 rounded-0"
t-attf-class="bg-300"
t-on-click="() => window.open(attachmentUrl, '_blank')"
title="Open"
t-if="attachment.mimetype === 'application/link'"
target="_blank"
>
<i class="fa fa-link" role="img" aria-label="Open" />
</button>
</xpath>
<xpath
expr="//div[hasclass('o-mail-AttachmentCard-image')]"
position="attributes"
>
<attribute
name="t-if"
>attachmentCard.attachment.mimetype != 'application/link'</attribute>
>attachment.mimetype !== 'application/link'</attribute>
</xpath>
<xpath
expr="//button[hasclass('o_AttachmentCard_asideItemDownload')]"
position="after"
>
<button
class="o_AttachmentCard_asideItem o_AttachmentCard_asideItemDownload btn d-flex justify-content-center align-items-center w-100 h-100 rounded-0 bg-300"
t-on-click="() => window.open(attachmentUrl, '_blank')"
title="Open"
t-if="attachmentCard.attachment.mimetype === 'application/link'"
target="new"
>
<i class="fa fa-link" role="img" aria-label="Open" />
</button>
</xpath>
<xpath expr="//div[hasclass('o_AttachmentCard_image')]" position="attributes">
<attribute
name="t-if"
>attachmentCard.attachment.mimetype != 'application/link'</attribute>
</xpath>
<xpath expr="//div[hasclass('o_AttachmentCard_image')]" position="before">
<xpath expr="//div[hasclass('o-mail-AttachmentCard-image')]" position="before">
<a
class="o_Attachment_url_ico o_image flex-shrink-0 m-1"
t-att-href="attachmentUrl"
target="new"
t-if="attachmentCard.attachment.mimetype=='application/link'"
target="_blank"
t-if="attachment.mimetype === 'application/link'"
>
<i class="fa fa-link fa-2x" />
</a>