271 lines
11 KiB
XML
271 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<templates xml:space="preserve">
|
|
<t t-name="AppIcon" owl="1">
|
|
<t t-set="app_id" t-value="app.id" />
|
|
<t t-set="menu_badge_count" t-value="app.badge_count" />
|
|
<a t-att-href="getMenuItemHref(app)" >
|
|
<t t-if="icon_style == 'standard'">
|
|
<img class="img" t-attf-src="/web/image?model=ir.ui.menu&field=web_icon_data&id={{app_id}}" t-att-title="app.name" t-att-alt="app.name" />
|
|
</t>
|
|
<t t-elif="icon_style == 'line_icon'">
|
|
<t t-set="app_cls_name" t-value="getAppClassName(app)"/>
|
|
<span t-attf-class="sh-{{app_cls_name}} sh_fa_icon"/>
|
|
</t>
|
|
<t t-elif="icon_style == 'three_d'">
|
|
<t t-set="app_cls_name" t-value="getAppClassName(app)"/>
|
|
<img class="img threed_icon" t-attf-src="sh_backmate_theme_adv_enterprise/static/src/app_icon/3d_icons/{{app_cls_name}}.png" t-att-title="app.name" t-att-alt="app.name"/>
|
|
</t>
|
|
<t t-elif="icon_style == 'dual_tone'">
|
|
<t t-set="app_cls_name" t-value="getAppClassName(app)"/>
|
|
<span t-attf-class="sh-{{app_cls_name}}-dt sh_fa_icon">
|
|
<span class="path1"/>
|
|
<span class="path2"/>
|
|
</span>
|
|
</t>
|
|
<t t-elif="icon_style == 'glass_icon'">
|
|
<t t-set="app_cls_name" t-value="getAppClassName(app)"/>
|
|
<img class="img glass_icon" t-attf-src="sh_backmate_theme_adv_enterprise/static/src/app_icon/glass_icons/{{app_cls_name}}.png" t-att-title="app.name" t-att-alt="app.name"/>
|
|
</t>
|
|
<t t-elif="icon_style == 'light_icon'">
|
|
<t t-set="app_cls_name" t-value="getAppClassName(app)"/>
|
|
<span t-attf-class="sh-{{app_cls_name}}-l sh_fa_icon"/>
|
|
</t>
|
|
<t t-if="menu_badge_count != 0">
|
|
<span class="menu-badge">
|
|
<t t-esc="menu_badge_count"/>
|
|
</span>
|
|
</t>
|
|
<span>
|
|
<t t-esc="app.name"/>
|
|
</span>
|
|
</a>
|
|
</t>
|
|
<!-- 菜单递归模板 -->
|
|
<t t-name="AppsTreeMenu" owl="1">
|
|
<!-- 子菜单 -->
|
|
<t t-set="children_menus" t-value="menu.childrenTree" />
|
|
<!-- <t t-set="menu_badge_count" t-value="this.getMenuBadgeCount(menu)" />-->
|
|
<t t-set="menu_badge_count" t-value="menu.badge_count" />
|
|
<!-- 不存在子菜单 -->
|
|
<t t-if="!children_menus.length">
|
|
<div class="dropdown-header dropdown-item o_menu_header_lvl_1">
|
|
<DropdownItem
|
|
href="getMenuItemHref(menu)"
|
|
dataset="{ menu: menu.xmlid, section: menu.id }"
|
|
onSelected="() => this.onNavBarDropdownItemSelection(menu)"
|
|
>
|
|
<span class="fa fa-circle-thin" t-attf-style="margin-left: {{ menu.level * 15 }}px;position: relative;">
|
|
<t t-if="menu_badge_count != 0">
|
|
<span class="menu-badge">
|
|
<t t-esc="menu_badge_count"/>
|
|
</span>
|
|
</t>
|
|
</span>
|
|
<span>
|
|
<t t-esc="menu.name"/>
|
|
</span>
|
|
</DropdownItem>
|
|
</div>
|
|
</t>
|
|
<!-- 存在子菜单 -->
|
|
<t t-else="">
|
|
<div class="dropdown-header o_menu_header_lvl_1" >
|
|
<a class="sh_dropdown_toggle dropdown-item dropdown-toggle" t-on-click.stop="OnClickDropdown">
|
|
<span class="fa fa-circle-thin" t-attf-style="margin-left: {{ menu.level * 15 }}px;position: relative;">
|
|
<t t-if="menu_badge_count != 0">
|
|
<span class="menu-badge">
|
|
<t t-esc="menu_badge_count"/>
|
|
</span>
|
|
</t>
|
|
</span>
|
|
<span>
|
|
<t t-esc="menu.name" />
|
|
</span>
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-right" role="menu">
|
|
<t t-foreach="children_menus" t-as="children" t-key="children.id">
|
|
<t t-set="children_sub_menus" t-value="children.childrenTree" />
|
|
<t t-set="children_menu_badge_count" t-value="children.badge_count" />
|
|
<!-- <t t-set="children_menu_badge_count" t-value="this.getMenuBadgeCount(children)" />-->
|
|
<t t-if="children_sub_menus.length">
|
|
<t t-call="AppsTreeMenu">
|
|
<t t-set="menu" t-value="children" />
|
|
</t>
|
|
</t>
|
|
<t t-else="">
|
|
<div class="dropdown-header dropdown-item o_menu_header_lvl_1">
|
|
<DropdownItem
|
|
href="getMenuItemHref(children)"
|
|
dataset="{ menu: children.xmlid, section: children.id }"
|
|
onSelected="() => this.onNavBarDropdownItemSelection(children)"
|
|
>
|
|
<span class="fa fa-circle-thin" t-attf-style="margin-left: {{ children.level * 15 }}px;position: relative;">
|
|
<t t-if="children_menu_badge_count != 0">
|
|
<span class="menu-badge">
|
|
<t t-esc="children_menu_badge_count"/>
|
|
</span>
|
|
</t>
|
|
</span>
|
|
<span>
|
|
<t t-esc="children.name"/>
|
|
</span>
|
|
</DropdownItem>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</ul>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
<t t-name="sh.NavBar.AppsMenu" owl="1">
|
|
<a style="z-index:1111;display:none;" id="js_bar_toggle_btn_mobile" t-on-click="_click_js_bar_toggle_btn_mobile" class="">
|
|
<i class="fa fa-bars" id="toggle_bar" t-on-click="_click_toggle_bar" />
|
|
</a>
|
|
<div class="blur_div blur_toggle" t-on-click="_click_blur_div"/>
|
|
<div t-on-mouseenter="onMouseenter_sh_backmate_theme_appmenu_div" t-on-mouseleave="onMouseleave_sh_backmate_theme_appmenu_div">
|
|
<Dropdown
|
|
hotkey="'h'"
|
|
title="'Home Menu'"
|
|
class="'o_navbar_apps_menu sh_backmate_theme_appmenu_div'"
|
|
t-on-mouseenter="onMouseenter_sh_backmate_theme_appmenu_div"
|
|
t-on-mouseleave="onMouseleave_sh_backmate_theme_appmenu_div"
|
|
>
|
|
<t t-set-slot="toggler"/>
|
|
<!-- LOGO -->
|
|
<div class="logo" style="width: 100%;display: flex;max-width: 100%;align-items: center;margin-top: 20px;">
|
|
<img t-attf-src="/web/image?model=res.company&field=company_name_logo&id={{get_current_company()}}" id="company_logo" style="margin-left: 10px;height: 30px;width: 30px;max-width: 30px;margin-right: 19px;" />
|
|
<img class="img" t-attf-src="/web/image?model=res.company&field=logo&id={{get_current_company()}}" style="height: 3rem;padding: 10px 0;width: 55%;padding-left: 0;" id="company_name_logo" />
|
|
<span
|
|
id="fullscreen_toggle"
|
|
t-att-title="state.exFullscreen ? '退出全屏' : '开启全屏'"
|
|
t-on-click="_click_fullscreen_toggle"
|
|
style="margin-left: 25px;margin-top: 0px; font-size: 20px;color: white !important;">
|
|
<i class="fa fa-expand" aria-hidden="true" t-if="!state.exFullscreen"></i>
|
|
<i class="fa fa-compress" aria-hidden="true" t-if="state.exFullscreen"></i>
|
|
</span>
|
|
<span class="icon-top_hide fa fa-toggle-on" id="hide_top_bar" t-on-click="_click_hide_top_bar" style="margin-left: 25px;margin-top: 0px; font-size: 20px;"/>
|
|
<span class="icon-top_show fa fa-toggle-off" id="show_top_bar" t-on-click="_click_show_top_bar" style="margin-left: 25px;margin-top: 0px;font-size: 20px;"/>
|
|
</div>
|
|
<!-- 菜单项 -->
|
|
<t class="'o_app'" t-foreach="apps" t-as="app" t-key="app.id" t-on-click="_click_o_app">
|
|
<t t-set="app_icon" t-value="getXmlID(app.id)"/>
|
|
<t t-set="icon_style" t-value="getIconStyle()"/>
|
|
<!-- 子菜单 -->
|
|
<t t-set="sections" t-value="currentMenuAppSections(app.id)"/>
|
|
<!-- 有子菜单 -->
|
|
<t t-if="sections.length" >
|
|
<div class="sh_dropdown_div cssmenu">
|
|
<!-- 菜单图标 -->
|
|
<span t-key="app.id"
|
|
class="sh_dropdown_toggle dropdown-item child_app o_app2"
|
|
payload="app"
|
|
t-on-click.stop="OnClickDropdown"
|
|
t-on-mouseenter="onMouseenter_o_app2"
|
|
>
|
|
<t t-call="AppIcon"/>
|
|
</span>
|
|
<!-- 子菜单项 -->
|
|
<ul class="dropdown-menu dropdown-menu-right" role="menu">
|
|
<t t-foreach="sections" t-as="section" t-key="section.id">
|
|
<t t-call="AppsTreeMenu">
|
|
<t t-set="menu" t-value="section" />
|
|
</t>
|
|
</t>
|
|
</ul>
|
|
</div>
|
|
</t>
|
|
<t t-else="">
|
|
<!-- 没有子菜单,点击直接跳转 -->
|
|
<div class="cssmenu">
|
|
<span class="dropdown-item o_app direct_menu" t-on-click="_click_o_app" payload="app">
|
|
<t t-call="AppIcon"/>
|
|
</span>
|
|
<!-- </MenuItem> -->
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</Dropdown>
|
|
</div>
|
|
</t>
|
|
<t t-name="web.NavBar" t-inherit="web.NavBar" t-inherit-mode="extension" owl="1">
|
|
<xpath expr="//nav[hasclass('o_main_navbar')]" position="after">
|
|
<!-- MULTI TAB START -->
|
|
<div class="multi_tab_section"/>
|
|
<!-- MULTI TAB END -->
|
|
</xpath>
|
|
<xpath expr="//nav[hasclass('o_main_navbar')]" position="replace">
|
|
<nav class="o_main_navbar" data-command-category="navbar" >
|
|
<t t-call="sh.NavBar.AppsMenu">
|
|
<t t-set="apps" t-value="menuService.getApps()" />
|
|
</t>
|
|
<DropdownItem
|
|
t-if="currentApp"
|
|
href="getMenuItemHref(currentApp)"
|
|
t-esc="currentApp.name"
|
|
class="'o_menu_brand d-none d-md-block'"
|
|
dataset="{ menuXmlid: currentApp.xmlid, section: currentApp.id }"
|
|
onSelected="() => this.onNavBarDropdownItemSelection(currentApp)"
|
|
/>
|
|
<!-- Current App Sections -->
|
|
<t t-if="currentAppSections.length" t-call="web.NavBar.SectionsMenu">
|
|
<t t-set="sections" t-value="currentAppSections" />
|
|
</t>
|
|
<!-- Systray -->
|
|
<div class="o_menu_systray d-flex flex-shrink-0 ms-auto" role="menu">
|
|
<t t-foreach="systrayItems" t-as="item" t-key="item.key">
|
|
<div t-att-data-index="item.index"/>
|
|
<ErrorHandler onError="error => this.handleItemError(error, item)" t-if="!this.env.isSmall">
|
|
<t t-component="item.Component" t-props="item.props"/>
|
|
</ErrorHandler>
|
|
</t>
|
|
</div>
|
|
</nav>
|
|
</xpath>
|
|
</t>
|
|
<t t-name="Menu.link">
|
|
<t t-set="depth" t-value="(depth || 0) + 1"/>
|
|
<t t-if="!menu.childrenTree.length">
|
|
<t t-set="_link">
|
|
<a role="menuitem" t-attf-href="#menu_id=#{menu.id}&action=#{menu.action ? menu.action.split(',')[1] : ''}"
|
|
t-att-data-menu="menu.id"
|
|
t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''"
|
|
t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''"
|
|
t-att-data-menu-xmlid="menu.xmlid"
|
|
t-attf-class="#{inNavbar ? '' : 'dropdown-item '}o_menu_entry_lvl_#{depth}"
|
|
data-toggle="collapse" data-target="#o_navbar_collapse.in">
|
|
<span>
|
|
<t t-esc="menu.name"/>
|
|
</span>
|
|
</a>
|
|
</t>
|
|
<li t-if="inNavbar">
|
|
<t t-raw="_link"/>
|
|
</li>
|
|
<t t-else="">
|
|
<t t-raw="_link"/></t>
|
|
</t>
|
|
<t t-else="">
|
|
<t t-if="!mobile">
|
|
<div t-attf-class="dropdown-header o_menu_header_lvl_#{depth}">
|
|
<span>
|
|
<t t-esc="menu.name"/>
|
|
</span>
|
|
</div>
|
|
<t t-foreach="menu.childrenTree" t-as="menu" t-key="menu.id">
|
|
<t t-call="Menu.link"/>
|
|
</t>
|
|
</t>
|
|
<li t-else="" class="sh_profile_menu_section">
|
|
<a href="#" t-attf-class="o_menu_entry_lvl_#{depth}" data-toggle="dropdown" role="button" aria-expanded="false" t-att-data-menu-xmlid="menu.xmlid" >
|
|
<t t-esc="menu.name"/>
|
|
<span class="fa fa-chevron-right" id="sub_menu"/>
|
|
</a>
|
|
<ul>
|
|
<t t-foreach="menu.childrenTree" t-as="menu" t-key="menu.id">
|
|
<t t-call="Menu.link"/>
|
|
</t>
|
|
</ul>
|
|
</li>
|
|
</t>
|
|
</t>
|
|
</templates> |