287 lines
13 KiB
PHP
Executable File
287 lines
13 KiB
PHP
Executable File
{{-- NetGescon Sidebar Brandizzata --}}
|
|
<nav class="h-full flex flex-col p-6">
|
|
<!-- NetGescon Logo -->
|
|
<div class="mb-8">
|
|
<a href="{{ route('admin.dashboard') }}" class="netgescon-logo">
|
|
<div class="netgescon-logo-icon">
|
|
<i class="fas fa-building"></i>
|
|
</div>
|
|
<div>
|
|
<div class="text-xl font-bold">NetGescon</div>
|
|
<div class="text-xs opacity-75">Gestionale Condomini</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Menu Principale -->
|
|
<div class="flex-1 space-y-1">
|
|
<!-- Dashboard -->
|
|
<a href="{{ route('admin.dashboard') }}"
|
|
class="netgescon-menu-item {{ request()->routeIs('admin.dashboard*') ? 'active' : '' }}">
|
|
<i class="fas fa-tachometer-alt"></i>
|
|
<span>Dashboard</span>
|
|
</a>
|
|
|
|
<!-- Anagrafica Section -->
|
|
<div class="pt-4">
|
|
<button class="sidebar-section-toggle w-full flex items-center justify-between text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 px-4 hover:text-white transition-colors"
|
|
data-section="anagrafica">
|
|
<span>Anagrafica</span>
|
|
<div class="flex items-center space-x-2">
|
|
<span class="bg-blue-500 text-white text-xs px-2 py-1 rounded-full">{{ App\Models\Stabile::count() + App\Models\UnitaImmobiliare::count() }}</span>
|
|
<i class="fas fa-chevron-down transition-transform"></i>
|
|
</div>
|
|
</button>
|
|
|
|
<div class="sidebar-section-content" data-section="anagrafica">
|
|
<a href="{{ route('admin.stabili.index') }}"
|
|
class="netgescon-menu-item {{ request()->routeIs('admin.stabili.*') ? 'active' : '' }}">
|
|
<i class="fas fa-building"></i>
|
|
<span>Stabili</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">{{ App\Models\Stabile::count() }}</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-home"></i>
|
|
<span>Unità Immobiliari</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">{{ App\Models\UnitaImmobiliare::count() }}</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-users"></i>
|
|
<span>Soggetti</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">{{ App\Models\Soggetto::count() ?? 0 }}</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-truck"></i>
|
|
<span>Fornitori</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Contabilità Section -->
|
|
<div class="pt-4">
|
|
<button class="sidebar-section-toggle w-full flex items-center justify-between text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 px-4 hover:text-white transition-colors"
|
|
data-section="contabilita">
|
|
<span>Contabilità</span>
|
|
<div class="flex items-center space-x-2">
|
|
<span class="bg-green-500 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
<i class="fas fa-chevron-down transition-transform"></i>
|
|
</div>
|
|
</button>
|
|
|
|
<div class="sidebar-section-content hidden" data-section="contabilita">
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-calculator"></i>
|
|
<span>Movimenti</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-file-invoice-dollar"></i>
|
|
<span>Preventivi</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-chart-bar"></i>
|
|
<span>Bilanci</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-credit-card"></i>
|
|
<span>Rate</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Gestione Section -->
|
|
<div class="pt-4">
|
|
<button class="sidebar-section-toggle w-full flex items-center justify-between text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 px-4 hover:text-white transition-colors"
|
|
data-section="gestione">
|
|
<span>Gestione</span>
|
|
<div class="flex items-center space-x-2">
|
|
<span class="bg-orange-500 text-white text-xs px-2 py-1 rounded-full">4</span>
|
|
<i class="fas fa-chevron-down transition-transform"></i>
|
|
</div>
|
|
</button>
|
|
|
|
<div class="sidebar-section-content hidden" data-section="gestione">
|
|
<a href="{{ route('admin.rubrica.index') }}"
|
|
class="netgescon-menu-item {{ request()->routeIs('admin.rubrica.*') ? 'active' : '' }}">
|
|
<i class="fas fa-address-book"></i>
|
|
<span>Rubrica Unica</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">{{ App\Models\Persona::count() ?? 0 }}</span>
|
|
</a>
|
|
|
|
<a href="{{ route('admin.persona-unita.index') }}"
|
|
class="netgescon-menu-item {{ request()->routeIs('admin.persona-unita.*') ? 'active' : '' }}">
|
|
<i class="fas fa-link"></i>
|
|
<span>Relazioni Persona-Unità</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">{{ App\Models\PersonaUnitaRelazione::where('attivo', true)->count() ?? 0 }}</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-file-alt"></i>
|
|
<span>Documenti</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-ticket-alt"></i>
|
|
<span>Tickets</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-users-cog"></i>
|
|
<span>Assemblee</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Strumenti Section -->
|
|
<div class="pt-4">
|
|
<button class="sidebar-section-toggle w-full flex items-center justify-between text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2 px-4 hover:text-white transition-colors"
|
|
data-section="strumenti">
|
|
<span>Strumenti</span>
|
|
<div class="flex items-center space-x-2">
|
|
<span class="bg-purple-500 text-white text-xs px-2 py-1 rounded-full">2</span>
|
|
<i class="fas fa-chevron-down transition-transform"></i>
|
|
</div>
|
|
</button>
|
|
|
|
<div class="sidebar-section-content hidden" data-section="strumenti">
|
|
<a href="{{ route('admin.code-quality.index') }}"
|
|
class="netgescon-menu-item {{ request()->routeIs('admin.code-quality.*') ? 'active' : '' }}">
|
|
<i class="fas fa-code"></i>
|
|
<span>Controllo Qualità</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">1</span>
|
|
</a>
|
|
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-envelope"></i>
|
|
<span>Comunicazioni</span>
|
|
<span class="ml-auto bg-gray-600 text-white text-xs px-2 py-1 rounded-full">0</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Footer Sidebar -->
|
|
<div class="pt-6 border-t border-gray-700">
|
|
<div class="flex items-center mb-4">
|
|
<div class="flex-shrink-0">
|
|
<div class="w-10 h-10 bg-gradient-to-r from-blue-500 to-blue-600 rounded-full flex items-center justify-center">
|
|
<span class="text-white text-sm font-medium">
|
|
{{ auth()->user() ? substr(auth()->user()->name, 0, 2) : 'U' }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="ml-3">
|
|
<p class="text-sm font-medium text-white">{{ auth()->user()->name ?? 'Utente' }}</p>
|
|
<p class="text-xs text-gray-400">Amministratore</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<a href="#" class="netgescon-menu-item">
|
|
<i class="fas fa-cog"></i>
|
|
<span>Impostazioni</span>
|
|
</a>
|
|
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<button type="submit" class="w-full netgescon-menu-item text-left">
|
|
<i class="fas fa-sign-out-alt"></i>
|
|
<span>Logout</span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Version Info -->
|
|
<div class="mt-4 pt-4 border-t border-gray-700 text-center">
|
|
<p class="text-xs text-gray-500">
|
|
NetGescon v2.1.0<br>
|
|
© 2025 NetGescon Development
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Initialize sidebar collapsible functionality
|
|
const sidebarToggles = document.querySelectorAll('.sidebar-section-toggle');
|
|
|
|
// Get saved state from localStorage or set defaults
|
|
const getSavedState = (section) => {
|
|
const saved = localStorage.getItem(`netgescon-sidebar-${section}`);
|
|
// Default: Anagrafica and Gestione open, others closed
|
|
if (saved === null) {
|
|
return section === 'anagrafica' || section === 'gestione';
|
|
}
|
|
return saved === 'true';
|
|
};
|
|
|
|
// Save state to localStorage
|
|
const saveState = (section, isOpen) => {
|
|
localStorage.setItem(`netgescon-sidebar-${section}`, isOpen.toString());
|
|
};
|
|
|
|
// Initialize sections with saved state
|
|
sidebarToggles.forEach(toggle => {
|
|
const section = toggle.dataset.section;
|
|
const content = document.querySelector(`[data-section="${section}"].sidebar-section-content`);
|
|
const chevron = toggle.querySelector('.fas.fa-chevron-down');
|
|
|
|
if (!content) return;
|
|
|
|
const isOpen = getSavedState(section);
|
|
|
|
if (isOpen) {
|
|
content.classList.remove('hidden');
|
|
chevron.style.transform = 'rotate(180deg)';
|
|
} else {
|
|
content.classList.add('hidden');
|
|
chevron.style.transform = 'rotate(0deg)';
|
|
}
|
|
|
|
// Add click event listener
|
|
toggle.addEventListener('click', function() {
|
|
const isCurrentlyOpen = !content.classList.contains('hidden');
|
|
|
|
if (isCurrentlyOpen) {
|
|
// Close section
|
|
content.classList.add('hidden');
|
|
chevron.style.transform = 'rotate(0deg)';
|
|
saveState(section, false);
|
|
} else {
|
|
// Open section
|
|
content.classList.remove('hidden');
|
|
chevron.style.transform = 'rotate(180deg)';
|
|
saveState(section, true);
|
|
}
|
|
});
|
|
});
|
|
|
|
// Optional: Auto-expand active section
|
|
const activeMenuItem = document.querySelector('.netgescon-menu-item.active');
|
|
if (activeMenuItem) {
|
|
const parentSection = activeMenuItem.closest('.sidebar-section-content');
|
|
if (parentSection && parentSection.classList.contains('hidden')) {
|
|
const sectionName = parentSection.dataset.section;
|
|
const toggle = document.querySelector(`[data-section="${sectionName}"].sidebar-section-toggle`);
|
|
if (toggle) {
|
|
toggle.click();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</script>
|