[REF] web: introduce ControlPanelBottomContent

The ControlPanel now supports being passed an object "bottom-content" in its display props.
That Object is constituted by a component and by props to pass to it.

The bottom content of the Control panel is rendered as a Slot within that component

If not present, the ControlPanel continues to display its bottom part as usual

Part-of: odoo/odoo#73311
This commit is contained in:
Lucas Perais (lpe)
2021-09-07 10:04:36 +00:00
committed by Aaron Bohy
parent aeb8e49972
commit 1f8d1973d5
@@ -16,36 +16,45 @@
</div>
</div>
<div t-if="display['bottom']" class="o_cp_bottom">
<div t-if="display['bottom-left']" class="o_cp_bottom_left">
<t t-slot="control-panel-bottom-left"/>
</div>
<div t-if="display['bottom-right']" class="o_cp_bottom_right">
<t t-slot="control-panel-bottom-right">
<div class="btn-group o_search_options position-static" role="search">
<t t-foreach="searchMenus" t-as="menu" t-key="menu.key">
<t t-component="menu.Component"/>
</t>
</div>
<t t-if="display['bottom-content']">
<t t-component="display['bottom-content'].Component" t-props="display['bottom-content'].props" >
<t t-call="web.ControlPanel.BottomContent" />
</t>
<div class="o_cp_pager"/>
<t t-if="props.viewSwitcherEntries and props.viewSwitcherEntries.length > 1">
<nav class="btn-group o_cp_switch_buttons">
<t t-foreach="props.viewSwitcherEntries" t-as="view" t-key="view.type">
<button class="btn btn-secondary fa fa-lg o_switch_view "
t-attf-class="o_{{view.type}} {{view.icon}} {{view.active ? 'active' : ''}}"
t-att-data-tooltip="view.name"
t-on-click="onViewClicked(view.type)"
/>
</t>
</nav>
</t>
</div>
</t>
<t t-else="" t-call="web.ControlPanel.BottomContent" />
</div>
</div>
</t>
<t t-name="web.ControlPanel.BottomContent" owl="1">
<div t-if="display['bottom-left']" class="o_cp_bottom_left">
<t t-slot="control-panel-bottom-left"/>
</div>
<div t-if="display['bottom-right']" class="o_cp_bottom_right">
<t t-slot="control-panel-bottom-right">
<div class="btn-group o_search_options position-static" role="search">
<t t-foreach="searchMenus" t-as="menu" t-key="menu.key">
<t t-component="menu.Component"/>
</t>
</div>
</t>
<div class="o_cp_pager"/>
<t t-if="props.viewSwitcherEntries and props.viewSwitcherEntries.length > 1">
<nav class="btn-group o_cp_switch_buttons">
<t t-foreach="props.viewSwitcherEntries" t-as="view" t-key="view.type">
<button class="btn btn-secondary fa fa-lg o_switch_view "
t-attf-class="o_{{view.type}} {{view.icon}} {{view.active ? 'active' : ''}}"
t-att-data-tooltip="view.name"
t-on-click="onViewClicked(view.type)"
/>
</t>
</nav>
</t>
</div>
</t>
<t t-name="web.Breadcrumbs" owl="1">
<ol class="breadcrumb">
<t t-foreach="props.breadcrumbs or []" t-as="breadcrumb" t-key="breadcrumb.jsId">