# 🎯 NETGESCON CONTENT MENU STANDARD ## Manuale per replicare struttura menu e contenuti ### πŸ“… Versione: 2.0 - 5 Agosto 2025 ### 🎯 Obiettivo: Standardizzazione interfaccia per tutte le pagine --- ## 🎨 **PATTERN FUNZIONANTE IDENTIFICATO** ### βœ… **Strutture Menu che Funzionano**: 1. **Menu Principale con Sub-tabs** (ContabilitΓ , Stabili) 2. **Sub-menu Navigazione** (Tabelle Millesimali) 3. **Cards Statistiche** (Dashboard style) 4. **Layout Standard NetGescon** --- ## πŸ—‚οΈ **TEMPLATE MASTER - STRUTTURA STANDARD** ### πŸ“‹ **1. LAYOUT BASE OBBLIGATORIO** ```blade @extends('admin.layouts.netgescon') @section('title', 'Nome Modulo') @section('content')

Nome Modulo

@yield('stats-cards') @yield('main-content')
@endsection @push('styles') @yield('module-styles') @endpush ``` --- ## πŸ—οΈ **PATTERN 1: MENU PRINCIPALE CON SUB-TABS** ### 🎯 **Utilizzo**: Moduli principali (ContabilitΓ , Stabili, Condomini) ### πŸ“ **Template Tab Menu**: ```blade @section('menu-tabs') @endsection ``` ### πŸ’‘ **Icone Standard per Moduli**: ```php // Mapping icone per consistency $moduleIcons = [ 'list' => 'fas fa-list', 'create' => 'fas fa-plus', 'edit' => 'fas fa-edit', 'show' => 'fas fa-eye', 'reports' => 'fas fa-chart-bar', 'config' => 'fas fa-cog', 'export' => 'fas fa-download', 'import' => 'fas fa-upload', 'search' => 'fas fa-search', 'filter' => 'fas fa-filter' ]; ``` --- ## πŸ—οΈ **PATTERN 2: SUB-MENU NAVIGAZIONE** ### 🎯 **Utilizzo**: Sezioni dettaglio con tabs (Stabile Detail, etc.) ### πŸ“ **Template Tabs Detail**: ```blade
@yield('tab-dati-generali')
@yield('tab-dettagli')
@yield('tab-documenti')
``` --- ## πŸ—οΈ **PATTERN 3: CARDS STATISTICHE** ### 🎯 **Utilizzo**: Dashboard e pagine overview ### πŸ“ **Template Stats Cards**: ```blade @section('stats-cards')

{{ $stats['totale'] ?? 0 }}

Totale Items

{{ $stats['attivi'] ?? 0 }}

Attivi

{{ $stats['pending'] ?? 0 }}

In Sospeso

{{ $stats['problemi'] ?? 0 }}

Problemi

