<?php
$appLogoSmall = \App\Models\AppSetting::getLogoSmallUrl();
$appName = \App\Models\AppSetting::getAppName() ?? 'Glastree';
?>
<!DOCTYPE html>
<html lang="it">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo $__env->yieldContent('title', e($appName)); ?></title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap">
    <?php echo $__env->yieldContent('styles'); ?>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <nav class="main-header navbar navbar-expand navbar-white navbar-light">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
                </li>
            </ul>
            <ul class="navbar-nav ml-auto">
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo e(route('help')); ?>" title="Guida">
                        <i class="fas fa-question-circle"></i>
                    </a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link" data-toggle="dropdown" href="#">
                        <i class="far fa-bell"></i>
                        <?php $unread = Auth::user()->unreadNotificheCount() ?? 0 ?>
                        <?php if($unread > 0): ?>
                        <span class="badge badge-warning navbar-badge"><?php echo e($unread); ?></span>
                        <?php endif; ?>
                    </a>
                    <div class="dropdown-menu dropdown-menu-right">
                        <span class="dropdown-header">Notifiche (<?php echo e($unread); ?>)</span>
                        <div class="dropdown-divider"></div>
                        <a href="#" class="dropdown-item">Visualizza tutte</a>
                    </div>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link" data-toggle="dropdown" href="#">
                        <i class="fas fa-user"></i> <?php echo e(Auth::user()->name); ?>

                    </a>
                    <div class="dropdown-menu dropdown-menu-right">
                        <a href="<?php echo e(route('profile')); ?>" class="dropdown-item">
                            <i class="fas fa-user-cog mr-2"></i> Profilo
                        </a>
                        <div class="dropdown-divider"></div>
                        <form method="POST" action="<?php echo e(route('logout')); ?>">
                            <?php echo csrf_field(); ?>
                            <button type="submit" class="dropdown-item">
                                <i class="fas fa-sign-out-alt mr-2"></i> Esci
                            </button>
                        </form>
                    </div>
                </li>
            </ul>
        </nav>

