# ๐Ÿ“„ CONTENT AREA - Documentazione Completa NetGescon > **Componente Content Area dell'interfaccia universale** > **๐Ÿ“… Creato:** 21/07/2025 > **๐Ÿ”„ Ultimo aggiornamento:** 21/07/2025 > **๐ŸŽฏ Prioritร :** ๐Ÿ”ฅ CRITICA --- ## ๐Ÿ“‹ **OVERVIEW CONTENT AREA** Il Content Area NetGescon รจ la **ZONA PRINCIPALE** dove vengono visualizzati: - ๐Ÿ—บ๏ธ **Breadcrumb Navigation** - ๐Ÿ“ **Page Headers con Actions** - ๐Ÿ“Š **Dashboard Cards** - ๐Ÿ“‹ **Forms & Tables** - ๐Ÿ”” **Alert Messages** - ๐Ÿ“„ **Main Page Content** ### ๐Ÿ“ **Specifiche Layout** - **Posizione:** `margin-left: 280px` desktop, `margin-left: 0` mobile - **Altezza:** `calc(100vh - 140px)` (header + footer esclusi) - **Padding:** `24px` standard, `16px` mobile - **Overflow:** `scroll` quando contenuto > viewport --- ## ๐ŸŽจ **DESIGN SPECIFICATIONS** ### ๐ŸŒˆ **Color Palette** ```css /* Content Background */ .content-area { background: var(--netgescon-gray-50); min-height: calc(100vh - 140px); } /* Page Headers */ .page-header { background: white; border-bottom: 1px solid var(--netgescon-gray-200); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } /* Content Containers */ .content-container { background: white; border: 1px solid var(--netgescon-gray-200); border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); } ``` ### ๐Ÿ“ **Dimensions** ```css .content-area { margin-left: 280px; /* Desktop con sidebar */ margin-top: 70px; /* Header height */ margin-bottom: 70px; /* Footer height */ padding: 24px; min-height: calc(100vh - 140px); } /* Mobile */ @media (max-width: 767px) { .content-area { margin-left: 0; padding: 16px; } } ``` --- ## ๐Ÿšจ **LAYOUT REQUIREMENTS - CRITICO** ### โœ… **Layout Corretto da Usare** ```blade @extends('admin.layouts.netgescon') ``` - โœ… Interfaccia universale con header blu - โœ… Tailwind CSS incluso via Vite - โœ… FontAwesome per icone - โœ… Responsive design moderno ### โŒ **Layout da NON Usare** ```blade @extends('admin.layouts.app') โŒ Sidebar verde vecchia @extends('layouts.app-universal-*') โŒ Usa Bootstrap invece Tailwind @extends('layouts.dashboard') โŒ Layout obsoleto ``` ### ๐Ÿ“‹ **Checklist Pre-Sviluppo** - [ ] Layout: `admin.layouts.netgescon` - [ ] Vite dev server attivo: `npm run dev` - [ ] Vite configurato per accesso remoto - [ ] Breadcrumbs passati dal controller - [ ] Page actions configurate ### ๐Ÿ”ง **Procedura Corretta per Nuove Pagine** ```bash # 1. SEMPRE usare il layout corretto @extends('admin.layouts.netgescon') # 2. Structure controller breadcrumbs $breadcrumbs = [ ['title' => 'Categoria', 'icon' => 'fas fa-icon'], ['title' => 'Pagina Attuale', 'icon' => 'fas fa-icon'] ]; # 3. Page setup completo $pageTitle = 'Titolo Pagina'; $pageSubtitle = 'Sottotitolo descrittivo'; $pageActions = [ [ 'type' => 'primary', 'label' => 'Azione Principale', 'url' => route('route.name'), 'icon' => 'fas fa-icon' ] ]; # 4. Return view con tutte le variabili return view('admin.modulo.pagina', compact( 'breadcrumbs', 'pageTitle', 'pageSubtitle', 'pageActions', // altri dati... )); ``` --- ## ๐Ÿงฉ **STRUTTURA CONTENT AREA** ### ๐Ÿ“ **Layout Template** ```blade @extends('admin.layouts.netgescon') @section('title', 'Contabilitร  GESCON') @section('content') @if(isset($breadcrumbs) && count($breadcrumbs) > 0) @include('components.layout.breadcrumb', ['breadcrumbs' => $breadcrumbs]) @endif @if(isset($pageTitle) || isset($pageActions)) @include('components.layout.page-header', [ 'title' => $pageTitle ?? '', 'subtitle' => $pageSubtitle ?? '', 'actions' => $pageActions ?? [] ]) @endif @include('components.layout.alerts')
@endsection ``` **โš ๏ธ IMPORTANTE:** - **SEMPRE usare** `@extends('admin.layouts.netgescon')` per l'interfaccia universale - **MAI usare** `admin.layouts.app` (sidebar verde NetGescon vecchia) - **MAI usare** `layouts.app-universal-*` (usano Bootstrap invece di Tailwind) --- ## ๐Ÿ—บ๏ธ **BREADCRUMB COMPONENT** ### ๐Ÿ“ **File:** `components/layout/breadcrumb.blade.php` ```blade
  1. Dashboard
  2. @foreach($breadcrumbs as $breadcrumb)
  3. @if(isset($breadcrumb['url']) && !$loop->last) @if(isset($breadcrumb['icon'])) @endif {{ $breadcrumb['title'] }} @else @if(isset($breadcrumb['icon'])) @endif {{ $breadcrumb['title'] }} @endif
  4. @endforeach
