624 lines
37 KiB
PHP
Executable File
624 lines
37 KiB
PHP
Executable File
{{-- Sidebar NetGescon brandizzata con menu organizzato per categorie --}}
|
|
<nav class="h-full flex flex-col bg-slate-800 text-white">
|
|
<!-- Logo NetGescon in alto -->
|
|
<div class="p-4 border-b border-slate-700 flex-shrink-0">
|
|
<div class="flex items-center">
|
|
<i class="fas fa-building text-blue-400 text-xl mr-3"></i>
|
|
<span class="text-lg font-bold">NETGESCON</span>
|
|
</div>
|
|
<div class="text-xs text-gray-400 mt-1">
|
|
{{ now()->format('d/m/Y, H:i') }}
|
|
|
|
@php
|
|
// Evita Undefined variable errors e gestisci fallback moduli
|
|
$contabActive = $contabActive ?? in_array('Contabilita', $activeModules ?? []);
|
|
$currentStabileId = $stabileCorrenteId
|
|
?? optional($stabili->first())->id
|
|
?? (int) config('netgescon.defaults.default_stabile_id', 25);
|
|
@endphp
|
|
</div>
|
|
</div>
|
|
<!-- Sezione Notizie (come nelle immagini) -->
|
|
@if(!isset($hasAnyStabile) || $hasAnyStabile)
|
|
<div class="p-4 bg-cyan-400 text-cyan-900 text-sm flex-shrink-0">
|
|
<div class="font-semibold mb-1">📢 Notizie</div>
|
|
<div class="text-xs space-y-1">
|
|
<div>• 3 tickets urgenti da risolvere</div>
|
|
<div>• Backup completato con successo</div>
|
|
<div>• Rate scadute €1.240</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Menu principale organizzato per categorie - con scrolling limitato -->
|
|
<div class="flex-1 py-4 overflow-y-auto min-h-0">
|
|
<ul class="space-y-1 px-3">
|
|
<!-- Dashboard -->
|
|
<li>
|
|
<a href="{{ route('admin.dashboard') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors {{ request()->routeIs('admin.dashboard') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-5 mr-3"></i>
|
|
<span>Dashboard Generale</span>
|
|
</a>
|
|
</li>
|
|
|
|
<!-- Rubrica Unica - Voce Principale -->
|
|
<li>
|
|
<a href="{{ route('admin.rubrica.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors {{ request()->routeIs('admin.rubrica.*') ? 'bg-slate-700 text-purple-400' : '' }}">
|
|
<i class="fas fa-address-book w-5 mr-3 text-purple-400"></i>
|
|
<span>Rubrica Unica</span>
|
|
</a>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: STABILI -->
|
|
<li class="mt-4">
|
|
<a href="{{ route('admin.dashboards.stabili') }}"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.dashboards.stabili') || request()->routeIs('admin.stabili.*') ? 'bg-slate-700 text-green-400' : '' }}">
|
|
<i class="fas fa-building w-5 mr-3 text-green-400"></i>
|
|
<span>STABILI</span>
|
|
<i id="stabili-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('stabili', event)"></i>
|
|
</a>
|
|
<ul id="stabili-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.stabili') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.dashboards.stabili') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-4 mr-2"></i>
|
|
<span>Dashboard Stabili</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.stabili.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.stabili.index') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-list w-4 mr-2"></i>
|
|
<span>Elenco Stabili</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ $currentStabileId ? route('admin.palazzine.index', ['stabile_id' => $currentStabileId]) : route('admin.stabili.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.palazzine.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-building w-4 mr-2"></i>
|
|
<span>Palazzine e Unità</span>
|
|
</a>
|
|
</li>
|
|
@if(!isset($hasAnyStabile) || $hasAnyStabile)
|
|
<li>
|
|
<a href="{{ $currentStabileId ? route('admin.tabelle-millesimali.index', ['stabile_id' => $currentStabileId]) : route('admin.tabelle-millesimali.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.tabelle-millesimali.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-table w-4 mr-2"></i>
|
|
<span>Tabelle Millesimali</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ $currentStabileId ? route('piano_conti.index', ['stabile_id' => $currentStabileId]) : route('piano_conti.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('piano_conti.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-calculator w-4 mr-2"></i>
|
|
<span>Piano dei Conti</span>
|
|
<span class="ml-auto text-xs bg-green-500 text-white px-2 py-1 rounded">CONTI</span>
|
|
</a>
|
|
</li>
|
|
@endif
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: CONDOMINI -->
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.condomini') }}"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.dashboards.condomini') || request()->routeIs('admin.rubrica.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-users w-5 mr-3 text-blue-400"></i>
|
|
<span>CONDOMINI</span>
|
|
<i id="condomini-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('condomini', event)"></i>
|
|
</a>
|
|
<ul id="condomini-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.condomini') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.dashboards.condomini') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-4 mr-2"></i>
|
|
<span>Dashboard Condomini</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.rubrica.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.rubrica.*') ? 'bg-slate-700 text-purple-400' : '' }}">
|
|
<i class="fas fa-address-book w-4 mr-2"></i>
|
|
<span>Rubrica Unica</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.soggetti.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.soggetti.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-users w-4 mr-2"></i>
|
|
<span>Gestione Soggetti</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.persona-unita.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.persona-unita.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-link w-4 mr-2"></i>
|
|
<span>Relazioni Persona-Unità</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: AMMINISTRAZIONE -->
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.amministrazione') }}"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.dashboards.amministrazione') || request()->routeIs('piano_conti.*') ? 'bg-slate-700 text-purple-400' : '' }}">
|
|
<i class="fas fa-cogs w-5 mr-3 text-purple-400"></i>
|
|
<span>AMMINISTRAZIONE</span>
|
|
<i id="amministrazione-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('amministrazione', event)"></i>
|
|
</a>
|
|
<ul id="amministrazione-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.amministrazione') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.dashboards.amministrazione') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-4 mr-2"></i>
|
|
<span>Dashboard Amministrazione</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.tickets.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.tickets.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-ticket-alt w-4 mr-2"></i>
|
|
<span>Tickets</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.documenti.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.documenti.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-folder w-4 mr-2"></i>
|
|
<span>Documenti</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.affitti.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.affitti.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-house-user w-4 mr-2 text-sky-300"></i>
|
|
<div class="flex flex-col">
|
|
<span>Gestione Affitti</span>
|
|
<span class="text-[11px] text-slate-300">Console operativa</span>
|
|
</div>
|
|
<span class="ml-auto text-[10px] uppercase tracking-widest bg-sky-500 text-white px-2 py-0.5 rounded">LIVE</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.fornitori.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.fornitori.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-handshake-angle w-4 mr-2 text-emerald-300"></i>
|
|
<div class="flex flex-col">
|
|
<span>Hub Fornitori</span>
|
|
<span class="text-[11px] text-slate-300">Rubrica tecnica & SLA</span>
|
|
</div>
|
|
<span class="ml-auto text-[10px] uppercase tracking-widest bg-emerald-500 text-white px-2 py-0.5 rounded">HUB</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.tickets.index') }}#planner"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.tickets.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-calendar-check w-4 mr-2 text-amber-300"></i>
|
|
<div class="flex flex-col">
|
|
<span>Ticket Planner</span>
|
|
<span class="text-[11px] text-slate-300">Agenda squadre</span>
|
|
</div>
|
|
<span class="ml-auto text-[10px] uppercase tracking-widest bg-amber-500 text-white px-2 py-0.5 rounded">BETA</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#" class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm">
|
|
<i class="fas fa-users-cog w-4 mr-2"></i>
|
|
<span>Assemblee</span>
|
|
<span class="ml-auto text-xs bg-yellow-500 text-white px-2 py-1 rounded">PRESTO</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#" class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm">
|
|
<i class="fas fa-envelope w-4 mr-2"></i>
|
|
<span>Comunicazioni</span>
|
|
<span class="ml-auto text-xs bg-yellow-500 text-white px-2 py-1 rounded">PRESTO</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: CONTABILITÀ -->
|
|
<li class="{{ $contabActive ? '' : 'opacity-50 cursor-not-allowed' }}">
|
|
<a href="{{ $contabActive ? route('admin.dashboards.contabilita') : 'javascript:void(0)' }}"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.dashboards.contabilita') || request()->routeIs('admin.bilanci.*') || request()->routeIs('admin.contabilita.*') ? 'bg-slate-700 text-yellow-400' : '' }}">
|
|
<i class="fas fa-calculator w-5 mr-3 text-yellow-400"></i>
|
|
<span>CONTABILITÀ</span>
|
|
<i id="contabilita-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('contabilita', event)"></i>
|
|
</a>
|
|
<ul id="contabilita-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
@if($contabActive)
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.contabilita') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.dashboards.contabilita') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-4 mr-2"></i>
|
|
<span>Dashboard Contabilità</span>
|
|
</a>
|
|
</li>
|
|
@endif
|
|
<li>
|
|
<a href="{{ route('admin.bilanci.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.bilanci.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-euro-sign w-4 mr-2"></i>
|
|
<span>Bilanci</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.contabilita.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.contabilita.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-file-invoice w-4 mr-2"></i>
|
|
<span>Registrazioni</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.voci-spesa.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.voci-spesa.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-list-alt w-4 mr-2"></i>
|
|
<span>Voci di Spesa</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.rate.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.rate.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-credit-card w-4 mr-2"></i>
|
|
<span>Rate e Pagamenti</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: GESTIONE ECONOMICA -->
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.economica') }}"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.dashboards.economica') || request()->routeIs('admin.preventivi.*') ? 'bg-slate-700 text-orange-400' : '' }}">
|
|
<i class="fas fa-chart-line w-5 mr-3 text-orange-400"></i>
|
|
<span>GESTIONE ECONOMICA</span>
|
|
<i id="economica-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('economica', event)"></i>
|
|
</a>
|
|
<ul id="economica-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.economica') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.dashboards.economica') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-4 mr-2"></i>
|
|
<span>Dashboard Gestionale</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.preventivi.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.preventivi.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-file-invoice-dollar w-4 mr-2"></i>
|
|
<span>Preventivi</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.fornitori.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.fornitori.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-truck w-4 mr-2"></i>
|
|
<span>Fornitori</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.piani-rateizzazione.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.piani-rateizzazione.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-coins w-4 mr-2"></i>
|
|
<span>Piani Rateizzazione</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: MODULI -->
|
|
<li>
|
|
<a href="#"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('stampeRate.*') ? 'bg-slate-700 text-indigo-400' : '' }}">
|
|
<i class="fas fa-puzzle-piece w-5 mr-3 text-indigo-400"></i>
|
|
<span>MODULI</span>
|
|
<i id="moduli-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('moduli', event)"></i>
|
|
</a>
|
|
<ul id="moduli-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('stampeRate.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('stampeRate.*') ? 'bg-slate-700 text-indigo-400' : '' }}">
|
|
<i class="fas fa-print w-4 mr-2"></i>
|
|
<span>Stampe Rate</span>
|
|
<span class="ml-auto bg-indigo-500 text-white text-xs px-2 py-1 rounded">€99</span>
|
|
</a>
|
|
</li>
|
|
<li class="{{ $contabActive ? '' : 'opacity-50 cursor-not-allowed' }}">
|
|
<a href="{{ $contabActive ? route('admin.contabilita.index') : 'javascript:void(0)' }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.contabilita.*') ? 'bg-slate-700 text-green-400' : '' }}">
|
|
<i class="fas fa-calculator w-4 mr-2"></i>
|
|
<span>Contabilità</span>
|
|
@if($contabActive)
|
|
<span class="ml-auto bg-green-500 text-white text-xs px-2 py-1 rounded">ATTIVO</span>
|
|
@else
|
|
<span class="ml-auto bg-green-500 text-white text-xs px-2 py-1 rounded">€199</span>
|
|
@endif
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm opacity-50 cursor-not-allowed">
|
|
<i class="fas fa-users w-4 mr-2"></i>
|
|
<span>Assemblee</span>
|
|
<span class="ml-auto bg-blue-500 text-white text-xs px-2 py-1 rounded">€99</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm opacity-50 cursor-not-allowed">
|
|
<i class="fas fa-wrench w-4 mr-2"></i>
|
|
<span>Manutenzioni</span>
|
|
<span class="ml-auto bg-orange-500 text-white text-xs px-2 py-1 rounded">€149</span>
|
|
</a>
|
|
</li>
|
|
<li class="pt-2 border-t border-slate-600">
|
|
<a href="#"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm text-indigo-300">
|
|
<i class="fas fa-store w-4 mr-2"></i>
|
|
<span>Marketplace Moduli</span>
|
|
<span class="ml-auto text-xs bg-gradient-to-r from-indigo-500 to-purple-600 text-white px-2 py-1 rounded">NEW</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<!-- CATEGORIA: GESCON IMPORT -->
|
|
@if(!empty($canGesconImport))
|
|
<li>
|
|
<a href="{{ route('admin.gescon-import.index') }}#dashboard"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.contabilita-gescon.*') || request()->routeIs('admin.gescon-import.*') ? 'bg-slate-700 text-cyan-400' : '' }}">
|
|
<i class="fas fa-database w-5 mr-3 text-cyan-400"></i>
|
|
<span>GESCON IMPORT</span>
|
|
<i id="gescon-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('gescon', event)"></i>
|
|
</a>
|
|
<ul id="gescon-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('admin.gescon-import.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->fullUrlIs(route('admin.gescon-import.index')) ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-upload w-4 mr-2"></i>
|
|
<span>Sistema Import</span>
|
|
<span class="ml-auto bg-cyan-500 text-white text-xs px-2 py-1 rounded">TOOLS</span>
|
|
</a>
|
|
</li>
|
|
@can('gescon-import.config')
|
|
<li>
|
|
<a href="{{ route('admin.gescon-import.config') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.gescon-import.config') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-cog w-4 mr-2"></i>
|
|
<span>Configurazione Import</span>
|
|
</a>
|
|
</li>
|
|
@endcan
|
|
@if(!empty($canContabilitaGescon))
|
|
<li>
|
|
<a href="{{ route('admin.contabilita-gescon.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.contabilita-gescon.*') ? 'bg-slate-700 text-cyan-400' : '' }}">
|
|
<i class="fas fa-list-alt w-4 mr-2"></i>
|
|
<span>Operazioni Contabili</span>
|
|
<span class="ml-auto bg-yellow-500 text-white text-xs px-2 py-1 rounded">EDIT</span>
|
|
</a>
|
|
</li>
|
|
@endif
|
|
<li>
|
|
<a href="#"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm opacity-50 cursor-not-allowed">
|
|
<i class="fas fa-sync w-4 mr-2"></i>
|
|
<span>Sincronizzazione</span>
|
|
<span class="ml-auto bg-green-500 text-white text-xs px-2 py-1 rounded">PRESTO</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="#"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm opacity-50 cursor-not-allowed">
|
|
<i class="fas fa-chart-bar w-4 mr-2"></i>
|
|
<span>Report Avanzati</span>
|
|
<span class="ml-auto bg-purple-500 text-white text-xs px-2 py-1 rounded">PRESTO</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
@endif
|
|
|
|
<!-- CATEGORIA: SUPPORTO -->
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.supporto') }}"
|
|
class="w-full flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-left bg-slate-900 font-semibold {{ request()->routeIs('admin.dashboards.supporto') || request()->routeIs('admin.tickets.*') ? 'bg-slate-700 text-red-400' : '' }}">
|
|
<i class="fas fa-life-ring w-5 mr-3 text-red-400"></i>
|
|
<span>SUPPORTO</span>
|
|
<i id="supporto-chevron" class="fas fa-chevron-down ml-auto text-xs transition-transform ng-chevron-toggle" onclick="toggleCategory('supporto', event)"></i>
|
|
</a>
|
|
<ul id="supporto-menu" class="ml-6 mt-1 space-y-1 hidden">
|
|
<li>
|
|
<a href="{{ route('admin.dashboards.supporto') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.dashboards.supporto') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-tachometer-alt w-4 mr-2"></i>
|
|
<span>Dashboard Supporto</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.tickets.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.tickets.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-ticket-alt w-4 mr-2"></i>
|
|
<span>Tickets</span>
|
|
<span class="ml-auto bg-red-500 text-white text-xs px-2 py-1 rounded-full">3</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.impostazioni.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.impostazioni.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-cog w-4 mr-2"></i>
|
|
<span>Impostazioni</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ route('admin.code-quality.index') }}"
|
|
class="flex items-center px-3 py-2 rounded hover:bg-slate-700 transition-colors text-sm {{ request()->routeIs('admin.code-quality.*') ? 'bg-slate-700 text-blue-400' : '' }}">
|
|
<i class="fas fa-bug w-4 mr-2"></i>
|
|
<span>Debug Sistema</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
|
|
<script>
|
|
// Sistema Accordion Menu NetGescon - Solo una sezione aperta alla volta
|
|
let currentOpenCategory = null;
|
|
|
|
// Funzione per gestire l'accordion del menu principale
|
|
function toggleCategory(categoryId, event) {
|
|
// Se l'evento è presente, previeni il comportamento default del link
|
|
if (event && event.type === 'click') {
|
|
event.preventDefault();
|
|
|
|
// Se clicchiamo sulla categoria già aperta, chiudi il menu (toggle)
|
|
if (currentOpenCategory === categoryId) {
|
|
const menu = document.getElementById(categoryId + '-menu');
|
|
const chevron = document.getElementById(categoryId + '-chevron');
|
|
if (menu && chevron) {
|
|
menu.classList.add('hidden');
|
|
chevron.classList.remove('rotate-180');
|
|
currentOpenCategory = null;
|
|
localStorage.removeItem('netgescon-menu-active');
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
|
|
const menu = document.getElementById(categoryId + '-menu');
|
|
const chevron = document.getElementById(categoryId + '-chevron');
|
|
|
|
// Chiudi tutte le altre categorie
|
|
closeAllCategories(categoryId);
|
|
|
|
if (menu && chevron) {
|
|
if (menu.classList.contains('hidden')) {
|
|
// Apri il menu corrente
|
|
menu.classList.remove('hidden');
|
|
chevron.classList.add('rotate-180');
|
|
currentOpenCategory = categoryId;
|
|
|
|
// Salva lo stato nel localStorage
|
|
localStorage.setItem('netgescon-menu-active', categoryId);
|
|
} else {
|
|
// Chiudi il menu corrente
|
|
menu.classList.add('hidden');
|
|
chevron.classList.remove('rotate-180');
|
|
currentOpenCategory = null;
|
|
|
|
// Rimuovi lo stato dal localStorage
|
|
localStorage.removeItem('netgescon-menu-active');
|
|
}
|
|
}
|
|
}
|
|
|
|
// Funzione per chiudere tutte le categorie eccetto quella specificata
|
|
function closeAllCategories(exceptCategoryId = null) {
|
|
const categories = ['stabili', 'condomini', 'amministrazione', 'contabilita', 'economica', 'moduli', 'gescon', 'supporto'];
|
|
|
|
categories.forEach(function(categoryId) {
|
|
if (categoryId !== exceptCategoryId) {
|
|
const menu = document.getElementById(categoryId + '-menu');
|
|
const chevron = document.getElementById(categoryId + '-chevron');
|
|
|
|
if (menu && chevron) {
|
|
menu.classList.add('hidden');
|
|
chevron.classList.remove('rotate-180');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
// Determina automaticamente quale categoria aprire in base alla route corrente
|
|
function determineActiveCategory() {
|
|
const currentPath = window.location.pathname;
|
|
|
|
// Mapping delle route alle categorie
|
|
const routeMapping = {
|
|
'stabili': ['stabili', 'palazzine', 'tabelle-millesimali', 'piano_conti', 'piano-conti'],
|
|
'condomini': ['rubrica', 'soggetti', 'persona-unita'],
|
|
'amministrazione': ['tickets', 'documenti'],
|
|
'contabilita': ['bilanci', 'contabilita', 'voci-spesa', 'rate'],
|
|
'economica': ['preventivi', 'fornitori', 'piani-rateizzazione'],
|
|
'moduli': ['stampe-rate', 'contabilita-avanzata', 'assemblee', 'manutenzioni'],
|
|
'gescon': ['gescon-import', 'contabilita-gescon'],
|
|
'supporto': ['impostazioni', 'code-quality', 'api-tokens']
|
|
};
|
|
|
|
// Controlla se la route corrente corrisponde a una dashboard
|
|
const dashboardMatch = currentPath.match(/\/admin\/dashboards\/(\w+)/);
|
|
if (dashboardMatch) {
|
|
return dashboardMatch[1];
|
|
}
|
|
|
|
// Controlla le altre route
|
|
for (const [category, routes] of Object.entries(routeMapping)) {
|
|
for (const route of routes) {
|
|
if (currentPath.includes(route)) {
|
|
return category;
|
|
}
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
// Ripristina lo stato del menu al caricamento della pagina
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Prima determina automaticamente quale categoria dovrebbe essere aperta
|
|
const autoCategory = determineActiveCategory();
|
|
|
|
// Poi controlla se c'è una preferenza salvata
|
|
const savedCategory = localStorage.getItem('netgescon-menu-active');
|
|
|
|
// Usa la categoria automatica o quella salvata
|
|
const categoryToOpen = autoCategory || savedCategory;
|
|
|
|
if (categoryToOpen) {
|
|
const menu = document.getElementById(categoryToOpen + '-menu');
|
|
const chevron = document.getElementById(categoryToOpen + '-chevron');
|
|
|
|
if (menu && chevron) {
|
|
// Chiudi tutte le altre categorie prima
|
|
closeAllCategories(categoryToOpen);
|
|
|
|
// Apri la categoria corretta
|
|
menu.classList.remove('hidden');
|
|
chevron.classList.add('rotate-180');
|
|
currentOpenCategory = categoryToOpen;
|
|
|
|
// Aggiorna il localStorage
|
|
localStorage.setItem('netgescon-menu-active', categoryToOpen);
|
|
}
|
|
}
|
|
|
|
// Nessun override del click sulla riga: il click sulla freccia gestisce l'accordion
|
|
});
|
|
|
|
// Funzione per ottimizzare l'esperienza mobile
|
|
function optimizeForMobile() {
|
|
if (window.innerWidth < 768) {
|
|
// Su mobile, chiudi automaticamente il menu dopo la navigazione
|
|
document.querySelectorAll('#stabili-menu a, #condomini-menu a, #amministrazione-menu a, #contabilita-menu a, #economica-menu a, #moduli-menu a, #gescon-menu a, #supporto-menu a').forEach(function(link) {
|
|
link.addEventListener('click', function() {
|
|
setTimeout(function() {
|
|
closeAllCategories();
|
|
currentOpenCategory = null;
|
|
localStorage.removeItem('netgescon-menu-active');
|
|
}, 100);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
// Ottimizza per mobile al caricamento e ridimensionamento
|
|
window.addEventListener('load', optimizeForMobile);
|
|
window.addEventListener('resize', optimizeForMobile);
|
|
</script>
|