<?xml version="1.0" encoding="UTF-8" ?>

<templates xml:space="preserve">

    <!-- Replace the apps menu dropdown with app switcher -->
    <t
        t-name="fusion_backend_theme.NavBar.AppSwitcher"
        t-inherit="web.NavBar.AppsMenu"
        t-inherit-mode="extension"
    >
        <xpath expr="//Dropdown" position="replace">
            <AppSwitcher menuClass="'o_fusion_app_switcher'">
                <button data-hotkey="h" title="Home Menu">
                    <i class="oi oi-apps" />
                </button>
                <t t-set-slot="content">
                    <div t-ref="sortableArea" class="o_fusion_apps_grid d-flex flex-wrap align-content-start w-100">
                        <DropdownItem
                            t-foreach="this.appMenuService.getAppsMenuItems()"
                            t-as="app"
                            t-key="app.id"
                            class="'o_app o_draggable'"
                            attrs="{ href: app.href, 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
                            onSelected="() => this.onNavBarDropdownItemSelection(app)"
                            closingMode="'none'"
                        >
                            <a
                                t-att-href="app.href"
                                t-on-click.prevent=""
                                t-att-class="{ 'o_fusion_app_focused': state.focusedIndex === app_index }"
                            >
                                <img
                                    t-if="app.webIconData"
                                    class="o_fusion_app_icon"
                                    t-att-src="app.webIconData"
                                />
                                <img
                                    t-else=""
                                    class="o_fusion_app_icon"
                                    src="/base/static/description/icon.png"
                                />
                                <span class="o_fusion_app_name">
                                    <t t-out="app.label"/>
                                </span>
                            </a>
                        </DropdownItem>
                    </div>
                </t>
            </AppSwitcher>
        </xpath>
    </t>

</templates>
