[IMP] portal,various: factorize "back to edit mode"

The same code was duplicated in several places. This commit creates a single template for it.

PR: #26801
task-1876864
This commit is contained in:
Sébastien Theys
2018-09-19 12:00:37 +02:00
committed by Romain Derie
parent a2456b20e9
commit 36d1b456d2
3 changed files with 16 additions and 21 deletions
+7
View File
@@ -73,6 +73,13 @@
</ol>
</template>
<template id="portal_back_in_edit_mode" name="Back to edit mode">
<div t-ignore="true" class="text-center">
This is a preview of the customer portal. <a t-att-href="backend_url"><i class="fa fa-arrow-right"/> Back to edit mode</a>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> &#215; </button>
</template>
<template id="portal_layout" name="Portal Layout">
<t t-call="portal.frontend_layout">
<div t-if="o_portal_fullwidth_alert" class="alert alert-info alert-dismissible rounded-0 fade show d-print-none css_editable_mode_hidden">
@@ -69,13 +69,9 @@
<t t-set="wrapwrap_classes" t-value="'o_portal_bg_dark'"/>
<t t-set="o_portal_fullwidth_alert" groups="project.group_project_user">
<div t-ignore="true" class="text-center">
This is a preview of the customer portal <i class="fa fa-chevron-right"/>
<a title="Edit in the backend" target="_blank" t-att-href="'/web#return_label=Website&amp;model=project.project&amp;id=%s&amp;view_type=form' % (project.id)">
<b>Back in edit mode</b>.
</a>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">&#215;</button>
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#return_label=Website&amp;model=project.project&amp;id=%s&amp;view_type=form' % (project.id)"/>
</t>
</t>
<t t-call="portal.portal_record_layout">
@@ -174,13 +170,9 @@
<t t-set="wrapwrap_classes" t-value="'o_portal_bg_dark'"/>
<t t-set="o_portal_fullwidth_alert" groups="project.group_project_user">
<div t-ignore="true" class="text-center">
This is a preview of the customer portal <i class="fa fa-chevron-right"/>
<a title="Edit in the backend" target="_blank" t-att-href="'/web#return_label=Website&amp;model=project.task&amp;id=%s&amp;view_type=form' % (task.id)">
<b>Back in edit mode</b>.
</a>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">&#215;</button>
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#return_label=Website&amp;model=project.task&amp;id=%s&amp;view_type=form' % (task.id)"/>
</t>
</t>
<t t-call="portal.portal_record_layout">
+3 -7
View File
@@ -118,13 +118,9 @@
<t t-set="wrapwrap_classes" t-value="'o_portal_bg_dark'"/>
<t t-set="o_portal_fullwidth_alert" groups="sales_team.group_sale_salesman">
<div t-ignore="true" class="text-center">
This is a preview of the customer portal <i class="fa fa-chevron-right"/>
<a t-att-href="'/web#return_label=Website&amp;model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (sale_order._name, sale_order.id, sale_order.env.ref('sale.action_quotations').id)">
<b>Back in edit mode</b>.
</a>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> &#215; </button>
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#return_label=Website&amp;model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (sale_order._name, sale_order.id, sale_order.env.ref('sale.action_quotations').id)"/>
</t>
</t>
<div class="row mt16 o_portal_sale_sidebar">