[FIX] website: adapt theme previewer to milk theme

Some layout was disabled during dev, restore it with the
corresponding change for milk.

Part-of: odoo/odoo#116641
This commit is contained in:
Damien Bouvy
2023-05-12 22:59:22 +02:00
committed by Pierre Paridans
parent 418413e499
commit 7dcc42daa1
2 changed files with 40 additions and 56 deletions
@@ -1,62 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="website.ThemePreview.Buttons" owl="1">
<div>
<div class="o_form_buttons_view" role="toolbar" aria-label="Main actions">
<ViewButton className="'btn btn-primary o_use_theme'"
clickParams="{type: 'object', name: 'button_choose_theme'}"
record="this.model.root">
<t t-set-slot="contents">Start Now</t>
</ViewButton>
<button class="btn btn-link o_switch_theme" t-on-click.stop="this.back">
Choose another theme
</button>
<t t-name="website.ThemePreview.Buttons" owl="1">
<div>
<div class="o_form_buttons_view" role="toolbar" aria-label="Main actions">
<ViewButton className="'btn btn-primary o_use_theme'"
clickParams="{type: 'object', name: 'button_choose_theme'}"
record="this.model.root">
<t t-set-slot="contents">Start Now</t>
</ViewButton>
<button class="btn btn-link o_switch_theme" t-on-click.stop="this.back">
Choose another theme
</button>
</div>
</div>
</div>
</t>
</t>
<!-- <t t-name="website.ThemePreviewForm.ControlPanel.Regular" t-inherit="web.ControlPanel.Regular" t-inherit-mode="primary" owl="1">
<xpath expr="//div[hasclass('o_cp_bottom_right')]" position="replace">
<div class="o_cp_bottom_right" role="group">
<input class="btn-check" id="themeViewerDesktop" type="radio" name="viewer" data-mode='desktop' autocomplete="off" checked='checked'/>
<label class="btn btn-secondary" for="themeViewerDesktop" t-on-click="this.onDesktopClick">Desktop</label>
<input class="btn-check" id="themeViewerMobile" type="radio" name="viewer" data-mode='mobile' autocomplete="off"/>
<label class="btn btn-secondary" for="themeViewerMobile" t-on-click="this.onMobileClick">Mobile</label>
</div>
</xpath>
</t> -->
<t t-name="website.ThemePreviewForm.ControlPanel" t-inherit="web.ControlPanel" t-inherit-mode="primary" owl="1">
<!-- <xpath expr="//t[@t-call='web.ControlPanel.Regular']" position="replace">
<t t-call="website.ThemePreviewForm.ControlPanel.Regular"/>
</xpath> -->
</t>
<!-- <t t-name="website.ThemePreviewKanban.ControlPanel.Regular" t-inherit="web.ControlPanel.Regular" t-inherit-mode="primary" owl="1">
<xpath expr="//div[hasclass('o_cp_top_left')]" position="replace">
<div class="o_cp_top_left">
<ol class="breadcrumb" role="navigation">
<li class="breadcrumb-item active text-black-75">
<span class="text-900">Pick a Theme</span>
<small class="mx-2 text-muted">Don't worry, you can switch later.</small>
</li>
</ol>
</div>
</xpath>
<xpath expr="//div[hasclass('o_cp_top_right')]" position="replace">
<div class="o_cp_top_right d-flex flex-row-reverse">
<a class="btn btn-secondary" t-on-click="this.close">
<i class="fa fa-times" />
</a>
</div>
</xpath>
</t> -->
<t t-name="website.ThemePreviewKanban.ControlPanel" t-inherit="web.ControlPanel" t-inherit-mode="primary" owl="1">
<!-- <xpath expr="//t[@t-call='web.ControlPanel.Regular']" position="replace">
<t t-call="website.ThemePreviewKanban.ControlPanel.Regular"/>
</xpath> -->
</t>
<t t-name="website.ThemePreviewKanban.ControlPanel.BreadCrumbs" owl="1">
<div class="o_breadcrumb d-flex gap-1">
<div class="active d-flex flex-column">
<div class="text-truncate">Pick a Theme</div>
<div class="text-muted small">Don't worry, you can switch later.</div>
</div>
</div>
</t>
<t t-name="website.ThemePreviewKanban.ControlPanel" t-inherit="web.ControlPanel" t-inherit-mode="primary" owl="1">
<xpath expr="//t[@t-call='web.Breadcrumbs']" position="replace">
<t t-call="website.ThemePreviewKanban.ControlPanel.BreadCrumbs"/>
</xpath>
<xpath expr="//div[contains(@class,'o_control_panel_navigation')]" position="replace">
<div>
<a class="btn btn-secondary" t-on-click="this.close" aria-label="Close" data-tooltip="Close">
<i class="fa fa-times" />
</a>
</div>
</xpath>
</t>
</templates>
@@ -25,6 +25,13 @@ class ThemePreviewControlPanel extends ControlPanel {
close() {
this.website.goToWebsite();
}
get display() {
return {
layoutActions: false,
...this.props.display,
};
}
}
ThemePreviewControlPanel.template = 'website.ThemePreviewKanban.ControlPanel';