@endsection ``` ### 🎨 **Colori Standard Cards**: ```css /* Color mapping per consistency */ .small-box.bg-primary { background: #007bff; } /* Totali */ .small-box.bg-success { background: #28a745; } /* Positivi/Attivi */ .small-box.bg-warning { background: #ffc107; } /* In Attesa/Sospeso */ .small-box.bg-danger { background: #dc3545; } /* Errori/Problemi */ .small-box.bg-info { background: #17a2b8; } /* Info/Neutro */ .small-box.bg-secondary { background: #6c757d; } /* Secondario */ ``` --- ## πŸ“Š **TEMPLATE CONTROLLER STANDARD** ### 🎯 **Controller Pattern per Menu Funzionante**: ```php calculateStats(); // Dati principale per listing $items = $this->getMainData(); // Menu configuration $menuTabs = $this->getMenuTabs(); return view('admin.module.index', compact('stats', 'items', 'menuTabs')); } /** * Show detail with sub-tabs */ public function show($id) { $item = $this->findItem($id); $detailTabs = $this->getDetailTabs($item); $tabContent = $this->getTabContent($item); return view('admin.module.show', compact('item', 'detailTabs', 'tabContent')); } /** * Calculate statistics for cards */ private function calculateStats() { return [ 'totale' => Model::count(), 'attivi' => Model::where('stato', 'attivo')->count(), 'pending' => Model::where('stato', 'pending')->count(), 'problemi' => Model::where('stato', 'errore')->count(), ]; } /** * Get menu tabs configuration */ private function getMenuTabs() { return [ ['label' => 'Lista', 'route' => 'admin.module.index', 'icon' => 'fas fa-list', 'active' => true], ['label' => 'Nuovo', 'route' => 'admin.module.create', 'icon' => 'fas fa-plus'], ['label' => 'Reports', 'route' => 'admin.module.reports', 'icon' => 'fas fa-chart-bar'], ['label' => 'Config', 'route' => 'admin.module.config', 'icon' => 'fas fa-cog'], ]; } } ``` --- ## πŸ—„οΈ **DATABASE STANDARD CONNECTION** ### πŸ”‘ **Credenziali Database NetGescon**: ```env # File: .env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=netgescon DB_USERNAME=netgescon_user DB_PASSWORD=NetGescon2024! ``` ### πŸ“Š **Pattern Query Standard**: ```php // In Controller use Illuminate\Support\Facades\DB; // Query con relazioni standard $items = DB::table('main_table') ->leftJoin('stabili', 'main_table.stabile_id', '=', 'stabili.id') ->leftJoin('gestioni', 'main_table.gestione_id', '=', 'gestioni.id_gestione') ->select([ 'main_table.*', 'stabili.denominazione as stabile_nome', 'gestioni.anno_gestione', 'gestioni.tipo_gestione' ]) ->where('stabili.amministratore_id', auth()->user()->amministratore_id ?? null) ->orderBy('main_table.created_at', 'desc') ->paginate(20); // Stats query standard $stats = [ 'totale' => DB::table('main_table')->count(), 'questo_mese' => DB::table('main_table') ->whereMonth('created_at', now()->month) ->count(), 'attivi' => DB::table('main_table') ->where('stato', 'attivo') ->count() ]; ``` --- ## 🎨 **CSS STANDARD NETGESCON** ### πŸ“ **File:** `/public/css/netgescon-standard.css` ```css /* NetGescon Standard Module Styles */ /* Menu Tabs Standard */ .nav-tabs .nav-link { border: 1px solid transparent; border-radius: 0.375rem 0.375rem 0 0; color: #6c757d; font-weight: 500; padding: 0.75rem 1rem; transition: all 0.3s ease; } .nav-tabs .nav-link:hover { border-color: #e9ecef #e9ecef #dee2e6; color: #007bff; } .nav-tabs .nav-link.active { background-color: #fff; border-color: #007bff #007bff #fff; color: #007bff; font-weight: 600; } /* NetGescon Tab Buttons */ .netgescon-tab-btn { border-bottom: 2px solid transparent; color: #6b7280; font-weight: 500; padding: 0.75rem 0; transition: all 0.3s ease; white-space: nowrap; } .netgescon-tab-btn:hover { border-bottom-color: #3b82f6; color: #3b82f6; } .netgescon-tab-btn.active { border-bottom-color: #3b82f6; color: #3b82f6; font-weight: 600; } /* Tab Content */ .netgescon-tab-content { display: none; } .netgescon-tab-content.active { display: block; } /* Small Box Cards */ .small-box { border-radius: 0.375rem; color: #fff; overflow: hidden; position: relative; margin-bottom: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: all 0.3s ease; } .small-box:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); } .small-box .inner { padding: 1rem; } .small-box h3 { font-size: 2rem; font-weight: 700; margin: 0; white-space: nowrap; } .small-box p { font-size: 1rem; margin: 0.5rem 0 0 0; } .small-box .icon { position: absolute; top: auto; bottom: 10px; right: 10px; font-size: 3rem; color: rgba(255,255,255,0.15); } /* Responsive Cards */ @media (max-width: 768px) { .small-box h3 { font-size: 1.5rem; } .small-box .icon { font-size: 2rem; bottom: 5px; right: 5px; } } ``` --- ## ⚑ **JAVASCRIPT STANDARD** ### πŸ“ **File:** `/public/js/netgescon-modules.js` ```javascript /** * NetGescon Standard Module JavaScript */ // Inizializzazione moduli document.addEventListener('DOMContentLoaded', function() { initializeNetGesconTabs(); initializeStatCards(); initializeMenuHighlight(); }); // Tab Management function initializeNetGesconTabs() { const tabButtons = document.querySelectorAll('.netgescon-tab-btn'); const tabContents = document.querySelectorAll('.netgescon-tab-content'); tabButtons.forEach(button => { button.addEventListener('click', function() { const tabId = this.getAttribute('data-tab'); // Remove active class from all buttons and contents tabButtons.forEach(btn => btn.classList.remove('active')); tabContents.forEach(content => content.classList.remove('active')); // Add active class to clicked button and corresponding content this.classList.add('active'); const targetContent = document.getElementById(tabId); if (targetContent) { targetContent.classList.add('active'); } }); }); } // Stat Cards Animation function initializeStatCards() { const cards = document.querySelectorAll('.small-box'); cards.forEach(card => { card.addEventListener('mouseenter', function() { this.style.transform = 'translateY(-3px)'; }); card.addEventListener('mouseleave', function() { this.style.transform = 'translateY(0)'; }); }); } // Menu Active Highlight function initializeMenuHighlight() { const currentPath = window.location.pathname; const menuLinks = document.querySelectorAll('.nav-tabs .nav-link'); menuLinks.forEach(link => { if (link.getAttribute('href') === currentPath) { link.classList.add('active'); } }); } // Utility: Show loading state function showLoading(element) { element.innerHTML = 'Caricamento...'; element.disabled = true; } // Utility: Hide loading state function hideLoading(element, originalText) { element.innerHTML = originalText; element.disabled = false; } // Utility: Show notification function showNotification(message, type = 'info') { const notification = document.createElement('div'); notification.className = `alert alert-${type} alert-dismissible fade show position-fixed`; notification.style.cssText = 'top: 20px; right: 20px; z-index: 9999; max-width: 300px;'; notification.innerHTML = ` ${message} `; document.body.appendChild(notification); setTimeout(() => { notification.remove(); }, 5000); } ``` --- ## πŸ“‹ **CHECKLIST IMPLEMENTAZIONE** ### βœ… **Per Ogni Nuovo Modulo**: - [ ] **Layout Base** - Extends admin.layouts.netgescon - [ ] **Breadcrumb** - Header con navigazione corretta - [ ] **Sub-menu Tabs** - Pattern menu funzionante - [ ] **Stats Cards** - 4 cards statistiche standard - [ ] **Main Content** - Area contenuto principale - [ ] **CSS Classes** - NetGescon design system - [ ] **JavaScript** - Tab functionality standard - [ ] **Controller** - Stats calculation e data retrieval - [ ] **Database** - Query con relazioni standard - [ ] **Routes** - RESTful con naming consistency ### βœ… **File da Creare per Modulo**: ``` resources/views/admin/{module}/ β”œβ”€β”€ index.blade.php # Lista principale con menu β”œβ”€β”€ show.blade.php # Dettaglio con sub-tabs β”œβ”€β”€ create.blade.php # Form creazione β”œβ”€β”€ edit.blade.php # Form modifica └── _form.blade.php # Form partial app/Http/Controllers/Admin/ └── {Module}Controller.php routes/ └── admin.php (aggiungere routes del modulo) ``` --- ## πŸš€ **ESEMPI MODULI DA REPLICARE** ### 1. **Modulo Semplice** (es: Fornitori): ```bash # Usa Pattern 1: Menu principale con sub-tabs # Stats: Totale, Attivi, Inattivi, Questo mese # Tabs: Lista, Nuovo, Categorie, Reports ``` ### 2. **Modulo Complesso** (es: Gestioni): ```bash # Usa Pattern 1 + Pattern 2 # Menu principale: Lista, Nuovo, Archivio, Reports # Detail sub-tabs: Dati, Movimenti, Documenti, Bilanci ``` ### 3. **Modulo Report** (es: Analytics): ```bash # Usa Pattern 3: Solo cards statistiche # Focus su visualizzazione dati # Grafici e tabelle dinamiche ``` --- ## πŸ”— **RIFERIMENTI E CONNESSIONI** ### πŸ“ **Files Sorgente Pattern**: - **ContabilitΓ **: `/resources/views/modules/contabilita/index.blade.php` - **Stabili**: `/resources/views/admin/stabili/show.blade.php` - **Layout**: `/resources/views/admin/layouts/netgescon.blade.php` ### πŸ—„οΈ **Database Schema Principale**: ```sql -- Tabelle core sempre presenti stabili (id, denominazione, ...) gestioni (id_gestione, anno_gestione, ...) unita_immobiliari (id, stabile_id, ...) amministratori (id, ...) -- Pattern naming nuove tabelle {modulo}_registrazioni {modulo}_configurazioni {modulo}_statistiche ``` ### 🎯 **Route Pattern Standard**: ```php // routes/admin.php Route::prefix('admin')->name('admin.')->group(function () { Route::resource('{modulo}', '{Modulo}Controller'); Route::get('{modulo}/{id}/detail', ['{Modulo}Controller', 'detail'])->name('{modulo}.detail'); Route::get('{modulo}/reports', ['{Modulo}Controller', 'reports'])->name('{modulo}.reports'); }); ``` --- **🎯 MANUALE STANDARD CREATO** **Per ogni nuovo modulo: segui questo pattern e avrai consistenza UI/UX**