[IMP] portal, *: review home entries templates

* account, project, purchase, sale, website_crm_partner_assign

- Create a single template to be used for all doc's entry in order to
  simplify maintenance
- Make the entire entry clickable using bts4 classes
- Fix an alignment issue between title and badge
This commit is contained in:
sri-odoo
2018-09-12 09:37:56 +02:00
committed by qsm-odoo
parent d5c66ca1fa
commit 5f71dad5e3
6 changed files with 54 additions and 39 deletions
@@ -13,11 +13,12 @@
</template>
<template id="portal_my_home_invoice" name="Portal My Home : invoice entries" inherit_id="portal.portal_my_home" priority="30">
<xpath expr="//ul[hasclass('o_portal_docs')]" position="inside">
<li t-if="invoice_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="invoice_count"/>
<a href="/my/invoices">Invoices</a>
</li>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="invoice_count" t-call="portal.portal_docs_entry">
<t t-set="title">Invoices</t>
<t t-set="url" t-value="'/my/invoices'"/>
<t t-set="count" t-value="invoice_count"/>
</t>
</xpath>
</template>
+9 -2
View File
@@ -128,13 +128,20 @@
<div class="o_portal_my_home">
<div class="oe_structure"></div>
<h3>Your Documents</h3>
<ul class="o_portal_docs list-group">
</ul>
<div class="o_portal_docs list-group">
</div>
</div>
<div class="col-lg-12 oe_structure"/>
</t>
</template>
<template id="portal_docs_entry" name="My Portal Docs Entry">
<a t-att-href="url" t-att-title="title" class="list-group-item list-group-item-action d-flex align-items-center justify-content-between">
<t t-esc="title"/>
<span class="badge badge-secondary badge-pill" t-esc="count"/>
</a>
</template>
<!--
The search bar is composed of 2 buttons : a "filter by" and a "sort by". Changing the 'sortby'
criteria will keep the number of page, query params, ... Changing the 'filterby' param will
@@ -20,15 +20,17 @@
</template>
<template id="portal_my_home" name="Portal My Home: project entries" inherit_id="portal.portal_my_home" priority="40">
<xpath expr="//ul[hasclass('o_portal_docs')]" position="inside">
<li t-if="project_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="project_count"/>
<a href="/my/projects">Projects</a>
</li>
<li t-if="task_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="task_count"/>
<a href="/my/tasks">Tasks</a>
</li>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="project_count" t-call="portal.portal_docs_entry">
<t t-set="title">Projects</t>
<t t-set="url" t-value="'/my/projects'"/>
<t t-set="count" t-value="project_count"/>
</t>
<t t-if="task_count" t-call="portal.portal_docs_entry">
<t t-set="title">Tasks</t>
<t t-set="url" t-value="'/my/tasks'"/>
<t t-set="count" t-value="task_count"/>
</t>
</xpath>
</template>
+6 -5
View File
@@ -14,11 +14,12 @@
</template>
<template id="portal_my_home_purchase" name="Portal My Home : purchase entry" inherit_id="portal.portal_my_home" priority="25">
<xpath expr="//ul[hasclass('o_portal_docs')]" position="inside">
<li t-if="purchase_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="purchase_count"/>
<a href="/my/purchase">Purchase Orders</a>
</li>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="purchase_count" t-call="portal.portal_docs_entry">
<t t-set="title">Purchase Orders</t>
<t t-set="url" t-value="'/my/purchase'"/>
<t t-set="count" t-value="purchase_count"/>
</t>
</xpath>
</template>
+11 -9
View File
@@ -19,15 +19,17 @@
</template>
<template id="portal_my_home_sale" name="Portal My Home : sales entries" inherit_id="portal.portal_my_home" priority="20">
<xpath expr="//ul[hasclass('o_portal_docs')]" position="inside">
<li t-if="quotation_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="quotation_count"/>
<a href="/my/quotes">Quotations</a>
</li>
<li t-if="order_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="order_count"/>
<a href="/my/orders">Sales Orders</a>
</li>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="quotation_count" t-call="portal.portal_docs_entry">
<t t-set="title">Quotations</t>
<t t-set="url" t-value="'/my/quotes'"/>
<t t-set="count" t-value="quotation_count"/>
</t>
<t t-if="order_count" t-call="portal.portal_docs_entry">
<t t-set="title">Sales Orders</t>
<t t-set="url" t-value="'/my/orders'"/>
<t t-set="count" t-value="order_count"/>
</t>
</xpath>
</template>
@@ -213,15 +213,17 @@
</template>
<template id="portal_my_home_lead" name="Portal My Home : lead entries" inherit_id="portal.portal_my_home" priority="15">
<xpath expr="//ul[hasclass('o_portal_docs')]" position="inside">
<li t-if="lead_count" class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="lead_count"/>
<a href="/my/leads">My Leads</a>
</li>
<li class="list-group-item">
<span class="badge badge-secondary badge-pill float-right" t-esc="opp_count"/>
<a href="/my/opportunities">My Opportunities</a>
</li>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="lead_count" t-call="portal.portal_docs_entry">
<t t-set="title">My Leads</t>
<t t-set="url" t-value="'/my/leads'"/>
<t t-set="count" t-value="lead_count"/>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">My Opportunities</t>
<t t-set="url" t-value="'/my/opportunities'"/>
<t t-set="count" t-value="opp_count"/>
</t>
</xpath>
</template>