<div class="main-menu menu-fixed menu-light menu-accordion menu-shadow" data-scroll-to-active="true">
    <div class="navbar-header">
        <ul class="nav navbar-nav flex-row">
            <li class="nav-item mr-auto">
                <a class="navbar-brand">
                    <div class="brand-logo"></div>
                    <h2 class="brand-text mb-0">Quyoshli</h2>
                </a>
            </li>
            <li class="nav-item nav-toggle">
                <a class="nav-link modern-nav-toggle pr-0" data-toggle="collapse">
                    <i class="feather icon-x d-block d-xl-none font-medium-4 primary toggle-icon"></i>
                    <i class="toggle-icon feather icon-disc font-medium-4 d-none d-xl-block primary"
                        data-ticon="icon-disc"></i>
                </a>
            </li>
        </ul>
    </div>
    <div class="shadow-bottom"></div>
    <div class="main-menu-content">
        <ul class="navigation navigation-main" id="main-menu-navigation" data-menu="menu-navigation">
            <li class="nav-item {{ active('dashboard') }}"><a href="{{ route('dashboard') }}"><i
                        class="feather icon-home"></i>
                    <span class="menu-title">
                        @lang('admin.home')
                    </span>
                </a>
            </li>

            <li class="nav-item has-sub
                @if (Str::startsWith(Route::currentRouteName(), 'dashboard.orders')) open @endif
                ">
                <a href="#">
                    <i class="feather icon-truck"></i>
                    <span class="menu-title" data-i18n="Content">@lang('admin.orders.title')</span>
                </a>
                <ul class="menu-content">
                    @can('view', 'orders')
                        <li class="nav-item {{ active([route('dashboard.orders'), route('dashboard.orders') . '/*']) }}">
                            <a href="{{ route('dashboard.orders') }}">
                                <i class="feather icon-shopping-cart"></i>
                                <span class="menu-title">
                                    @lang('admin.orders.title')
                                </span>
                            </a>
                        </li>
                    @endcan

                    @can('view', 'billings')
                        <li class=" nav-item {{ active([route('billing'), route('billing') . '/*']) }} ">
                            <a href="{{ route('billing') }}">
                                <i class="feather icon-credit-card"></i>
                                <span class="menu-title">
                                    @lang('admin.billing.title')
                                </span>
                            </a>
                        </li>
                    @endcan
                </ul>
            </li>


            @if (Gate::check('update', 'settings') || Gate::check('delivery', 'settings') || Gate::check('view', 'currencies'))
                <li class="nav-item has-sub">
                    <a href="#">
                        <i class="feather icon-archive"></i>
                        <span class="menu-title" data-i18n="Content">@lang('admin.products.title')</span>
                    </a>
                    <ul class="menu-content">
                        @can('view', 'products')
                            <li
                                class="nav-item {{ active([route('dashboard.products'), route('dashboard.products') . '/*']) }}">
                                <a href="{{ route('dashboard.products') }}">
                                    <i class="feather icon-box"></i>
                                    <span class="menu-title">
                                        @lang('admin.products.all_products')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        @can('view', 'brands')
                            <li
                                class="nav-item {{ active([route('dashboard.brands'), route('dashboard.brands') . '/*']) }}">
                                <a href="{{ route('dashboard.brands') }}">
                                    <i class="feather icon-cast"></i>
                                    <span class="menu-title">
                                        @lang('admin.brands.title')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        @can('view', 'categories')
                            <li
                                class="nav-item {{ active([route('dashboard.categories'), route('dashboard.categories') . '/*']) }}">
                                <a href="{{ route('dashboard.categories') }}">
                                    <i class="feather icon-tag"></i>
                                    <span class="menu-title">
                                        @lang('admin.categories.title')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        @can('view', 'compilations')
                            <li
                                class="nav-item {{ active([route('dashboard.compilations'), route('dashboard.compilations') . '/*']) }}">
                                <a href="{{ route('dashboard.compilations') }}">
                                    <i class="feather icon-command"></i>
                                    <span class="menu-title">
                                        @lang('admin.compilations.title')
                                    </span>
                                </a>
                            </li>
                        @endcan
                    </ul>
                </li>
            @endif

            @can('view', 'users')
                <li class="nav-item {{ active([route('dashboard.users'), route('dashboard.users') . '/*']) }}"><a
                        href="{{ route('dashboard.users') }}">
                        <i class="feather icon-user"></i>
                        <span class="menu-title">
                            @lang('admin.users.title')
                        </span>
                    </a>
                </li>
            @endcan

            {{--  <li class="nav-item
                @if (Str::startsWith(Route::currentRouteName(), 'dashboard.notifications')) open @endif
            "><a
                    href="{{ route('dashboard.notifications.index') }}">
                    <i class="feather icon-bell"></i>
                    <span class="menu-title">
                        @lang('admin.notifications.title')
                    </span>
                </a>
            </li>  --}}

            <li class="nav-item has-sub
                @if (Str::startsWith(Route::currentRouteName(), 'dashboard.partners')) open @endif
                ">
                <a href="#">
                    <i class="feather icon-briefcase"></i>
                    <span class="menu-title" data-i18n="Content">@lang('admin.partners.title')</span>
                </a>
                <ul class="menu-content">
                    <li
                        class="
                            @if (Str::startsWith(Route::currentRouteName(), 'dashboard.partners')) active @endif
                        ">
                        <a href="{{ route('dashboard.partners.index') }}">
                            <i class="feather icon-file-text"></i>
                            <span class="menu-item" data-i18n="Grid">@lang('admin.partners.list')</span>
                        </a>
                    </li>
                    <li
                        class="
                            @if (Str::startsWith(Route::currentRouteName(), 'dashboard.partner_requests')) active @endif
                            ">
                        <a href="{{ route('dashboard.partner_requests.index') }}">
                            <i class="feather icon-file-plus"></i>
                            <span class="menu-item" data-i18n="Grid">@lang('admin.partners.requests')</span>
                        </a>
                    </li>
                </ul>
            </li>

            <li class="nav-item has-sub
                @if (Str::startsWith(Route::currentRouteName(), ['dashboard.services', 'dashboard.problems'])) open @endif
                ">
                <a href="#">
                    <i class="feather icon-circle"></i>
                    <span class="menu-title" data-i18n="Content">@lang('admin.services.title')</span>
                </a>
                <ul class="menu-content">
                    <li
                        class="
                            @if (Str::startsWith(Route::currentRouteName(), 'dashboard.services')) active @endif
                        ">
                        <a href="{{ route('dashboard.services.index') }}">
                            <i class="feather icon-file-text"></i>
                            <span class="menu-item" data-i18n="Grid">@lang('admin.partners.list')</span>
                        </a>
                    </li>
                    <li
                        class="
                            @if (Str::startsWith(Route::currentRouteName(), 'dashboard.service_requests')) active @endif
                            ">
                        <a href="{{ route('dashboard.service_requests.index') }}">
                            <i class="feather icon-file-plus"></i>
                            <span class="menu-item" data-i18n="Grid">@lang('admin.partners.requests')</span>
                        </a>
                    </li>
                    <li class="nav-item
                        @if (Str::startsWith(Route::currentRouteName(), ['dashboard.powers'])) active @endif">
                        <a href="{{ route('dashboard.powers.index') }}">
                            <i class="feather icon-zap"></i>
                            <span class="menu-title">
                                @lang('admin.powers.title')
                            </span>
                        </a>
                    </li>
                    <li class="nav-item
                        @if (Str::startsWith(Route::currentRouteName(), ['dashboard.problems'])) active @endif">
                        <a href="{{ route('dashboard.problems.index') }}">
                            <i class="feather icon-alert-octagon"></i>
                            <span class="menu-title">
                                @lang('admin.problems.problems')
                            </span>
                        </a>
                    </li>
                </ul>
            </li>

            <li class="nav-item
                @if (Str::startsWith(Route::currentRouteName(), ['dashboard.usefulinfos', 'dashboard.usefulinfoitems'])) active @endif">
                <a href="{{ route('dashboard.usefulinfos.index') }}">
                    <i class="feather icon-book"></i>
                    <span class="menu-title">
                        @lang('admin.usefulinfos.title')
                    </span>
                </a>
            </li>

            @can('create', 'pages')
                <li class="nav-item has-sub">
                    <a href="#">
                        <i class="feather icon-layout"></i>
                        <span class="menu-title" data-i18n="Content">@lang('admin.pages.title')</span>
                    </a>
                    <ul class="menu-content">
                        @foreach ($pages = App\Models\Page::all() as $page)
                            <li class="{{ request()->is("dashboard/pages/update/$page->id*") ? 'active' : '' }}">
                                <a href="{{ route('dashboard.pages.update', $page->id) }}">
                                    <i class="feather icon-circle"></i>
                                    <span class="menu-item" data-i18n="Grid">{{ $page->name['ru'] }}</span>
                                </a>
                            </li>
                        @endforeach
                        <li class="{{ request()->is('dashboard/pages/store*') ? 'active' : '' }}">
                            <a href="{{ route('dashboard.pages.store') }}">
                                <i class="feather icon-plus-circle"></i>
                                <span class="menu-item" data-i18n="Grid">@lang('admin.add')</span>
                            </a>
                        </li>
                    </ul>
                </li>
            @endcan

            @can('view', 'posts')
                <li class="nav-item @if (Str::startsWith(Route::currentRouteName(), ['dashboard.posts'])) open @endif has-sub">
                    <a href="#">
                        <i class="feather icon-globe"></i>
                        <span class="menu-title" data-i18n="Content">@lang('admin.posts.title')</span>
                    </a>
                    <ul class="menu-content">
                        <li class="{{ request()->is('dashboard/posts/ru*') ? 'active' : '' }}">
                            <a href="{{ route('dashboard.posts', 'ru') }}">
                                <i class="feather icon-circle"></i>
                                <span class="menu-item" data-i18n="Grid">Ru</span>
                            </a>
                        </li>
                        <li class="{{ request()->is('dashboard/posts/uz*') ? 'active' : '' }}">
                            <a href="{{ route('dashboard.posts', 'uz') }}">
                                <i class="feather icon-circle"></i>
                                <span class="menu-item" data-i18n="Grid">UZ</span>
                            </a>
                        </li>
                    </ul>
                </li>
            @endcan

            <li
                class="nav-item has-sub
                @if (Str::startsWith(Route::currentRouteName(), 'dashboard.partners')) open @endif
                ">
                <a href="#">
                    <i class="feather icon-circle"></i>
                    <span class="menu-title" data-i18n="Content">@lang('admin.regions.title')</span>
                </a>
                <ul class="menu-content">
                    @can('view', 'regions')
                        <li
                            class="nav-item {{ active([route('dashboard.regions'), route('dashboard.regions') . '/*']) }}">
                            <a href="{{ route('dashboard.regions') }}">
                                <i class="feather icon-database"></i>
                                <span class="menu-title">
                                    @lang('admin.regions.title')
                                </span>
                            </a>
                        </li>
                    @endcan

                    @can('view', 'cities')
                        <li class="nav-item {{ active([route('dashboard.cities'), route('dashboard.cities') . '/*']) }}">
                            <a href="{{ route('dashboard.cities') }}">
                                <i class="feather icon-layers"></i>
                                <span class="menu-title">
                                    @lang('admin.cities.title')
                                </span>
                            </a>
                        </li>
                    @endcan
                    <li
                        class="nav-item {{ active([route('dashboard.branches'), route('dashboard.branches') . '/*']) }}">
                        <a href="{{ route('dashboard.branches') }}">
                            <i class="feather icon-compass"></i>
                            <span class="menu-title">
                                @lang('admin.branches.title')
                            </span>
                        </a>
                    </li>
                </ul>
            </li>

            @if (Gate::check('update', 'settings') || Gate::check('delivery', 'settings') || Gate::check('view', 'currencies'))
                <li class="nav-item has-sub">
                    <a href="#">
                        <i class="feather icon-settings"></i>
                        <span class="menu-title" data-i18n="Content">@lang('admin.settings.title')</span>
                    </a>
                    <ul class="menu-content">
                        @can('update', 'settings')
                            <li class="{{ request()->is('dashboard/settings') ? 'active' : '' }}">
                                <a href="{{ route('dashboard.settings') }}">
                                    <i class="feather icon-settings"></i>
                                    <span class="menu-item" data-i18n="Grid">
                                        @lang('admin.settings.title')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        @can('view', 'staffs')
                            <li
                                class="nav-item {{ active([route('dashboard.staffs'), route('dashboard.staffs') . '/*']) }}">
                                <a href="{{ route('dashboard.staffs') }}">
                                    <i class="feather icon-users"></i>
                                    <span class="menu-title">
                                        @lang('admin.staffs.title')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        {{--  @if (Gate::check('update', 'settings'))
                            <li
                                class="{{ active([route('dashboard.settings.delivery'), route('dashboard.settings.delivery') . '/*']) }}">
                                <a href="{{ route('dashboard.settings.delivery') }}">
                                    <i class="feather icon-truck"></i>
                                    <span class="menu-item" data-i18n="Grid">
                                        @lang('admin.delivery.title')
                                    </span>
                                </a>
                            </li>
                        @endif  --}}

                        <li
                            class="nav-item
                                @if (Str::startsWith(Route::currentRouteName(), ['dashboard.measurements'])) active @endif">
                            <a href="{{ route('dashboard.measurements.index') }}">
                                <i class="feather icon-circle"></i>
                                <span class="menu-title">
                                    @lang('admin.measurements.title')
                                </span>
                            </a>
                        </li>

                        <li
                            class="nav-item
                                @if (Str::startsWith(Route::currentRouteName(), ['dashboard.payment-systems', 'dashboard.payment-system-items'])) active @endif">
                            <a href="{{ route('dashboard.payment-systems.index') }}">
                                <i class="feather icon-circle"></i>
                                <span class="menu-title">
                                    @lang('admin.payment-systems.title')
                                </span>
                            </a>
                        </li>

                        <li
                            class="nav-item
                                @if (Str::startsWith(Route::currentRouteName(), ['dashboard.contract-templates'])) active @endif">
                            <a href="{{ route('dashboard.contract-templates.index') }}">
                                <i class="feather icon-copy"></i>
                                <span class="menu-title">
                                    @lang('admin.contract-templates.title')
                                </span>
                            </a>
                        </li>

                        @can('view', 'currencies')
                            <li class="{{ active([route('dashboard.currency'), route('dashboard.currency') . '/*']) }}">
                                <a href="{{ route('dashboard.currency') }}">
                                    <i class="feather icon-dollar-sign"></i>
                                    <span class="menu-item" data-i18n="Grid">
                                        @lang('admin.currency.title')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        <li
                            class="nav-item
                            @if (Str::startsWith(Route::currentRouteName(), ['dashboard.statuses'])) active @endif">
                            <a href="{{ route('dashboard.statuses.index') }}">
                                <i class="feather icon-circle"></i>
                                <span class="menu-title">
                                    @lang('admin.statuses.title')
                                </span>
                            </a>
                        </li>

                        <li
                            class="nav-item
                            @if (Str::startsWith(Route::currentRouteName(), ['dashboard.companies'])) active @endif">
                            <a href="{{ route('dashboard.companies.index') }}">
                                <i class="feather icon-circle"></i>
                                <span class="menu-title">
                                    @lang('admin.companies.title')
                                </span>
                            </a>
                        </li>

                        @can('view', 'roles')
                            <li
                                class="nav-item {{ active([route('dashboard.roles'), route('dashboard.roles') . '/*']) }}">
                                <a href="{{ route('dashboard.roles') }}">
                                    <i class="feather icon-user-plus"></i>
                                    <span class="menu-title">
                                        @lang('admin.roles.title')
                                    </span>
                                </a>
                            </li>
                        @endcan

                        @can('view', 'logs')
                            <li class="nav-item {{ active([route('dashboard.logs'), route('dashboard.logs') . '/*']) }}">
                                <a href="{{ route('dashboard.logs') }}">
                                    <i class="feather icon-book-open"></i>
                                    <span class="menu-title">
                                        Журнал действий
                                    </span>
                                </a>
                            </li>
                        @endcan
                    </ul>
                </li>
            @endif

        </ul>
    </div>
</div>
