


@if(Auth::check())

    <div id="layout-sidenav" class="{{ isset($layout_sidenav_horizontal) ? 'layout-sidenav-horizontal sidenav-horizontal container-p-x flex-grow-0' : 'layout-sidenav sidenav-vertical' }} sidenav bg-sidenav-theme">

        <!-- Inner -->
        <ul class="sidenav-inner{{ empty($layout_sidenav_horizontal) ? ' py-1' : '' }}">

            <li class="sidenav-item{{ Request::is('home') ? ' active' : '' }}">
                <a href="{{ route('home') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-apps"></i><div>{{__('Home')}}</div></a>
            </li>

            @if(Auth::user()->isPermission('my-dat'))
                <li class="sidenav-item{{ Request::is('user/edit') ? ' active' : '' }}">
                    <a href="{{ route('user_edit') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-create"></i><div>{{ __('Your Data') }}</div></a>
                </li>
            @endif

            @if(Auth::user()->isAdmin())
                @if(Auth::user()->isPermission('crm'))
                    <li class="sidenav-divider mb-1"></li>
                    <li class="sidenav-header small font-weight-semibold">ADMIN CRM</li>
                    @if(Auth::user()->isPermission('crm-tp'))
                    <li class="sidenav-item{{ Request::is(['travel/*', 'drafts', 'draft/*']) ? ' open' : '' }}">
                        <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                            <i class="sidenav-icon ion ion-ios-airplane"></i>
                            <div>Reiseprogramme</div>
                        </a>
                        <ul class="sidenav-menu">
                            @if(Auth::user()->isPermission('crm-tp-pr'))
                            <li class="sidenav-item{{ Request::is('travel/*') ? ' active' : '' }}">
                                <a href="{{ route('travel_programs') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-airplane"></i><div>Programme</div></a>
                            </li>
                            @endif
                            @if(Auth::user()->isPermission('crm-tp-dr'))
                            <li class="sidenav-item{{ Request::is(['drafts','draft/*']) ? ' active' : '' }}">
                                <a href="{{ route('drafts') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-paper"></i><div>Vorlagen</div></a>
                            </li>
                            @endif
                        </ul>
                    </li>
                    @endif
                    @if(Auth::user()->isPermission('crm-bo'))
                    <li class="sidenav-item{{ Request::is(['requests', 'bookings', 'booking/*', 'leads', 'lead/*', 'customers', 'customer/*','customer_mails', 'customer_mail/*']) ? ' open' : '' }}">
                        <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                            <i class="sidenav-icon ion ion-md-bed"></i>
                            <div>Buchungen</div>
                        </a>
                        <ul class="sidenav-menu">
                            @if(Auth::user()->isPermission('crm-bo-re'))
                            <li class="sidenav-item{{ Request::is('requests') ? ' active' : '' }}">
                                <a href="{{ route('requests') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-search"></i><div>Buchungen</div></a>
                            </li>
                            @endif
                             {{--  
                            @if(Auth::user()->isPermission('crm-bo-bo'))
                             <li class="sidenav-item{{ Request::is(['bookings', 'booking/*']) ? ' active' : '' }}">
                                <a href="{{ route('bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-bed"></i><div>Buchungen</div></a>
                            </li>
                            @endif
                            --}}
                            @if(Auth::user()->isPermission('crm-bo-le'))
                                <li class="sidenav-item{{ Request::is(['leads', 'lead/*']) ? ' active' : '' }}">
                                    <a href="{{ route('leads') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-contact"></i><div>Anfragen</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('crm-bo-cu'))
                                <li class="sidenav-item{{ Request::is(['customers', 'customer/*']) ? ' active' : '' }}">
                                    <a href="{{ route('customers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-people"></i><div>Kunden</div></a>
                                </li>
                            @endif
                        </ul>
                    </li>
                    @endif
                    @if(Auth::user()->isPermission('crm-cm'))
                    <li class="sidenav-item{{ Request::is(['travel_users', 'travel_user/*', 'travel_user_booking_fewos', 'travel_user_booking_fewo/*']) ? ' open' : '' }}">
                        <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                            <i class="sidenav-icon ion ion-ios-home"></i>
                            <div>Buchungen FeWo</div>
                        </a>
                        <ul class="sidenav-menu">
                            @if(Auth::user()->isPermission('crm-cm-cf'))
                            <li class="sidenav-item{{ Request::is('travel_users') ? ' active' : '' }} {{ Request::is('travel_user/*') ? ' active' : '' }}">
                                <a href="{{ route('travel_users') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-people"></i><div>Kunden (FeWo)</div></a>
                            </li>
                            @endif
                            @if(Auth::user()->isPermission('crm-cm-bf'))
                            <li class="sidenav-item{{ Request::is('travel_user_booking_fewos') ? ' active' : '' }} {{ Request::is('travel_user_booking_fewo/*') ? ' active' : '' }}">
                                <a href="{{ route('travel_user_booking_fewos') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-bed"></i><div>Buchungen (FeWo)</div></a>
                            </li>
                            @endif
                        </ul>
                    </li>
                    @endif

                    @if(Auth::user()->isPermission('crm-mail'))
                    <li class="sidenav-item{{ Request::is(['mail/leads', 'mail/bookings', 'mail/booking_fewos']) ? ' open' : '' }}">
                        <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                            <i class="sidenav-icon ion ion-ios-mail"></i>
                            <div>E-Mails</div>
                        </a>
                        <ul class="sidenav-menu">
                            @if(Auth::user()->isPermission('crm-mail-le'))
                            <li class="sidenav-item{{ Request::is(['mail/leads', 'mail/lead/*']) ? ' active' : '' }}">
                                <a href="{{ route('mail_leads') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-people"></i><div>Anfragen </div></a>
                            </li>
                            @endif
                            @if(Auth::user()->isPermission('crm-mail-bo'))
                            <li class="sidenav-item{{ Request::is(['mail/bookings', 'mail/booking/*']) ? ' active' : '' }}">
                                <a href="{{ route('mail_bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-bed"></i><div>Buchungen</div></a>
                            </li>
                            @endif
                            @if(Auth::user()->isPermission('crm-mail-bf'))
                            <li class="sidenav-item{{ Request::is(['mail/booking_fewos', 'mail/booking_fewo/*']) ? ' active' : '' }}">
                                <a href="{{ route('mail_booking_fewos') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-home"></i><div>Buchungen (FeWo)</div></a>
                            </li>
                            @endif
                        </ul>
                    </li>
                    @endif
                @endif
                @if(Auth::user()->isPermission('crm-old-cm'))
                <li class="sidenav-divider mb-1"></li>
                <li class="sidenav-header small font-weight-semibold">ADMIN CRM altes System</li>

                <li class="sidenav-item">
                    <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                        <i class="sidenav-icon ion ion-ios-people"></i>
                        <div>Kundenverwaltung</div>
                    </a>
                    <ul class="sidenav-menu">
                        <li class="sidenav-item">
                            <a href="{{ make_old_url('/index.php/customers') }}" class="sidenav-link">
                                <div>Kunden</div>
                            </a>
                        </li>
                        <li class="sidenav-item">
                            <a href="{{ make_old_url('/index.php/leads') }}" class="sidenav-link">
                                <div>Anfragen</div>
                            </a>
                        </li>
                        <li class="sidenav-item">
                            <a href="{{ make_old_url('/index.php/bookings') }}" class="sidenav-link">
                                <div>Buchungen</div>
                            </a>
                        </li>
                        <li class="sidenav-item">
                            <a href="{{ make_old_url('/index.php/payments') }}" class="sidenav-link">
                                <div>Zahlungen</div>
                            </a>
                        </li>
                    </ul>
                </li>
                @endif
                @if(Auth::user()->isPermission('cms'))
                    <li class="sidenav-divider mb-1"></li>
                    <li class="sidenav-header small font-weight-semibold">ADMIN CMS</li>
                        @if(Auth::user()->isPermission('cms-iq-assets'))
                       <li class="sidenav-item{{ Request::is('iq/content/assets') ? ' active' : '' }}">
                            <a href="{{ route('iq_content_assets') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-images"></i><div>Medien</div></a>
                        </li>
                        @endif

                    @if(Auth::user()->isPermission('cms-tg'))
                        <li class="sidenav-item{{ Request::is('cms/travel_guide/*') ? ' open' : '' }} {{ Request::is('iq/content/tree/*') ? ' open' : '' }}">
                            <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                                <i class="sidenav-icon ion ion-ios-journal"></i>
                                <div>Reiseführer</div>
                            </a>
                            <ul class="sidenav-menu">
                                <li class="sidenav-item{{ Request::is('iq/content/tree/*') ? ' active' : '' }}">
                                    <a href="{{ route('iq_content_tree_index') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-list"></i><div>Reiseführer Tree</div></a>
                                </li>
                                {{--
                                <li class="sidenav-item{{ Request::is('cms/travel_guide/page') ? ' active' : '' }}">
                                    <a href="{{ route('cms_travel_guide_page') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-list-box"></i><div>Reiseführer Seiten</div></a>
                                </li>
                                --}}
                                <li class="sidenav-item{{ Request::is('cms/travel_guide/content') ? ' active' : '' }}">
                                    <a href="{{ route('cms_travel_guide_content') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-paper"></i><div>Reiseführer Inhalte</div></a>
                                </li>
                            </ul>
                        </li>
                    @endif
                    @if(Auth::user()->isPermission('cms-fewo'))
                        <li class="sidenav-item{{ Request::is('cms/fewo/*') ? ' open' : '' }}">
                            <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                                <i class="sidenav-icon ion ion-ios-home"></i>
                                <div>FeWo</div>
                            </a>
                            <ul class="sidenav-menu">
                                <li class="sidenav-item{{ Request::is(['cms/fewo/all', 'cms/fewo/all/*']) ? ' active' : '' }}">
                                    <a href="{{ route('cms_fewo_all') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-paper"></i><div>FeWo Allgemein</div></a>
                                </li>
                                <li class="sidenav-item{{ Request::is(['cms/fewo/content', 'cms/fewo/content/*']) ? ' active' : '' }}">
                                    <a href="{{ route('cms_fewo_content') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-paper"></i><div>FeWo Inhalte</div></a>
                                </li>
                            </ul>
                        </li>
                    @endif
                     @if(Auth::user()->isPermission('cms-fb'))
                    <li class="sidenav-item{{ Request::is('cms/feedback', 'cms/feedback/*') ? ' active' : '' }}">
                        <a href="{{ route('cms_feedback') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-chatboxes"></i><div>Feedback</div></a>
                    </li>
                    @endif
                    @if(Auth::user()->isPermission('cms-aq'))
                        <li class="sidenav-item{{ Request::is('cms/answer_question', 'cms/answer_question/*') ? ' active' : '' }}">
                            <a href="{{ route('cms_answer_question') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-help-buoy"></i><div>Fragen & Antworten</div></a>
                        </li>
                    @endif
                    @if(Auth::user()->isPermission('cms-sb'))
                    <li class="sidenav-item{{ Request::is('cms/sidebar') ? ' active' : '' }}">
                        <a href="{{ route('cms_sidebar') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-list"></i><div>Sidebar</div></a>
                    </li>
                    @endif
                    @if(Auth::user()->isPermission('cms-cn'))
                        <li class="sidenav-item{{ Request::is('cms/content/*') ? ' open' : '' }}">
                            <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                                <i class="sidenav-icon ion ion-md-map"></i>
                                <div>Inhalte</div>
                            </a>
                            <ul class="sidenav-menu">
                                @if(Auth::user()->isPermission('cms-cn-in'))
                                <li class="sidenav-item{{ Request::is('cms/content/infos') ? ' active' : '' }}">
                                    <a href="{{ route('cms_content_infos') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-business"></i><div>Infos</div></a>
                                </li>
                                @endif
                                @if(Auth::user()->isPermission('cms-cn-al'))
                                    <li class="sidenav-item{{ Request::is('cms/content/all') ? ' active' : '' }}">
                                        <a href="{{ route('cms_content_all') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-paper"></i><div>Allgemein</div></a>
                                    </li>
                                @endif
                                @if(Auth::user()->isPermission('cms-cn-au'))
                                    <li class="sidenav-item{{ Request::is('cms/content/author') ? ' active' : '' }}">
                                        <a href="{{ route('cms_content_author') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-finger-print"></i><div>Autoren</div></a>
                                    </li>
                                @endif
                            </ul>
                        </li>
                    @endif
                @endif
             @endif

                @if(Auth::user()->isSuperAdmin())
                <li class="sidenav-divider mb-1"></li>
                <li class="sidenav-header small font-weight-semibold">SUPERADMIN</li>
                    @if(Auth::user()->isPermission('sua-st'))
                    <li class="sidenav-item{{ Request::is('admin/settings/*') ? ' open' : '' }}">
                        <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                            <i class="sidenav-icon ion ion-ios-settings"></i>
                            <div>Einstellungen</div>
                        </a>
                        <ul class="sidenav-menu">
                            @if(Auth::user()->isPermission('sua-st-al'))
                                <li class="sidenav-item{{ Request::is('admin/settings/airline') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_airline') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-airplane"></i><div>{{ __('Airline') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-em'))
                                <li class="sidenav-item{{ Request::is('admin/settings/emails') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_emails') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-mail"></i><div>{{ __('E-Mails') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-ke'))
                                <li class="sidenav-item{{ Request::is('admin/settings/keyword') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_keyword') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-key"></i><div>{{ __('Keywords') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-sp'))
                                <li class="sidenav-item{{ Request::is('admin/settings/service_provider') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_service_provider') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-archive"></i><div>{{ __('Leistungsträger') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-tn'))
                                <li class="sidenav-item{{ Request::is('admin/settings/travel_nationality') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_travel_nationality') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-people"></i><div>{{ __('Nationalitäten') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-co'))
                                <li class="sidenav-item{{ Request::is('admin/settings/travel_country') ? ' active' : '' }} {{ Request::is('admin/settings/travel_country/*') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_travel_country') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-globe"></i><div>{{ __('Reiseländer') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-tp'))
                            <li class="sidenav-item{{ Request::is('admin/settings/travel_program') ? ' active' : '' }}">
                                <a href="{{ route('admin_settings_travel_program') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-airplane"></i><div>{{ __('Reiseprogramme') }}</div></a>
                            </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-bs'))
                            <li class="sidenav-item{{ Request::is('admin/settings/booking_status') ? ' active' : '' }}">
                                <a href="{{ route('admin_settings_booking_status') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-stats"></i><div>{{ __('Reisestatus') }}</div></a>
                            </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-tc'))
                                <li class="sidenav-item{{ Request::is('admin/settings/travel_company') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_travel_company') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-archive"></i><div>{{ __('Veranstalter') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-st-in'))
                                <li class="sidenav-item{{ Request::is('admin/settings/insurance') ? ' active' : '' }}">
                                    <a href="{{ route('admin_settings_insurance') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-umbrella"></i><div>{{ __('Versicherungen') }}</div></a>
                                </li>
                            @endif
                                @if(Auth::user()->isPermission('sua-st-ca'))
                                    <li class="sidenav-item{{ Request::is('admin/settings/categories') ? ' active' : '' }}">
                                        <a href="{{ route('admin_settings_categories') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-list-box"></i><div>{{ __('Kategorien') }}</div></a>
                                    </li>
                                @endif
                        </ul>
                    </li>
                    @endif


                @if(Auth::user()->isPermission('sua-re'))
                    <li class="sidenav-item{{ Request::is('admin/report/*') ? ' open' : '' }}">
                        <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                            <i class="sidenav-icon ion ion-md-analytics"></i>
                            <div>Reporting</div>
                        </a>
                        <ul class="sidenav-menu">
                            @if(Auth::user()->isPermission('sua-re-bo'))
                                <li class="sidenav-item{{ Request::is('admin/report/bookings') ? ' active' : '' }}">
                                    <a href="{{ route('admin_report_bookings') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-bed"></i><div>{{ __('Buchungen & Leistungen') }}</div></a>
                                </li>
                            @endif
                            @if(Auth::user()->isPermission('sua-re-pp'))
                                <li class="sidenav-item{{ Request::is('admin/report/providers') ? ' active' : '' }}">
                                    <a href="{{ route('admin_report_providers') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-cash"></i><div>{{ __('Leistungsträger-Zahlungen') }}</div></a>
                                </li>
                            @endif
                        </ul>
                    </li>
                @endif
                    @if(Auth::user()->isPermission('sua-ur-rt'))
                        <li class="sidenav-item{{ Request::is('admin/users') ? ' active' : '' }} {{ Request::is('admin/user/edit/*') ? ' active' : '' }}">
                            <a href="{{ route('admin_users') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-ribbon"></i><div>{{ __('User Rechte') }}</div></a>
                        </li>
                    @endif
                @endif

            @if(Auth::user()->isSySAdmin())
                <li class="sidenav-divider mb-1"></li>
                <li class="sidenav-header small font-weight-semibold">SYSADMIN</li>

                <li class="sidenav-item{{ Request::is('sysadmin/tools/*') ? ' open' : '' }}">
                    <a href="javascript:void(0)" class="sidenav-link sidenav-toggle">
                        <i class="sidenav-icon ion ion-ios-settings"></i>
                        <div>{{ __('Tools') }}</div>
                    </a>
                    <ul class="sidenav-menu">
                        <li class="sidenav-item{{ Request::is('sysadmin/tools/content_links') ? ' active' : '' }}">
                            <a href="{{ route('sysadmin_tools_content_links') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Tree from HTML') }}</div></a>
                        </li>
                        <li class="sidenav-item{{ Request::is('sysadmin/tools/tree') ? ' active' : '' }}">
                            <a href="{{ route('sysadmin_tools_tree') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Tree') }}</div></a>
                        </li>
                        <li class="sidenav-item{{ Request::is('sysadmin/tools/clean_tree_code') ? ' active' : '' }}">
                            <a href="{{ route('sysadmin_tools_clean_tree_code') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Clean Tree Code') }}</div></a>
                        </li>
                        <li class="sidenav-item{{ Request::is('sysadmin/tools/media_insert') ? ' active' : '' }}">
                            <a href="{{ route('sysadmin_tools_media_insert') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Media Insert') }}</div></a>
                        </li>
                        <li class="sidenav-item{{ Request::is('sysadmin/tools/import') ? ' active' : '' }}">
                            <a href="{{ route('sysadmin_tools_import') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-settings"></i><div>{{ __('Import') }}</div></a>
                        </li>
                    </ul>

                </li>
            @endif

                <li class="sidenav-divider mb-1"></li>

                <li class="sidenav-item">
                    <a href="{{ route('logout') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-power"></i><div>{{ __('Logout') }}</div></a>
                </li>
        </ul>
    </div>

@endif