<?php
$appLogoSmall = \App\Models\AppSetting::getLogoSmallUrl();
$appName = \App\Models\AppSetting::getAppName() ?? 'Glastree';
?>
        <aside class="main-sidebar sidebar-dark-primary elevation-4">
            <a href="<?php echo e(route('dashboard')); ?>" class="brand-link">
                <?php if($appLogoSmall): ?>
                    <img src="<?php echo e($appLogoSmall); ?>" alt="Logo" class="brand-image" style="max-height: 35px; max-width: 40px;">
                <?php else: ?>
                    <i class="fas fa-tree brand-image ml-3 mr-2"></i>
                <?php endif; ?>
                <span class="brand-text font-weight-light"><?php echo e($appName); ?></span>
            </a>

            <div class="sidebar">
                <nav class="mt-2">
                    <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu">
                        <li class="nav-item">
                            <a href="<?php echo e(route('dashboard')); ?>" class="nav-link <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>">
                                <i class="nav-icon fas fa-tachometer-alt"></i>
                                <p>Dashboard</p>
                            </a>
                        </li>
                        <?php if(Auth::user()->canAccess('individui')): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('individui.index')); ?>" class="nav-link">
                                <i class="nav-icon fas fa-users"></i>
                                <p>Individui</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canAccess('gruppi')): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('gruppi.index')); ?>" class="nav-link">
                                <i class="nav-icon fas fa-folder"></i>
                                <p>Gruppi</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canAccess('documenti')): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('documenti.index')); ?>" class="nav-link">
                                <i class="nav-icon fas fa-file"></i>
                                <p>Documenti</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canAccess('eventi')): ?>
                        <li class="nav-item has-treeview">
                            <a href="<?php echo e(route('eventi.calendar')); ?>" class="nav-link">
                                <i class="nav-icon fas fa-calendar"></i>
                                <p>Eventi <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="<?php echo e(route('eventi.calendar')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-calendar-alt"></i>
                                        <p>Calendario</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('eventi.index')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-list"></i>
                                        <p>Elenco</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('eventi.create')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-plus"></i>
                                        <p>Nuovo Evento</p>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canAccess('email') || Auth::user()->canAccess('mailing')): ?>
                        <li class="nav-item has-treeview">
                            <a href="<?php echo e(route('email.index', 'inbox')); ?>" class="nav-link">
                                <i class="nav-icon fas fa-envelope"></i>
                                <p>Email <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
                            </a>
                            <ul class="nav nav-treeview">
                                <?php if(Auth::user()->canAccess('email')): ?>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.compose')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-plus"></i>
                                        <p>Nuova Email</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.index', 'inbox')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-inbox"></i>
                                        <p>In arrivo</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.index', 'starred')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-star"></i>
                                        <p>Preferiti</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.index', 'sent')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-paper-plane"></i>
                                        <p>Inviate</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.index', 'drafts')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-edit"></i>
                                        <p>Bozze</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.index', 'archive')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-archive"></i>
                                        <p>Archivio</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('email.index', 'trash')); ?>" class="nav-link">
                                        <i class="nav-icon fas fa-trash"></i>
                                        <p>Cestino</p>
                                    </a>
                                </li>
                                <?php endif; ?>
                            </ul>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canAccess('mailing')): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('mailing-liste.index')); ?>" class="nav-link">
                                <i class="nav-icon fas fa-list"></i>
                                <p>Mailing List</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canAccess('report')): ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('report.index')); ?>" class="nav-link <?php echo e(request()->routeIs('report.*') ? 'active' : ''); ?>">
                                <i class="nav-icon fas fa-chart-bar"></i>
                                <p>Report</p>
                            </a>
                        </li>
                        <?php endif; ?>
                        <?php if(Auth::user()->canManage('settings')): ?>
                        <li class="nav-item">
                            <a href="/impostazioni" class="nav-link <?php echo e(request()->is('impostazioni*') ? 'active' : ''); ?>">
                                <i class="nav-icon fas fa-cog"></i>
                                <p>Impostazioni</p>
                            </a>
                        </li>
                        <li class="nav-item has-treeview <?php echo e(request()->is('admin/*') ? 'menu-open' : ''); ?>">
                            <a href="#" class="nav-link <?php echo e(request()->is('admin/*') ? 'active' : ''); ?>">
                                <i class="nav-icon fas fa-users-cog"></i>
                                <p>Admin <i class="right fas fa-angle-left" style="font-size: 0.8rem;"></i></p>
                            </a>
                            <ul class="nav nav-treeview">
                                <li class="nav-item">
                                    <a href="/admin/utenti" class="nav-link <?php echo e(request()->routeIs('admin.utenti.*') ? 'active' : ''); ?>">
                                        <i class="nav-icon fas fa-user-shield"></i>
                                        <p>Utenti</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('admin.ruoli.index')); ?>" class="nav-link <?php echo e(request()->routeIs('admin.ruoli.*') ? 'active' : ''); ?>">
                                        <i class="nav-icon fas fa-tag"></i>
                                        <p>Ruoli</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="/admin/backup" class="nav-link <?php echo e(request()->routeIs('admin.backup.*') ? 'active' : ''); ?>">
                                        <i class="nav-icon fas fa-hdd"></i>
                                        <p>Backup</p>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <a href="<?php echo e(route('admin.activity-logs.index')); ?>" class="nav-link <?php echo e(request()->routeIs('admin.activity-logs.*') ? 'active' : ''); ?>">
                                        <i class="nav-icon fas fa-history"></i>
                                        <p>Log Attività</p>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <?php endif; ?>
                        <li class="nav-item">
                            <a href="<?php echo e(route('help')); ?>" class="nav-link <?php echo e(request()->routeIs('help') ? 'active' : ''); ?>">
                                <i class="nav-icon fas fa-question-circle"></i>
                                <p>Guida / Aiuto</p>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </aside>

        <div class="content-wrapper" style="min-height: calc(100vh - 120px);">
            <div class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6">
                            <h1 class="m-0"><?php echo $__env->yieldContent('page_title', 'Dashboard'); ?></h1>
                        </div>
                        <div class="col-sm-6">
                            <ol class="breadcrumb float-sm-right">
                                <?php echo $__env->yieldContent('breadcrumbs'); ?>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>

            <div class="content">
                <div class="container-fluid">
                    <?php echo $slot ?? ''; ?>

                    <?php echo $__env->yieldContent('content'); ?>
                </div>
            </div>
        </div>

        <footer class="main-footer">
            <strong><?php echo e(\App\Models\AppSetting::getFooterText()); ?></strong>
            <?php if(\App\Models\AppSetting::shouldShowVersion() && \App\Models\AppSetting::getAppVersion()): ?>
                <span class="ml-2">v<?php echo e(\App\Models\AppSetting::getAppVersion()); ?></span>
            <?php endif; ?>
        </footer>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/js/adminlte.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <?php echo $__env->yieldContent('scripts'); ?>
</body>
</html><?php /**PATH /var/www/html/glastree/resources/views/layouts/adminlte.blade.php ENDPATH**/ ?>