refactor: minify XML template structure for image sign items

This commit is contained in:
Suherdy Yacob 2026-04-07 09:19:52 +07:00
parent 6272b9df6f
commit 15802feeee

View File

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<templates>
<t t-name="sign.signItem" t-inherit="sign.signItem" t-inherit-mode="extension">
<xpath expr="//t[@t-if=&quot;type == 'selection'&quot;]" position="after">
<t t-if="type == 'image'" t-call="sign.imageSignItem"/>
</xpath>
<xpath expr="//div[@t-if=&quot;type == 'selection'&quot;]" position="after">
<div t-if="type == 'image'" t-att-data-id="id" t-att-title="role" t-attf-class="{{classes}} o_sign_sign_item o_sign_image_item {{value ? 'o_sign_image_loading_container' : ''}}" t-att-style="style" t-att-data-value="value" t-att-data-type="'image'" style="text-align:center; display:flex; align-items:center; justify-content:center;">
<xpath expr="//t[@t-if=&quot;type == 'selection'&quot;]" position="after"><t t-if="type == 'image'" t-call="sign.imageSignItem"/></xpath>
<xpath expr="//div[@t-if=&quot;type == 'selection'&quot;]" position="after"><div t-if="type == 'image'" t-att-data-id="id" t-att-title="role" t-attf-class="{{classes}} o_sign_sign_item o_sign_image_item {{value ? 'o_sign_image_loading_container' : ''}}" t-att-style="style" t-att-data-value="value" t-att-data-type="'image'" style="text-align:center; display:flex; align-items:center; justify-content:center;">
<input type="file" accept="image/*" class="o_sign_image_upload_input" style="display:none"/>
<t t-if="value">
<img t-att-data-src="value" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="o_sign_image_lazy o_sign_image_loading" style="max-width:100%; max-height:100%; object-fit:contain; opacity: 0; transition: opacity 0.3s;"/>
@ -16,8 +13,7 @@
</span>
</t>
<t t-if="isSignItemEditable" t-call="sign.signItemConfiguration"/>
</div>
</xpath>
</div></xpath>
</t>
<t t-name="sign.imageSignItem">