``` ### ๐Ÿ’ป **Usage Examples** ```php // In Controller $breadcrumbs = [ ['title' => 'Gestione Stabili', 'url' => route('admin.stabili.index'), 'icon' => 'fas fa-building'], ['title' => 'Nuovo Stabile', 'icon' => 'fas fa-plus'] ]; return view('admin.stabili.create', compact('breadcrumbs')); ``` --- ## ๐Ÿ“ **PAGE HEADER COMPONENT** ### ๐Ÿ“ **File:** `components/layout/page-header.blade.php` ```blade
@if(isset($title))

{{ $title }}

@endif @if(isset($subtitle))

{{ $subtitle }}

@endif @if(isset($stats))
@foreach($stats as $stat) @if(isset($stat['icon'])) @endif {{ $stat['label'] }}: {{ $stat['value'] }} @endforeach
@endif
@if(isset($actions) && count($actions) > 0)
@foreach($actions as $action) @if($action['type'] === 'primary') @if(isset($action['icon'])) @endif {{ $action['label'] }} @elseif($action['type'] === 'secondary') @if(isset($action['icon'])) @endif {{ $action['label'] }} @elseif($action['type'] === 'danger') @endif @endforeach
@endif
``` ### ๐Ÿ’ป **Usage Examples** ```php // In Controller $pageTitle = 'Gestione Stabili'; $pageSubtitle = 'Visualizza e gestisci tutti gli stabili del sistema'; $pageActions = [ [ 'type' => 'primary', 'label' => 'Nuovo Stabile', 'url' => route('admin.stabili.create'), 'icon' => 'fas fa-plus' ], [ 'type' => 'secondary', 'label' => 'Esporta Excel', 'url' => route('admin.stabili.export'), 'icon' => 'fas fa-download' ] ]; $stats = [ ['label' => 'Totale Stabili', 'value' => '45', 'icon' => 'fas fa-building'], ['label' => 'Condomini', 'value' => '128', 'icon' => 'fas fa-home'], ['label' => 'Unitร ', 'value' => '1,247', 'icon' => 'fas fa-door-open'] ]; return view('admin.stabili.index', compact('pageTitle', 'pageSubtitle', 'pageActions', 'stats')); ``` --- ## ๐Ÿ”” **ALERT MESSAGES COMPONENT** ### ๐Ÿ“ **File:** `components/layout/alerts.blade.php` ```blade @if(session('success'))

Operazione completata!

{{ session('success') }}

