sign_image_field/static/src/xml/sign_items_image.xml

39 lines
2.3 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<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" 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-src="value" style="max-width:100%; max-height:100%; object-fit:contain;"/>
</t>
<t t-else="">
<span class="o_placeholder" style="font-size:12px !important; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1;">
<t t-esc="placeholder"/>
</span>
</t>
<t t-if="isSignItemEditable" t-call="sign.signItemConfiguration"/>
</div>
</xpath>
</t>
<t t-name="sign.imageSignItem">
<div t-att-title="role" t-attf-class="{{classes}} o_sign_sign_item o_sign_image_item" t-att-data-id="id" t-att-style="style" t-att-data-type="'image'" style="text-align:center; display:flex; align-items:center; justify-content:center;">
<div class="sign_item_body">
<t t-if="value">
<img t-att-src="value" style="max-width:100%; max-height:100%; object-fit:contain;"/>
</t>
<t t-else="">
<span class="o_placeholder" style="font-size:12px !important; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1;">
<t t-esc="placeholder"/>
</span>
</t>
<t t-if="editMode || isSignItemEditable" t-call="sign.signItemConfiguration"/>
</div>
</div>
</t>
</templates>