0613修改侧边栏

This commit is contained in:
WEB许何哲\xuhez
2023-06-13 17:32:21 +08:00
parent 8a4320c031
commit 414f485c17
5 changed files with 158 additions and 12 deletions

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<!-- Inherit the original view -->
<t t-inherit="web.NavBar.SectionsMenu" t-inherit-mode="extension" owl="1">
<!-- Modify the contents of the original view -->
<xpath expr="//div[@class='o_menu_sections d-none d-md-flex flex-grow-1 flex-shrink-1']" position="replace">
<div class="o_menu_sections d-none d-md-flex flex-grow-1 flex-shrink-1">
<!-- Add your custom content here -->
<t t-foreach="sections" t-as="section" t-key="section.id">
<t
t-set="sectionsVisibleCount"
t-value="(sections.length - currentAppSectionsExtra.length)"
/>
<t t-if="section_index lt Math.min(10, sectionsVisibleCount)">
<t t-set="hotkey" t-value="((section_index + 1) % 10).toString()"/>
</t>
<t t-else="">
<t t-set="hotkey" t-value="undefined"/>
</t>
<t t-if="!section.childrenTree.length">
<DropdownItem
title="section.name"
class="'o_nav_entry'"
href="getMenuItemHref(section)"
hotkey="hotkey"
t-esc="section.name"
dataset="{ menuXmlid: section.xmlid, section: section.id }"
onSelected="() => this.onNavBarDropdownItemSelection(section)"
/>
</t>
<t t-else="">
<MenuDropdown
hotkey="hotkey"
title="section.name"
xmlid="section.xmlid"
>
<t t-set-slot="toggler">
<span t-esc="section.name" t-att-data-section="section.id"/>
<svg t="1686643514098" class="icon icon1" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="892" width="200" height="200"><path d="M191.874005 288.29452c-15.95436701 0-29.007661-13.05329399-29.007661-29.007661l0-71.167876c0-15.95436701 13.05329399-29.007661 29.007661-29.007661l643.973754 0c15.95436701 0 29.007661 13.05329399 29.007661 29.007661l0 71.16787599c0 15.95436701-13.05329399 29.007661-29.007661 29.00766101L191.874005 288.29452z" fill="#ffffff" p-id="893"></path>
<path d="M835.847759 391.806036c15.95436701 0 21.211091 10.468422 11.68206399 23.264866l-316.65186998 425.214425c-9.529027 12.795421-25.122167 12.795421-34.65017101 0l-316.65084699-425.214425c-9.529027-12.796444-4.272303-23.264866 11.68206399-23.264866L835.847759 391.806036z"
fill="#ffffff" p-id="894"></path></svg>
<svg t="1686643464598" class="icon icon2" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="1031" width="200" height="200"><path d="M288.29452 832.125995c0 15.95436701-13.05329399 29.007661-29.007661 29.007661l-71.167876 0c-15.95436701 0-29.007661-13.05329399-29.007661-29.007661l0-643.973754c0-15.95436701 13.05329399-29.007661 29.007661-29.007661l71.16787599 0c15.95436701 0 29.007661 13.05329399 29.00766101 29.007661L288.29452 832.125995z" fill="#ffffff" p-id="1032"></path>
<path d="M391.806036 188.152241c0-15.95436701 10.468422-21.211091 23.264866-11.68206399l425.214425 316.65186998c12.795421 9.529027 12.795421 25.122167 0 34.65017101l-425.214425 316.65084699c-12.796444 9.529027-23.264866 4.272303-23.264866-11.68206399L391.806036 188.152241z"
fill="#ffffff" p-id="1033"></path></svg>
</t>
<t t-call="web.NavBar.SectionsMenu.Dropdown.MenuSlot">
<t t-set="items" t-value="section.childrenTree"/>
</t>
</MenuDropdown>
</t>
</t>
<t t-if="currentAppSectionsExtra.length" t-call="web.NavBar.SectionsMenu.MoreDropdown">
<t t-set="sections" t-value="currentAppSectionsExtra"/>
<t t-if="sectionsVisibleCount lt 10">
<t t-set="hotkey" t-value="(sectionsVisibleCount + 1 % 10).toString()"/>
</t>
</t>
</div>
</xpath>
</t>
</templates>