@endif @if(session('error'))

Errore!

{{ session('error') }}

@endif @if(session('warning'))

Attenzione!

{{ session('warning') }}

@endif @if(session('info'))

Informazione

{{ session('info') }}

@endif @if($errors->any())

Errori di validazione

    @foreach($errors->all() as $error)
  • โ€ข {{ $error }}
  • @endforeach
@endif ``` --- ## ๐Ÿ“Š **DASHBOARD CARDS PATTERN** ### ๐Ÿƒ **Stats Cards** ```blade

Stabili

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

+3 questo mese

Condomini

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

+8 questo mese

Unitร 

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

Nessuna variazione

Fatturato

โ‚ฌ{{ number_format($stats['fatturato'] ?? 0, 0, ',', '.') }}

+12% vs mese scorso

``` --- ## ๐Ÿ“‹ **FORMS PATTERN** ### ๐Ÿ“ **Standard Form Container** ```blade
@csrf @if(isset($method) && $method !== 'POST') @method($method) @endif

{{ $formTitle }}

@if(isset($formDescription))

{{ $formDescription }}

@endif
@yield('form-fields')
I campi con * sono obbligatori
Annulla @if(isset($draftButton) && $draftButton) @endif
``` --- ## ๐Ÿ“Š **TABLES PATTERN** ### ๐Ÿ“‹ **Data Table Container** ```blade

{{ $tableTitle }}

@if(isset($tableDescription))

{{ $tableDescription }}

