Files
enterprise-addons/sign/views/sign_portal_templates.xml
T

216 lines
12 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_my_home_menu_sign" name="Portal layout : sign menu entries" inherit_id="portal.portal_breadcrumbs" priority="60">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'signatures' or my_sign_item" t-attf-class="breadcrumb-item #{'active ' if not sign_requests else ''}">
<a t-if="my_sign_item" t-attf-href="/my/signatures?{{ keep_query() }}">Signature requests</a>
<t t-else="">Signature requests</t>
</li>
<li t-if="my_sign_item" class="breadcrumb-item active">
<span t-field="my_sign_item.reference"/>
</li>
</xpath>
</template>
<template id="portal_my_home_sign" name="Signatures" customize_show="True" inherit_id="portal.portal_my_home" priority="60">
<xpath expr="//div[hasclass('o_portal_docs')]" position="before">
<t t-set="portal_alert_category_enable" t-value="True"/>
<t t-set="portal_client_category_enable" t-value="True"/>
</xpath>
<div id="portal_alert_category" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="bg_color" t-value="'alert alert-primary align-items-center'"/>
<t t-set="title">Document(s) to sign</t>
<t t-set="url" t-value="'/my/signatures'"/>
<t t-set="placeholder_count" t-value="'to_sign_count'"/>
<t t-set="show_count" t-value="True"/>
</t>
</div>
<div id="portal_client_category" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="icon" t-value="'/sign/static/img/sign_template.svg'"/>
<t t-set="title">Signature requests</t>
<t t-set="text">Access your signed documents</t>
<t t-set="url" t-value="'/my/signatures'"/>
<t t-set="placeholder_count" t-value="'sign_count'"/>
</t>
</div>
</template>
<template id="sign_portal_my_requests" name="My Signatures">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Signatures</t>
</t>
<div t-if="not grouped_signatures" class="alert alert-warning" role="alert">
There are no signatures request.
</div>
<t t-if="grouped_signatures" t-call="portal.portal_table">
<thead>
<tr>
<th>Document</th>
<th class="text-center">Sent on</th>
<th class="text-center">Signature Date</th>
<th class="text-center">Status</th>
<th/>
</tr>
</thead>
<t t-foreach="grouped_signatures" t-as="signature_requests">
<tbody>
<tr t-if="not groupby =='none'" class="table-light">
<th t-if="groupby != 'none'" colspan="5">
<span t-field="signature_requests[0].sudo().state"/>
</th>
</tr>
</tbody>
<tbody>
<tr t-foreach="signature_requests" t-as="sign_request_item">
<td>
<a t-attf-href="/my/signature/#{sign_request_item.id}?{{ keep_query() }}">
<t t-esc="sign_request_item.reference"/>
</a>
</td>
<td class="text-center">
<span t-field="sign_request_item.sign_request_id.create_date" t-options='{"widget": "date"}'/>
</td>
<td class="text-center">
<span t-field="sign_request_item.signing_date"/>
</td>
<td class="text-center lh-1">
<span t-attf-class="badge rounded-pill
{{ 'text-bg-success' if sign_request_item.sign_request_id.sudo().state == 'signed'
else 'text-bg-success' if sign_request_item.sudo().state == 'completed'
else 'text-bg-danger' if sign_request_item.sudo().state == 'canceled'
else 'text-bg-info' }}" >
<t t-if="sign_request_item.sign_request_id.sudo().state == 'signed'">
Fully Signed
</t>
<t t-else="">
<t t-esc="dict(sign_request_item.fields_get(allfields=['state'])['state']['selection']).get(sign_request_item.state)"/>
</t>
</span>
</td>
<td class="text-end">
<t t-if="sign_request_item.state != 'canceled'">
<t t-set="fully_signed" t-value="sign_request_item.state == 'completed' "/>
<a class="btn btn-sm btn-primary"
t-attf-href="/sign/document/{{sign_request_item.sign_request_id.id}}/{{sign_request_item.access_token}}?portal=1"
t-att-target="'_blank' if fully_signed else ''">
<div t-if="fully_signed">View</div>
<div t-else="">Sign</div>
</a>
</t>
</td>
</tr>
</tbody>
</t>
</t>
</t>
</template>
<template id="sign_portal_my_request" name="My Signature">
<t t-call="portal.portal_layout">
<h3 class="mb-3">
<span t-field="my_sign_item.reference"/>
<span t-field="my_sign_item.sign_request_id.state" class="badge rounded-pill text-bg-info fs-6 float-end"
title="Current status of the signature request"/>
</h3>
<div class="o_sign_portal">
<div class="row mb-3" t-if="my_sign_item.partner_id">
<div class="col-12 col-md-6">
<p class="o_portal_category text-muted">Summary</p>
<div>
<strong>Creation Date:</strong>
<span t-field="my_sign_item.create_date" t-options="{'widget': 'date'}"/>
</div>
<div>
<t t-set="request_item" t-value="my_sign_item.sign_request_id.request_item_ids"/>
<!-- We show progress for all the signers when there are multiple of them. -->
<t t-if="len(request_item) > 1">
<t t-foreach="request_item" t-as="sign">
<div class="_status clearfix" t-att-data-id="sign.id">
<t t-if="sign.state == 'sent'">
<b>
<t t-esc="sign.partner_id.name if sign.partner_id else 'Public user'"/>
</b>
<t t-if="sign.role_id">
- <t t-esc="sign.role_id.name"/>
</t> -
<em>
Waiting Signature
</em>
<em t-if="not sign.is_mail_sent">
<br/>(the email access has not been sent)
</em>
</t>
<t t-if="sign.state == 'canceled'">
<b>
<t t-esc="sign.partner_id.name"/>
</b>
<t t-if="sign.role_id">
- <t t-esc="sign.role_id.name"/>
</t> -
<em>Cancelled</em>
</t>
<t t-if="sign.state == 'completed'">
<b>
<t t-esc="sign.partner_id.name"/>
</b>
<t t-if="sign.role_id">
- <t t-esc="sign.role_id.name"/>
</t> -
<em>Signed on <span t-field="sign.signing_date"/></em>
</t>
</div>
</t>
</t>
<!-- Don't need to show all the details in case of only one signer. -->
<t t-else="">
<t t-if="request_item.state == 'completed'">
<strong>Signed on: </strong>
<t t-out="request_item.signing_date" t-options="{'widget': 'date'}"/>
</t>
</t>
</div>
<div>
<strong>Sent by: </strong>
<t t-out="my_sign_item.create_uid.name"/>
</div>
<div t-if="my_sign_item.sign_request_id.validity">
<strong>Expiry Date: </strong>
<t t-out="my_sign_item.sign_request_id.validity" t-options="{'widget': 'date'}"/>
</div>
</div>
</div>
<div class="o_sign_button">
<t t-set="is_read_only" t-value="my_sign_item.state in ['completed', 'canceled']"/>
<a t-att-href="url" class="btn btn-primary btn-block" t-att-target="'_blank' if is_read_only else ''">
<div class="o_sign_button_content" t-if="is_read_only">View Document</div>
<div class="o_sign_button_content" t-else="">Sign</div>
</a>
<a t-if="my_sign_item.sign_request_id.state == 'signed'"
class="btn btn-light ms-1"
t-attf-href="/sign/download/{{my_sign_item.sign_request_id.id}}/{{my_sign_item.sign_request_id.access_token}}/completed"
title="Download"
target="_blank"
role="button">
<i class="fa fa-download"/>
</a>
</div>
</div>
<hr/>
<div>
<h3>Communication history</h3>
<t t-call="portal.message_thread">
<t t-set="object" t-value="my_sign_item.sign_request_id"/>
<t t-set="token" t-value="my_sign_item.sign_request_id.access_token"/>
<t t-set="pid" t-value="pid"/>
<t t-set="hash" t-value="hash"/>
</t>
</div>
</t>
</template>
</odoo>