<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
    <t t-name="pos_restaurant.Navbar" t-inherit="point_of_sale.Navbar" t-inherit-mode="extension">
        <xpath expr="//DropdownItem[contains(text(), 'Backend')]" position="before">
            <t t-if="pos.router.state.current == 'FloorScreen'">
                <DropdownItem t-if="showEditPlanButton and this.pos.config.floor_ids.length" onSelected="() => this.pos.toggleEditMode()">
                    Edit Plan
                </DropdownItem>
            </t>
            <DropdownItem t-if="pos.router.state.current == 'FloorScreen'" onSelected="() => this.onSwitchButtonClick()">
                Switch Floor View
            </DropdownItem>
        </xpath>
        <xpath expr="//div[hasclass('pos-leftheader')]//OrderTabs" position="attributes">
            <attribute name="t-if">!pos.config.module_pos_restaurant</attribute>
        </xpath>
        <xpath expr="//div[hasclass('pos-leftheader')]//OrderTabs" position="after">
            <span t-if="pos.config.module_pos_restaurant and pos.getOrder()" t-esc="currentOrderName" class="badge rounded-pill text-bg-info py-2 fs-6 fw-bolder text-truncate"/>
        </xpath>
        <xpath expr="//button[hasclass('register-label')]" position="before">
            <button t-if="pos.config.module_pos_restaurant" class="table-button btn btn-lg btn-light lh-lg" t-att-class="{'active': mainButton === 'table', 'text-muted': this.pos.getOrder()?.isFilledDirectSale}" t-on-click="() => this.onClickPlanButton()">
                <span t-if="!ui.isSmall">Tables</span>
                <img t-else="" src="/pos_restaurant/static/img/plan.svg" class="navbar-icon" t-att-class="{'opacity-50': this.pos.getOrder()?.isFilledDirectSale}" alt="Floor Plan"/>
            </button>
        </xpath>
        <xpath expr="//div[hasclass('navbar-separator')]" position="after">
            <div class="d-flex align-items-center" t-if="pos.orderToTransferUuid">
                <strong class="mx-2 text-warning">
                    Select table to transfer order
                </strong>
            </div>
        </xpath>
        <xpath expr="//button[hasclass('orders-button')]" position="attributes">
            <attribute name="t-att-class">{'active': mainButton === 'order', 'text-muted': this.pos.getOrder()?.isFilledDirectSale}</attribute>
            <attribute name="t-on-click">() => this.onTicketButtonClick()</attribute>
        </xpath>
    </t>
</templates>