@endif
@if(isset($filters)) @endif
@yield('table-header') @yield('table-body')
@if(isset($pagination))
{{ $pagination->links('components.pagination') }}
@endif
``` --- ## โšก **JAVASCRIPT FUNCTIONALITY** ### ๐Ÿ“ **File:** `/public/js/components/content.js` ```javascript /** * Content Area - JavaScript Functions */ // Inizializza content area function initializeContentArea() { initializeAlerts(); initializeScrollToTop(); initializeStickyHeaders(); initializeInfiniteScroll(); } // Alert management function initializeAlerts() { // Auto-hide alerts const alerts = document.querySelectorAll('.alert'); alerts.forEach(alert => { const closeBtn = alert.querySelector('.alert-close'); // Close button if (closeBtn) { closeBtn.addEventListener('click', () => { hideAlert(alert); }); } // Auto-hide after 5 seconds setTimeout(() => { hideAlert(alert); }, 5000); }); } function hideAlert(alert) { alert.style.opacity = '0'; alert.style.transform = 'translateY(-10px)'; setTimeout(() => { if (alert.parentNode) { alert.parentNode.removeChild(alert); } }, 300); } // Scroll to top functionality function initializeScrollToTop() { const scrollBtn = document.createElement('button'); scrollBtn.className = 'scroll-to-top fixed bottom-20 right-6 bg-blue-600 text-white p-3 rounded-full shadow-lg opacity-0 transition-opacity duration-300 z-50'; scrollBtn.innerHTML = ''; scrollBtn.onclick = () => window.scrollTo({ top: 0, behavior: 'smooth' }); document.body.appendChild(scrollBtn); window.addEventListener('scroll', () => { if (window.scrollY > 300) { scrollBtn.style.opacity = '1'; } else { scrollBtn.style.opacity = '0'; } }); } // Sticky headers for long content function initializeStickyHeaders() { const headers = document.querySelectorAll('.page-header'); headers.forEach(header => { const observer = new IntersectionObserver( ([entry]) => { if (!entry.isIntersecting) { header.classList.add('sticky-header'); } else { header.classList.remove('sticky-header'); } }, { threshold: 0.1 } ); observer.observe(header); }); } // Infinite scroll for tables/lists function initializeInfiniteScroll() { const container = document.querySelector('[data-infinite-scroll]'); if (!container) return; let loading = false; let page = 2; window.addEventListener('scroll', () => { if (loading) return; const { scrollTop, scrollHeight, clientHeight } = document.documentElement; if (scrollTop + clientHeight >= scrollHeight - 5) { loading = true; loadMoreContent(page++).then(() => { loading = false; }); } }); } // Load more content via AJAX async function loadMoreContent(page) { try { const response = await fetch(`${window.location.pathname}?page=${page}`, { headers: { 'X-Requested-With': 'XMLHttpRequest' } }); const html = await response.text(); const container = document.querySelector('[data-infinite-scroll]'); container.insertAdjacentHTML('beforeend', html); } catch (error) { console.error('Error loading more content:', error); } } // Initialize on DOM ready document.addEventListener('DOMContentLoaded', initializeContentArea); ``` --- ## ๐Ÿ“ฑ **RESPONSIVE BEHAVIOR** ### ๐Ÿ–ฅ๏ธ **Desktop (โ‰ฅ1024px)** ```css .content-area { margin-left: 280px; padding: 24px; } .page-header { flex-direction: row; align-items: center; } .stats-grid { grid-template-columns: repeat(4, 1fr); } ``` ### ๐Ÿ“ฑ **Tablet (768px - 1023px)** ```css .content-area { margin-left: 0; padding: 20px; } .stats-grid { grid-template-columns: repeat(2, 1fr); } .page-header .flex { flex-direction: column; align-items: stretch; } ``` ### ๐Ÿ“ฑ **Mobile (โ‰ค767px)** ```css .content-area { padding: 16px; } .stats-grid { grid-template-columns: 1fr; } .table-container { overflow-x: scroll; } .form-actions { flex-direction: column; align-items: stretch; } ``` --- ## ๐Ÿงช **TESTING CHECKLIST** ### โœ… **Layout Tests** - [ ] Content area positioning correct - [ ] Responsive margins working - [ ] Scroll behavior smooth - [ ] Cards grid responsive - [ ] Forms layout consistent ### โœ… **Component Tests** - [ ] Breadcrumb navigation functional - [ ] Page header actions working - [ ] Alerts display/hide correctly - [ ] Tables search/filter working - [ ] Forms validation display ### โœ… **Interaction Tests** - [ ] Scroll to top button - [ ] Infinite scroll loading - [ ] Alert auto-hide - [ ] Mobile form usability --- ## ๐Ÿ› **COMMON ISSUES & FIXES** ### ๐Ÿšจ **Content nascosto sotto header/footer** **Causa:** Margin/padding calculations incorrect **Fix:** Verifica calcoli height e margins CSS ### ๐Ÿšจ **Cards non responsive** **Causa:** Grid breakpoints non configurati **Fix:** Aggiorna grid-template-columns per ogni breakpoint ### ๐Ÿšจ **Alerts non si chiudono** **Causa:** JavaScript event listeners non agganciati **Fix:** Verifica inizializzazione initializeAlerts() ### ๐Ÿšจ **Forms troppo larghi su mobile** **Causa:** Responsive form layout non implementato **Fix:** Aggiorna CSS per form mobile-first --- ## ๐Ÿ“š **FILES CORRELATI** ### ๐Ÿงฉ **Templates** - `/resources/views/layouts/content.blade.php` - `/resources/views/components/layout/` (directory) ### ๐ŸŽจ **Styles** - `/public/css/components/content.css` - `/public/css/components/forms.css` - `/public/css/components/tables.css` ### โšก **JavaScript** - `/public/js/components/content.js` - `/public/js/components/forms.js` - `/public/js/components/tables.js` --- ## ๐ŸŽฏ **NEXT STEPS** ### ๐Ÿ”ฎ **Planned Improvements** - [ ] **Virtual Scrolling** - Performance per grandi dataset - [ ] **Advanced Filters** - Multi-criteria filtering - [ ] **Bulk Actions** - Multiple selections - [ ] **Export Templates** - Custom export formats - [ ] **Real-time Updates** - WebSocket integration --- *๐Ÿ“ Documento mantenuto da: GitHub Copilot AI Assistant* *๐Ÿ”— Componente: Content Area NetGescon Interface v2.1.0*