glastree_on_gitea
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
@extends('layouts.adminlte')
|
||||
@section('title', 'Calendario Eventi')
|
||||
@section('page_title', 'Calendario Eventi')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-calendar-alt mr-2"></i>Calendario Eventi
|
||||
</h3>
|
||||
<div class="card-tools">
|
||||
<a href="{{ route('eventi.index') }}" class="btn btn-secondary btn-sm">
|
||||
<i class="fas fa-list mr-1"></i> Elenco Eventi
|
||||
</a>
|
||||
<a href="{{ route('eventi.create') }}" class="btn btn-success btn-sm">
|
||||
<i class="fas fa-plus mr-1"></i> Nuovo Evento
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="calendar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('styles')
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.10/index.global.min.css">
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.10/index.global.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
initialView: 'dayGridMonth',
|
||||
locale: 'it',
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,listWeek'
|
||||
},
|
||||
buttonText: {
|
||||
today: 'Oggi',
|
||||
month: 'Mese',
|
||||
week: 'Settimana',
|
||||
list: 'Lista'
|
||||
},
|
||||
eventSources: [
|
||||
{
|
||||
url: '/eventi/calendar/events',
|
||||
method: 'GET',
|
||||
extraParams: function() {
|
||||
return {
|
||||
_token: document.querySelector('meta[name="csrf-token"]')?.content || ''
|
||||
};
|
||||
},
|
||||
startParam: 'start',
|
||||
endParam: 'end',
|
||||
success: function(response) {
|
||||
console.log('Eventi caricati:', response.length, response);
|
||||
},
|
||||
failure: function(error) {
|
||||
console.error('Errore:', error);
|
||||
console.log('XHR:', error.xhr);
|
||||
alert('Errore nel caricamento degli eventi. Controlla la console per dettagli.');
|
||||
}
|
||||
}
|
||||
],
|
||||
eventClick: function(info) {
|
||||
info.jsEvent.preventDefault();
|
||||
window.location.href = info.event.url;
|
||||
},
|
||||
eventDisplay: 'block',
|
||||
displayEventTime: true,
|
||||
displayEventEnd: true,
|
||||
nowIndicator: true,
|
||||
height: 'auto',
|
||||
expandRows: true,
|
||||
stickyHeaderDates: true,
|
||||
dayMaxEvents: true,
|
||||
eventTimeFormat: {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false
|
||||
}
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,250 @@
|
||||
@extends('layouts.adminlte')
|
||||
@section('title', 'Nuovo Evento')
|
||||
@section('page_title', 'Nuovo Evento')
|
||||
|
||||
@section('content')
|
||||
<form action="/eventi" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-calendar mr-2"></i>Dati Evento</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Nome Evento *</label>
|
||||
<input type="text" name="nome_evento" class="form-control @error('nome_evento') is-invalid @enderror" value="{{ old('nome_evento') }}" required>
|
||||
@error('nome_evento')
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Descrizione Breve</label>
|
||||
<input type="text" name="descrizione_evento" class="form-control" value="{{ old('descrizione_evento') }}" placeholder="Breve descrizione">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Descrizione Completa</label>
|
||||
<textarea name="descrizione" class="form-control" rows="3">{{ old('descrizione') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="is_incontro_gruppo" value="1" {{ old('is_incontro_gruppo') ? 'checked' : '' }}>
|
||||
Questo evento è il giorno di incontro del gruppo
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-clock mr-2"></i>Data e Orario</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Tipo Ricorrenza</label>
|
||||
<select name="tipo_recorrenza" id="tipo_recorrenza" class="form-control" onchange="toggleRicorrenza()">
|
||||
<option value="singolo" {{ old('tipo_recorrenza', 'singolo') === 'singolo' ? 'selected' : '' }}>Singolo</option>
|
||||
<option value="settimanale" {{ old('tipo_recorrenza') === 'settimanale' ? 'selected' : '' }}>Settimanale</option>
|
||||
<option value="mensile" {{ old('tipo_recorrenza') === 'mensile' ? 'selected' : '' }}>Mensile</option>
|
||||
<option value="annuale" {{ old('tipo_recorrenza') === 'annuale' ? 'selected' : '' }}>Annuale</option>
|
||||
<option value="altro" {{ old('tipo_recorrenza') === 'altro' ? 'selected' : '' }}>Altro</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="data_specifica_field" style="{{ old('tipo_recorrenza') === 'singolo' || old('tipo_recorrenza') === null ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Data Evento</label>
|
||||
<input type="date" name="data_specifica" class="form-control" value="{{ old('data_specifica') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="settimanale_field" style="{{ old('tipo_recorrenza') === 'settimanale' ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Giorno della Settimana</label>
|
||||
<select name="giorno_settimana" class="form-control">
|
||||
<option value="">Seleziona...</option>
|
||||
<option value="0" {{ old('giorno_settimana') === '0' ? 'selected' : '' }}>Domenica</option>
|
||||
<option value="1" {{ old('giorno_settimana') == '1' ? 'selected' : '' }}>Lunedì</option>
|
||||
<option value="2" {{ old('giorno_settimana') == '2' ? 'selected' : '' }}>Martedì</option>
|
||||
<option value="3" {{ old('giorno_settimana') == '3' ? 'selected' : '' }}>Mercoledì</option>
|
||||
<option value="4" {{ old('giorno_settimana') == '4' ? 'selected' : '' }}>Giovedì</option>
|
||||
<option value="5" {{ old('giorno_settimana') == '5' ? 'selected' : '' }}>Venerdì</option>
|
||||
<option value="6" {{ old('giorno_settimana') == '6' ? 'selected' : '' }}>Sabato</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mensile_field" style="{{ old('tipo_recorrenza') === 'mensile' ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Occorrenza nel mese</label>
|
||||
<select name="occorrenza_mese" class="form-control">
|
||||
<option value="">Seleziona...</option>
|
||||
<option value="1,1" {{ old('occorrenza_mese') === '1,1' ? 'selected' : '' }}>1° Lunedì</option>
|
||||
<option value="1,2" {{ old('occorrenza_mese') === '1,2' ? 'selected' : '' }}>1° Martedì</option>
|
||||
<option value="1,3" {{ old('occorrenza_mese') === '1,3' ? 'selected' : '' }}>1° Mercoledì</option>
|
||||
<option value="1,4" {{ old('occorrenza_mese') === '1,4' ? 'selected' : '' }}>1° Giovedì</option>
|
||||
<option value="1,5" {{ old('occorrenza_mese') === '1,5' ? 'selected' : '' }}>1° Venerdì</option>
|
||||
<option value="1,6" {{ old('occorrenza_mese') === '1,6' ? 'selected' : '' }}>1° Sabato</option>
|
||||
<option value="1,0" {{ old('occorrenza_mese') === '1,0' ? 'selected' : '' }}>1° Domenica</option>
|
||||
<option value="2,1" {{ old('occorrenza_mese') === '2,1' ? 'selected' : '' }}>2° Lunedì</option>
|
||||
<option value="2,2" {{ old('occorrenza_mese') === '2,2' ? 'selected' : '' }}>2° Martedì</option>
|
||||
<option value="2,3" {{ old('occorrenza_mese') === '2,3' ? 'selected' : '' }}>2° Mercoledì</option>
|
||||
<option value="2,4" {{ old('occorrenza_mese') === '2,4' ? 'selected' : '' }}>2° Giovedì</option>
|
||||
<option value="2,5" {{ old('occorrenza_mese') === '2,5' ? 'selected' : '' }}>2° Venerdì</option>
|
||||
<option value="2,6" {{ old('occorrenza_mese') === '2,6' ? 'selected' : '' }}>2° Sabato</option>
|
||||
<option value="2,0" {{ old('occorrenza_mese') === '2,0' ? 'selected' : '' }}>2° Domenica</option>
|
||||
<option value="3,1" {{ old('occorrenza_mese') === '3,1' ? 'selected' : '' }}>3° Lunedì</option>
|
||||
<option value="3,2" {{ old('occorrenza_mese') === '3,2' ? 'selected' : '' }}>3° Martedì</option>
|
||||
<option value="3,3" {{ old('occorrenza_mese') === '3,3' ? 'selected' : '' }}>3° Mercoledì</option>
|
||||
<option value="3,4" {{ old('occorrenza_mese') === '3,4' ? 'selected' : '' }}>3° Giovedì</option>
|
||||
<option value="3,5" {{ old('occorrenza_mese') === '3,5' ? 'selected' : '' }}>3° Venerdì</option>
|
||||
<option value="3,6" {{ old('occorrenza_mese') === '3,6' ? 'selected' : '' }}>3° Sabato</option>
|
||||
<option value="3,0" {{ old('occorrenza_mese') === '3,0' ? 'selected' : '' }}>3° Domenica</option>
|
||||
<option value="4,1" {{ old('occorrenza_mese') === '4,1' ? 'selected' : '' }}>4° Lunedì</option>
|
||||
<option value="4,2" {{ old('occorrenza_mese') === '4,2' ? 'selected' : '' }}>4° Martedì</option>
|
||||
<option value="4,3" {{ old('occorrenza_mese') === '4,3' ? 'selected' : '' }}>4° Mercoledì</option>
|
||||
<option value="4,4" {{ old('occorrenza_mese') === '4,4' ? 'selected' : '' }}>4° Giovedì</option>
|
||||
<option value="4,5" {{ old('occorrenza_mese') === '4,5' ? 'selected' : '' }}>4° Venerdì</option>
|
||||
<option value="4,6" {{ old('occorrenza_mese') === '4,6' ? 'selected' : '' }}>4° Sabato</option>
|
||||
<option value="4,0" {{ old('occorrenza_mese') === '4,0' ? 'selected' : '' }}>4° Domenica</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Mesi (multipli)</label>
|
||||
<select name="mesi_recorrenza[]" class="form-control" multiple size="4">
|
||||
<option value="1" {{ is_array(old('mesi_recorrenza')) && in_array('1', old('mesi_recorrenza')) ? 'selected' : '' }}>Gennaio</option>
|
||||
<option value="2" {{ is_array(old('mesi_recorrenza')) && in_array('2', old('mesi_recorrenza')) ? 'selected' : '' }}>Febbraio</option>
|
||||
<option value="3" {{ is_array(old('mesi_recorrenza')) && in_array('3', old('mesi_recorrenza')) ? 'selected' : '' }}>Marzo</option>
|
||||
<option value="4" {{ is_array(old('mesi_recorrenza')) && in_array('4', old('mesi_recorrenza')) ? 'selected' : '' }}>Aprile</option>
|
||||
<option value="5" {{ is_array(old('mesi_recorrenza')) && in_array('5', old('mesi_recorrenza')) ? 'selected' : '' }}>Maggio</option>
|
||||
<option value="6" {{ is_array(old('mesi_recorrenza')) && in_array('6', old('mesi_recorrenza')) ? 'selected' : '' }}>Giugno</option>
|
||||
<option value="7" {{ is_array(old('mesi_recorrenza')) && in_array('7', old('mesi_recorrenza')) ? 'selected' : '' }}>Luglio</option>
|
||||
<option value="8" {{ is_array(old('mesi_recorrenza')) && in_array('8', old('mesi_recorrenza')) ? 'selected' : '' }}>Agosto</option>
|
||||
<option value="9" {{ is_array(old('mesi_recorrenza')) && in_array('9', old('mesi_recorrenza')) ? 'selected' : '' }}>Settembre</option>
|
||||
<option value="10" {{ is_array(old('mesi_recorrenza')) && in_array('10', old('mesi_recorrenza')) ? 'selected' : '' }}>Ottobre</option>
|
||||
<option value="11" {{ is_array(old('mesi_recorrenza')) && in_array('11', old('mesi_recorrenza')) ? 'selected' : '' }}>Novembre</option>
|
||||
<option value="12" {{ is_array(old('mesi_recorrenza')) && in_array('12', old('mesi_recorrenza')) ? 'selected' : '' }}>Dicembre</option>
|
||||
</select>
|
||||
<small class="form-text text-muted">Ctrl+clic per selezionare più mesi</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="annuale_field" style="{{ old('tipo_recorrenza') === 'annuale' ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Mese</label>
|
||||
<select name="mese_annuale" class="form-control">
|
||||
<option value="">Seleziona mese...</option>
|
||||
<option value="1" {{ old('mese_annuale') == '1' ? 'selected' : '' }}>Gennaio</option>
|
||||
<option value="2" {{ old('mese_annuale') == '2' ? 'selected' : '' }}>Febbraio</option>
|
||||
<option value="3" {{ old('mese_annuale') == '3' ? 'selected' : '' }}>Marzo</option>
|
||||
<option value="4" {{ old('mese_annuale') == '4' ? 'selected' : '' }}>Aprile</option>
|
||||
<option value="5" {{ old('mese_annuale') == '5' ? 'selected' : '' }}>Maggio</option>
|
||||
<option value="6" {{ old('mese_annuale') == '6' ? 'selected' : '' }}>Giugno</option>
|
||||
<option value="7" {{ old('mese_annuale') == '7' ? 'selected' : '' }}>Luglio</option>
|
||||
<option value="8" {{ old('mese_annuale') == '8' ? 'selected' : '' }}>Agosto</option>
|
||||
<option value="9" {{ old('mese_annuale') == '9' ? 'selected' : '' }}>Settembre</option>
|
||||
<option value="10" {{ old('mese_annuale') == '10' ? 'selected' : '' }}>Ottobre</option>
|
||||
<option value="11" {{ old('mese_annuale') == '11' ? 'selected' : '' }}>Novembre</option>
|
||||
<option value="12" {{ old('mese_annuale') == '12' ? 'selected' : '' }}>Dicembre</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Ora Inizio</label>
|
||||
<input type="time" name="ora_inizio" class="form-control" value="{{ old('ora_inizio') }}">
|
||||
</div>
|
||||
<div class="form-group mb-0">
|
||||
<label>Durata (minuti)</label>
|
||||
<input type="number" name="durata_minuti" class="form-control" value="{{ old('durata_minuti', 60) }}" min="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Dove</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Indirizzo</label>
|
||||
<input type="text" name="luogo_indirizzo" class="form-control" value="{{ old('luogo_indirizzo') }}" placeholder="Via, numero civico, CAP, città">
|
||||
</div>
|
||||
<div class="form-group mb-0">
|
||||
<label>URL Google Maps</label>
|
||||
<input type="url" name="luogo_url_maps" class="form-control" value="{{ old('luogo_url_maps') }}" placeholder="https://maps.google.com/...">
|
||||
<small class="form-text text-muted">Incolla il link di Google Maps per attivare l'anteprima</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-0">
|
||||
<select name="gruppi[]" class="form-control" multiple size="8">
|
||||
@foreach($gruppi as $g)
|
||||
<option value="{{ $g->id }}" {{ (old('gruppi') && in_array($g->id, old('gruppi'))) || ($selectedGruppo && $selectedGruppo->id == $g->id) ? 'selected' : '' }}>
|
||||
{{ $g->full_path }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più gruppi</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-user mr-2"></i>Responsabili</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-0">
|
||||
<select name="responsabili[]" class="form-control" multiple size="8">
|
||||
@foreach($individui as $i)
|
||||
<option value="{{ $i->id }}" {{ old('responsabili') && in_array($i->id, old('responsabili')) ? 'selected' : '' }}>
|
||||
{{ $i->cognome }} {{ $i->nome }}
|
||||
@if($i->telefono_primario)
|
||||
({{ $i->telefono_primario }})
|
||||
@endif
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più responsabili</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
|
||||
<div class="card-body">
|
||||
<textarea name="note" class="form-control" rows="2">{{ old('note') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fas fa-save mr-1"></i> Salva
|
||||
</button>
|
||||
<a href="/eventi" class="btn btn-secondary">
|
||||
<i class="fas fa-times mr-1"></i> Annulla
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
function toggleRicorrenza() {
|
||||
var tipo = document.getElementById('tipo_recorrenza').value;
|
||||
document.getElementById('data_specifica_field').style.display = tipo === 'singolo' ? 'block' : 'none';
|
||||
document.getElementById('settimanale_field').style.display = tipo === 'settimanale' ? 'block' : 'none';
|
||||
document.getElementById('mensile_field').style.display = tipo === 'mensile' ? 'block' : 'none';
|
||||
document.getElementById('annuale_field').style.display = tipo === 'annuale' ? 'block' : 'none';
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,372 @@
|
||||
@extends('layouts.adminlte')
|
||||
@section('title', 'Modifica Evento')
|
||||
@section('page_title', 'Modifica Evento')
|
||||
|
||||
@section('content')
|
||||
<form action="/eventi/{{ $evento->id }}" method="POST" id="mainForm">
|
||||
@csrf @method('PUT')
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-calendar mr-2"></i>Dati Evento</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Nome Evento *</label>
|
||||
<input type="text" name="nome_evento" class="form-control" value="{{ old('nome_evento', $evento->nome_evento) }}" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Descrizione Breve</label>
|
||||
<input type="text" name="descrizione_evento" class="form-control" value="{{ old('descrizione_evento', $evento->descrizione_evento) }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tipo Evento</label>
|
||||
<input type="text" name="tipo_evento" class="form-control" value="{{ old('tipo_evento', $evento->tipo_evento) }}" placeholder="es. Catechesi, Liturgia, Animazione">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Descrizione Completa</label>
|
||||
<textarea name="descrizione" class="form-control" rows="3">{{ old('descrizione', $evento->descrizione) }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Note</label>
|
||||
<textarea name="note" class="form-control" rows="2">{{ old('note', $evento->note) }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="is_incontro_gruppo" value="1" {{ $evento->is_incontro_gruppo ? 'checked' : '' }}>
|
||||
Questo evento è il giorno di incontro del gruppo
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-clock mr-2"></i>Data e Orario</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Tipo Ricorrenza</label>
|
||||
<select name="tipo_recorrenza" id="tipo_recorrenza" class="form-control" onchange="toggleRicorrenza()">
|
||||
<option value="singolo" {{ old('tipo_recorrenza', $evento->tipo_recorrenza) === 'singolo' || old('tipo_recorrenza', $evento->tipo_recorrenza) === null ? 'selected' : '' }}>Singolo</option>
|
||||
<option value="settimanale" {{ old('tipo_recorrenza', $evento->tipo_recorrenza) === 'settimanale' ? 'selected' : '' }}>Settimanale</option>
|
||||
<option value="mensile" {{ old('tipo_recorrenza', $evento->tipo_recorrenza) === 'mensile' ? 'selected' : '' }}>Mensile</option>
|
||||
<option value="annuale" {{ old('tipo_recorrenza', $evento->tipo_recorrenza) === 'annuale' ? 'selected' : '' }}>Annuale</option>
|
||||
<option value="altro" {{ old('tipo_recorrenza', $evento->tipo_recorrenza) === 'altro' ? 'selected' : '' }}>Altro</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="data_specifica_field" style="{{ in_array($evento->tipo_recorrenza, [null, 'singolo']) ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Data Evento</label>
|
||||
<input type="date" name="data_specifica" class="form-control" value="{{ old('data_specifica', $evento->data_specifica?->format('Y-m-d')) }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="settimanale_field" style="{{ $evento->tipo_recorrenza === 'settimanale' ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Giorno della Settimana</label>
|
||||
<select name="giorno_settimana" class="form-control">
|
||||
<option value="">Seleziona...</option>
|
||||
<option value="0" {{ $evento->giorno_settimana == 0 ? 'selected' : '' }}>Domenica</option>
|
||||
<option value="1" {{ $evento->giorno_settimana == 1 ? 'selected' : '' }}>Lunedì</option>
|
||||
<option value="2" {{ $evento->giorno_settimana == 2 ? 'selected' : '' }}>Martedì</option>
|
||||
<option value="3" {{ $evento->giorno_settimana == 3 ? 'selected' : '' }}>Mercoledì</option>
|
||||
<option value="4" {{ $evento->giorno_settimana == 4 ? 'selected' : '' }}>Giovedì</option>
|
||||
<option value="5" {{ $evento->giorno_settimana == 5 ? 'selected' : '' }}>Venerdì</option>
|
||||
<option value="6" {{ $evento->giorno_settimana == 6 ? 'selected' : '' }}>Sabato</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mensile_field" style="{{ $evento->tipo_recorrenza === 'mensile' ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Occorrenza nel mese</label>
|
||||
@php
|
||||
$occorrenzaSelezionata = old('occorrenza_mese', $evento->occorrenza_mese);
|
||||
@endphp
|
||||
<select name="occorrenza_mese" class="form-control">
|
||||
<option value="">Seleziona...</option>
|
||||
<option value="1,1" {{ $occorrenzaSelezionata === '1,1' ? 'selected' : '' }}>1° Lunedì</option>
|
||||
<option value="1,2" {{ $occorrenzaSelezionata === '1,2' ? 'selected' : '' }}>1° Martedì</option>
|
||||
<option value="1,3" {{ $occorrenzaSelezionata === '1,3' ? 'selected' : '' }}>1° Mercoledì</option>
|
||||
<option value="1,4" {{ $occorrenzaSelezionata === '1,4' ? 'selected' : '' }}>1° Giovedì</option>
|
||||
<option value="1,5" {{ $occorrenzaSelezionata === '1,5' ? 'selected' : '' }}>1° Venerdì</option>
|
||||
<option value="1,6" {{ $occorrenzaSelezionata === '1,6' ? 'selected' : '' }}>1° Sabato</option>
|
||||
<option value="1,0" {{ $occorrenzaSelezionata === '1,0' ? 'selected' : '' }}>1° Domenica</option>
|
||||
<option value="2,1" {{ $occorrenzaSelezionata === '2,1' ? 'selected' : '' }}>2° Lunedì</option>
|
||||
<option value="2,2" {{ $occorrenzaSelezionata === '2,2' ? 'selected' : '' }}>2° Martedì</option>
|
||||
<option value="2,3" {{ $occorrenzaSelezionata === '2,3' ? 'selected' : '' }}>2° Mercoledì</option>
|
||||
<option value="2,4" {{ $occorrenzaSelezionata === '2,4' ? 'selected' : '' }}>2° Giovedì</option>
|
||||
<option value="2,5" {{ $occorrenzaSelezionata === '2,5' ? 'selected' : '' }}>2° Venerdì</option>
|
||||
<option value="2,6" {{ $occorrenzaSelezionata === '2,6' ? 'selected' : '' }}>2° Sabato</option>
|
||||
<option value="2,0" {{ $occorrenzaSelezionata === '2,0' ? 'selected' : '' }}>2° Domenica</option>
|
||||
<option value="3,1" {{ $occorrenzaSelezionata === '3,1' ? 'selected' : '' }}>3° Lunedì</option>
|
||||
<option value="3,2" {{ $occorrenzaSelezionata === '3,2' ? 'selected' : '' }}>3° Martedì</option>
|
||||
<option value="3,3" {{ $occorrenzaSelezionata === '3,3' ? 'selected' : '' }}>3° Mercoledì</option>
|
||||
<option value="3,4" {{ $occorrenzaSelezionata === '3,4' ? 'selected' : '' }}>3° Giovedì</option>
|
||||
<option value="3,5" {{ $occorrenzaSelezionata === '3,5' ? 'selected' : '' }}>3° Venerdì</option>
|
||||
<option value="3,6" {{ $occorrenzaSelezionata === '3,6' ? 'selected' : '' }}>3° Sabato</option>
|
||||
<option value="3,0" {{ $occorrenzaSelezionata === '3,0' ? 'selected' : '' }}>3° Domenica</option>
|
||||
<option value="4,1" {{ $occorrenzaSelezionata === '4,1' ? 'selected' : '' }}>4° Lunedì</option>
|
||||
<option value="4,2" {{ $occorrenzaSelezionata === '4,2' ? 'selected' : '' }}>4° Martedì</option>
|
||||
<option value="4,3" {{ $occorrenzaSelezionata === '4,3' ? 'selected' : '' }}>4° Mercoledì</option>
|
||||
<option value="4,4" {{ $occorrenzaSelezionata === '4,4' ? 'selected' : '' }}>4° Giovedì</option>
|
||||
<option value="4,5" {{ $occorrenzaSelezionata === '4,5' ? 'selected' : '' }}>4° Venerdì</option>
|
||||
<option value="4,6" {{ $occorrenzaSelezionata === '4,6' ? 'selected' : '' }}>4° Sabato</option>
|
||||
<option value="4,0" {{ $occorrenzaSelezionata === '4,0' ? 'selected' : '' }}>4° Domenica</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Mesi (multipli)</label>
|
||||
@php
|
||||
$mesiSelezionati = $evento->mesi_recorrenza ? explode(',', $evento->mesi_recorrenza) : [];
|
||||
@endphp
|
||||
<select name="mesi_recorrenza[]" class="form-control" multiple size="4">
|
||||
<option value="1" {{ in_array('1', $mesiSelezionati) ? 'selected' : '' }}>Gennaio</option>
|
||||
<option value="2" {{ in_array('2', $mesiSelezionati) ? 'selected' : '' }}>Febbraio</option>
|
||||
<option value="3" {{ in_array('3', $mesiSelezionati) ? 'selected' : '' }}>Marzo</option>
|
||||
<option value="4" {{ in_array('4', $mesiSelezionati) ? 'selected' : '' }}>Aprile</option>
|
||||
<option value="5" {{ in_array('5', $mesiSelezionati) ? 'selected' : '' }}>Maggio</option>
|
||||
<option value="6" {{ in_array('6', $mesiSelezionati) ? 'selected' : '' }}>Giugno</option>
|
||||
<option value="7" {{ in_array('7', $mesiSelezionati) ? 'selected' : '' }}>Luglio</option>
|
||||
<option value="8" {{ in_array('8', $mesiSelezionati) ? 'selected' : '' }}>Agosto</option>
|
||||
<option value="9" {{ in_array('9', $mesiSelezionati) ? 'selected' : '' }}>Settembre</option>
|
||||
<option value="10" {{ in_array('10', $mesiSelezionati) ? 'selected' : '' }}>Ottobre</option>
|
||||
<option value="11" {{ in_array('11', $mesiSelezionati) ? 'selected' : '' }}>Novembre</option>
|
||||
<option value="12" {{ in_array('12', $mesiSelezionati) ? 'selected' : '' }}>Dicembre</option>
|
||||
</select>
|
||||
<small class="form-text text-muted">Ctrl+clic per selezionare più mesi</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="annuale_field" style="{{ $evento->tipo_recorrenza === 'annuale' ? '' : 'display:none;' }}">
|
||||
<div class="form-group">
|
||||
<label>Mese</label>
|
||||
<select name="mese_annuale" class="form-control">
|
||||
<option value="">Seleziona mese...</option>
|
||||
<option value="1" {{ old('mese_annuale', $evento->mese_annuale) == '1' ? 'selected' : '' }}>Gennaio</option>
|
||||
<option value="2" {{ old('mese_annuale', $evento->mese_annuale) == '2' ? 'selected' : '' }}>Febbraio</option>
|
||||
<option value="3" {{ old('mese_annuale', $evento->mese_annuale) == '3' ? 'selected' : '' }}>Marzo</option>
|
||||
<option value="4" {{ old('mese_annuale', $evento->mese_annuale) == '4' ? 'selected' : '' }}>Aprile</option>
|
||||
<option value="5" {{ old('mese_annuale', $evento->mese_annuale) == '5' ? 'selected' : '' }}>Maggio</option>
|
||||
<option value="6" {{ old('mese_annuale', $evento->mese_annuale) == '6' ? 'selected' : '' }}>Giugno</option>
|
||||
<option value="7" {{ old('mese_annuale', $evento->mese_annuale) == '7' ? 'selected' : '' }}>Luglio</option>
|
||||
<option value="8" {{ old('mese_annuale', $evento->mese_annuale) == '8' ? 'selected' : '' }}>Agosto</option>
|
||||
<option value="9" {{ old('mese_annuale', $evento->mese_annuale) == '9' ? 'selected' : '' }}>Settembre</option>
|
||||
<option value="10" {{ old('mese_annuale', $evento->mese_annuale) == '10' ? 'selected' : '' }}>Ottobre</option>
|
||||
<option value="11" {{ old('mese_annuale', $evento->mese_annuale) == '11' ? 'selected' : '' }}>Novembre</option>
|
||||
<option value="12" {{ old('mese_annuale', $evento->mese_annuale) == '12' ? 'selected' : '' }}>Dicembre</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Ora Inizio</label>
|
||||
<input type="time" name="ora_inizio" class="form-control" value="{{ old('ora_inizio', $evento->ora_inizio?->format('H:i')) }}">
|
||||
</div>
|
||||
<div class="form-group mb-0">
|
||||
<label>Durata (minuti)</label>
|
||||
<input type="number" name="durata_minuti" class="form-control" value="{{ old('durata_minuti', $evento->durata_minuti ?? 60) }}" min="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Dove</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>Indirizzo</label>
|
||||
<input type="text" name="luogo_indirizzo" class="form-control" value="{{ old('luogo_indirizzo', $evento->luogo_indirizzo) }}" placeholder="Via, numero civico, CAP, città">
|
||||
</div>
|
||||
<div class="form-group mb-0">
|
||||
<label>URL Google Maps</label>
|
||||
<input type="url" name="luogo_url_maps" class="form-control" value="{{ old('luogo_url_maps', $evento->luogo_url_maps) }}" placeholder="https://maps.google.com/...">
|
||||
<small class="form-text text-muted">Incolla il link di Google Maps per attivare l'anteprima</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-0">
|
||||
<select name="gruppi[]" class="form-control" multiple size="8">
|
||||
@foreach($gruppi as $g)
|
||||
<option value="{{ $g->id }}" {{ $evento->gruppi->contains($g->id) ? 'selected' : '' }}>
|
||||
{{ $g->full_path }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più gruppi</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-user mr-2"></i>Responsabili</h3></div>
|
||||
<div class="card-body">
|
||||
<div class="form-group mb-0">
|
||||
<select name="responsabili[]" class="form-control" multiple size="8">
|
||||
@foreach($individui as $i)
|
||||
<option value="{{ $i->id }}" {{ $evento->responsabili->contains($i->id) ? 'selected' : '' }}>
|
||||
{{ $i->cognome }} {{ $i->nome }}
|
||||
@if($i->telefono_primario)
|
||||
({{ $i->telefono_primario }})
|
||||
@endif
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<small class="form-text text-muted">Tieni premuto Ctrl per selezionare più responsabili</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fas fa-save mr-1"></i> Salva Modifiche
|
||||
</button>
|
||||
<a href="/eventi/{{ $evento->id }}" class="btn btn-secondary">
|
||||
<i class="fas fa-times mr-1"></i> Annulla
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Documenti</h3>
|
||||
<button type="button" class="btn btn-xs btn-success float-right" onclick="showDocumentoForm()">
|
||||
<i class="fas fa-plus mr-1"></i> Carica
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div id="documento-add-form" style="display:none;" class="p-3 bg-light border-bottom">
|
||||
<form action="/eventi/{{ $evento->id }}/documenti" method="POST" enctype="multipart/form-data" class="mb-0">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<input type="text" name="nome_file" class="form-control form-control-sm" placeholder="Nome documento" required>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="tipologia" class="form-control form-control-sm" required>
|
||||
<option value="">Tipologia...</option>
|
||||
<option value="documento">Documento</option>
|
||||
<option value="programma">Programma</option>
|
||||
<option value="locandina">Locandina</option>
|
||||
<option value="altro">Altro</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input type="file" name="file" class="form-control form-control-sm" required>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-upload mr-1"></i>Carica</button>
|
||||
<button type="button" class="btn btn-xs btn-secondary" onclick="hideDocumentoForm()"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@if($evento->documenti && $evento->documenti->count() > 0)
|
||||
<table class="table table-bordered table-hover table-striped mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th style="width: 120px;">Tipologia</th>
|
||||
<th style="width: 80px;">Dimensione</th>
|
||||
<th style="width: 130px;">Data Upload</th>
|
||||
<th style="width: 80px;">Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($evento->documenti as $documento)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fas fa-file text-secondary mr-1"></i>
|
||||
{{ $documento->nome_file }}
|
||||
</td>
|
||||
<td>{{ ucfirst($documento->tipologia) }}</td>
|
||||
<td>{{ number_format($documento->dimensione / 1024, 1) }} KB</td>
|
||||
<td>{{ $documento->created_at->format('d/m/Y') }}</td>
|
||||
<td>
|
||||
@if($documento->file_path)
|
||||
<button type="button" class="btn btn-xs btn-primary" onclick="previewDocumento({{ $documento->id }})" title="Anteprima">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
@endif
|
||||
<form action="/eventi/{{ $evento->id }}/documenti/{{ $documento->id }}" method="POST" class="d-inline">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo documento?')" title="Elimina">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="text-center text-muted py-4">
|
||||
<i class="fas fa-file fa-2x mb-2"></i>
|
||||
<p class="mb-0">Nessun documento</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document" style="max-width: 90vw;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fas fa-file mr-2"></i><span id="previewModalTitle">Anteprima</span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Chiudi">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body text-center p-0" style="min-height: 400px;">
|
||||
<iframe id="previewFrame" src="" style="width: 100%; height: 70vh; border: none;"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a id="previewDownloadBtn" href="#" class="btn btn-primary" download>
|
||||
<i class="fas fa-download mr-1"></i> Scarica
|
||||
</a>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
function toggleRicorrenza() {
|
||||
var tipo = document.getElementById('tipo_recorrenza').value;
|
||||
document.getElementById('data_specifica_field').style.display = tipo === 'singolo' ? 'block' : 'none';
|
||||
document.getElementById('settimanale_field').style.display = tipo === 'settimanale' ? 'block' : 'none';
|
||||
document.getElementById('mensile_field').style.display = tipo === 'mensile' ? 'block' : 'none';
|
||||
document.getElementById('annuale_field').style.display = tipo === 'annuale' ? 'block' : 'none';
|
||||
}
|
||||
|
||||
function showDocumentoForm() {
|
||||
document.getElementById('documento-add-form').style.display = 'block';
|
||||
}
|
||||
|
||||
function hideDocumentoForm() {
|
||||
document.getElementById('documento-add-form').style.display = 'none';
|
||||
}
|
||||
|
||||
function previewDocumento(id) {
|
||||
document.getElementById('previewFrame').src = '/documenti/' + id + '/preview';
|
||||
document.getElementById('previewDownloadBtn').href = '/documenti/' + id + '/download';
|
||||
$('#previewModal').modal('show');
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,288 @@
|
||||
@extends('layouts.adminlte')
|
||||
@section('title', 'Eventi')
|
||||
@section('page_title', 'Eventi')
|
||||
|
||||
@php
|
||||
$canWriteEventi = Auth::user()->canManage('eventi');
|
||||
$canDeleteEventi = Auth::user()->canDelete('eventi');
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Tutti gli Eventi</h3>
|
||||
<div class="card-tools">
|
||||
@if($canDeleteEventi)
|
||||
<div class="btn-group mr-2">
|
||||
<button type="button" class="btn btn-sm btn-danger" onclick="deleteSelected()">
|
||||
<i class="fas fa-trash mr-1"></i> Elimina Selezionati
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
@if($canWriteEventi)
|
||||
<a href="/eventi/create" class="btn btn-xs btn-success">
|
||||
<i class="fas fa-plus mr-1"></i> Nuovo Evento
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="GET" class="mb-3">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<input type="text" name="search" class="form-control" placeholder="Cerca evento..." value="{{ request('search') }}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="gruppo_id" class="form-control" onchange="this.form.submit()">
|
||||
<option value="">Tutti i gruppi</option>
|
||||
@foreach($gruppi as $g)
|
||||
<option value="{{ $g->id }}" {{ request('gruppo_id') == $g->id ? 'selected' : '' }}>{{ $g->full_path }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select name="tipo" class="form-control" onchange="this.form.submit()">
|
||||
<option value="">Tutte le ricorrenze</option>
|
||||
<option value="singolo" {{ request('tipo') == 'singolo' ? 'selected' : '' }}>Singolo</option>
|
||||
<option value="settimanale" {{ request('tipo') == 'settimanale' ? 'selected' : '' }}>Settimanale</option>
|
||||
<option value="mensile" {{ request('tipo') == 'mensile' ? 'selected' : '' }}>Mensile</option>
|
||||
<option value="annuale" {{ request('tipo') == 'annuale' ? 'selected' : '' }}>Annuale</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-search mr-1"></i> Cerca</button>
|
||||
<a href="/eventi" class="btn btn-secondary"><i class="fas fa-times"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th style="width: 40px;">
|
||||
@if($canDeleteEventi)
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="select-all" onchange="toggleSelectAll(this)">
|
||||
<label class="custom-control-label" for="select-all"></label>
|
||||
</div>
|
||||
@endif
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ request()->fullUrlWithQuery(['sort' => 'nome_evento', 'direction' => request('sort') === 'nome_evento' && request('direction') === 'asc' ? 'desc' : 'asc']) }}" class="text-dark">
|
||||
Nome Evento
|
||||
@if(request('sort') === 'nome_evento')
|
||||
<i class="fas fa-sort-{{ request('direction') === 'asc' ? 'up' : 'down' }} ml-1"></i>
|
||||
@else
|
||||
<i class="fas fa-sort ml-1 text-muted"></i>
|
||||
@endif
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ request()->fullUrlWithQuery(['sort' => 'descrizione_evento', 'direction' => request('sort') === 'descrizione_evento' && request('direction') === 'asc' ? 'desc' : 'asc']) }}" class="text-dark">
|
||||
Descrizione
|
||||
@if(request('sort') === 'descrizione_evento')
|
||||
<i class="fas fa-sort-{{ request('direction') === 'asc' ? 'up' : 'down' }} ml-1"></i>
|
||||
@else
|
||||
<i class="fas fa-sort ml-1 text-muted"></i>
|
||||
@endif
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ request()->fullUrlWithQuery(['sort' => 'tipo_recorrenza', 'direction' => request('sort') === 'tipo_recorrenza' && request('direction') === 'asc' ? 'desc' : 'asc']) }}" class="text-dark">
|
||||
Tipo
|
||||
@if(request('sort') === 'tipo_recorrenza')
|
||||
<i class="fas fa-sort-{{ request('direction') === 'asc' ? 'up' : 'down' }} ml-1"></i>
|
||||
@else
|
||||
<i class="fas fa-sort ml-1 text-muted"></i>
|
||||
@endif
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ request()->fullUrlWithQuery(['sort' => 'gruppi', 'direction' => request('sort') === 'gruppi' && request('direction') === 'asc' ? 'desc' : 'asc']) }}" class="text-dark">
|
||||
Gruppi
|
||||
@if(request('sort') === 'gruppi')
|
||||
<i class="fas fa-sort-{{ request('direction') === 'asc' ? 'up' : 'down' }} ml-1"></i>
|
||||
@else
|
||||
<i class="fas fa-sort ml-1 text-muted"></i>
|
||||
@endif
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ request()->fullUrlWithQuery(['sort' => 'responsabili', 'direction' => request('sort') === 'responsabili' && request('direction') === 'asc' ? 'desc' : 'asc']) }}" class="text-dark">
|
||||
Responsabili
|
||||
@if(request('sort') === 'responsabili')
|
||||
<i class="fas fa-sort-{{ request('direction') === 'asc' ? 'up' : 'down' }} ml-1"></i>
|
||||
@else
|
||||
<i class="fas fa-sort ml-1 text-muted"></i>
|
||||
@endif
|
||||
</a>
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
<a href="{{ request()->fullUrlWithQuery(['sort' => 'created_at', 'direction' => request('sort') === 'created_at' && request('direction') === 'asc' ? 'desc' : 'asc']) }}" class="text-dark">
|
||||
Creato
|
||||
@if(request('sort') === 'created_at')
|
||||
<i class="fas fa-sort-{{ request('direction') === 'asc' ? 'up' : 'down' }} ml-1"></i>
|
||||
@else
|
||||
<i class="fas fa-sort ml-1 text-muted"></i>
|
||||
@endif
|
||||
</a>
|
||||
</th>
|
||||
<th style="width: 120px;">Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($eventi as $evento)
|
||||
<tr data-id="{{ $evento->id }}">
|
||||
<td>
|
||||
@if($canDeleteEventi)
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input row-checkbox" id="row-checkbox-{{ $evento->id }}" value="{{ $evento->id }}">
|
||||
<label class="custom-control-label" for="row-checkbox-{{ $evento->id }}"></label>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a href="/eventi/{{ $evento->id }}">
|
||||
<i class="fas fa-calendar mr-1 text-primary"></i>
|
||||
{{ $evento->nome_evento }}
|
||||
</a>
|
||||
@if($evento->is_incontro_gruppo)
|
||||
<span class="badge badge-success ml-1">Incluso</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ Str::limit($evento->descrizione_evento, 50) ?: '-' }}</td>
|
||||
<td>
|
||||
@if($evento->tipo_recorrenza && $evento->tipo_recorrenza !== 'singolo')
|
||||
<span class="badge badge-info">{{ $evento->periodicita_label }}</span>
|
||||
@else
|
||||
<span class="badge badge-secondary">Singolo</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@forelse($evento->gruppi->take(2) as $gruppo)
|
||||
<a href="/gruppi/{{ $gruppo->id }}">
|
||||
<span class="badge badge-warning">{{ $gruppo->nome }}</span>
|
||||
</a>
|
||||
@empty
|
||||
<span class="text-muted">-</span>
|
||||
@endforelse
|
||||
@if($evento->gruppi->count() > 2)
|
||||
<small class="text-muted">+{{ $evento->gruppi->count() - 2 }}</small>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@forelse($evento->responsabili->take(2) as $resp)
|
||||
<small>{{ $resp->nome_completo }}</small><br>
|
||||
@empty
|
||||
<span class="text-muted">-</span>
|
||||
@endforelse
|
||||
@if($evento->responsabili->count() > 2)
|
||||
<small class="text-muted">+{{ $evento->responsabili->count() - 2 }} altri</small>
|
||||
@endif
|
||||
</td>
|
||||
<td><small class="text-muted">{{ $evento->created_at->format('d/m/Y') }}</small></td>
|
||||
<td>
|
||||
<a href="{{ url('/eventi/' . $evento->id) }}" class="btn btn-xs btn-info" title="Visualizza">
|
||||
<i class="fas fa-eye"></i>
|
||||
</a>
|
||||
@if($canWriteEventi)
|
||||
<a href="{{ url('/eventi/' . $evento->id . '/edit') }}" class="btn btn-xs btn-warning" title="Modifica">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<form action="{{ url('/eventi/' . $evento->id) }}" method="POST" class="d-inline">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Confermi l\'eliminazione?')" title="Elimina">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="text-center text-muted py-4">
|
||||
<i class="fas fa-calendar fa-2x mb-2"></i>
|
||||
<p class="mb-0">Nessun evento trovato</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ $eventi->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog">
|
||||
@if($canDeleteEventi)
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-danger">
|
||||
<h5 class="modal-title text-white"><i class="fas fa-trash-alt mr-2"></i>Conferma Eliminazione</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Stai per eliminare <strong id="delete-count">0</strong> eventi selezionati.</p>
|
||||
<p class="text-muted small">Verranno eliminati anche i collegamenti con gruppi e responsabili.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annulla</button>
|
||||
<button type="button" class="btn btn-danger" onclick="confirmDelete()">Elimina</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
function toggleSelectAll(source) {
|
||||
document.querySelectorAll('.row-checkbox').forEach(cb => cb.checked = source.checked);
|
||||
}
|
||||
|
||||
function getSelectedIds() {
|
||||
return Array.from(document.querySelectorAll('.row-checkbox:checked')).map(cb => cb.value);
|
||||
}
|
||||
|
||||
function deleteSelected() {
|
||||
const selectedIds = getSelectedIds();
|
||||
if (selectedIds.length === 0) {
|
||||
alert('Seleziona almeno un evento');
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('delete-count').textContent = selectedIds.length;
|
||||
|
||||
document.querySelector('#deleteModal .btn-danger').onclick = function() {
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = '/eventi/mass-elimina';
|
||||
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '{{ csrf_token() }}';
|
||||
|
||||
let html = `<input type="hidden" name="_token" value="${csrfToken}">`;
|
||||
selectedIds.forEach(function(id) {
|
||||
html += `<input type="hidden" name="ids[]" value="${id}">`;
|
||||
});
|
||||
|
||||
form.innerHTML = html;
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
};
|
||||
|
||||
$('#deleteModal').modal('show');
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,340 @@
|
||||
@extends('layouts.adminlte')
|
||||
@section('title', $evento->nome_evento)
|
||||
@section('page_title', 'Dettaglio Evento')
|
||||
|
||||
@section('breadcrumbs')
|
||||
<li class="breadcrumb-item"><a href="/eventi">Eventi</a></li>
|
||||
<li class="breadcrumb-item active">{{ $evento->nome_evento }}</li>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-primary">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-calendar mr-2"></i>
|
||||
{{ $evento->nome_evento }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($evento->descrizione_evento)
|
||||
<p class="lead">{{ $evento->descrizione_evento }}</p>
|
||||
@endif
|
||||
|
||||
@if($evento->descrizione)
|
||||
<div class="mt-3">
|
||||
<h5>Descrizione Completa</h5>
|
||||
<p>{!! nl2br(e($evento->descrizione)) !!}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($evento->is_incontro_gruppo)
|
||||
<div class="alert alert-success mt-3">
|
||||
<i class="fas fa-info-circle mr-1"></i>
|
||||
<strong>Evento di incontro gruppo</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-clock mr-2"></i>Data e Orario</h3></div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<tr>
|
||||
<td style="width: 150px;"><strong>Tipo:</strong></td>
|
||||
<td>
|
||||
@if($evento->tipo_recorrenza && $evento->tipo_recorrenza !== 'singolo')
|
||||
<span class="badge badge-info">{{ $evento->periodicita_label }}</span>
|
||||
@else
|
||||
<span class="badge badge-secondary">Singolo</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($evento->tipo_recorrenza === 'settimanale')
|
||||
<tr>
|
||||
<td><strong>Giorno:</strong></td>
|
||||
<td>{{ $evento->giorno_settimana_label }}</td>
|
||||
</tr>
|
||||
@elseif($evento->tipo_recorrenza === 'mensile')
|
||||
<tr>
|
||||
<td><strong>Occorrenza:</strong></td>
|
||||
<td>{{ $evento->occorrenza_mensile_label }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Mesi:</strong></td>
|
||||
<td>{{ $evento->mesi_recorrenza_label }}</td>
|
||||
</tr>
|
||||
@elseif($evento->tipo_recorrenza === 'annuale')
|
||||
<tr>
|
||||
<td><strong>Mese:</strong></td>
|
||||
<td>{{ $evento->mese_annuale_label }}</td>
|
||||
</tr>
|
||||
@elseif($evento->tipo_recorrenza === 'altro')
|
||||
<tr>
|
||||
<td><strong>Giorno:</strong></td>
|
||||
<td>{{ $evento->giorno_settimana_label }}</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td><strong>Data:</strong></td>
|
||||
<td>{{ $evento->data_specifica?->format('d/m/Y') ?: '-' }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if($evento->ora_inizio)
|
||||
<tr>
|
||||
<td><strong>Ora Inizio:</strong></td>
|
||||
<td>{{ $evento->ora_inizio->format('H:i') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if($evento->durata_minuti)
|
||||
<tr>
|
||||
<td><strong>Durata:</strong></td>
|
||||
<td>{{ $evento->durata_minuti }} minuti</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($evento->luogo_indirizzo || $evento->luogo_url_maps)
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Luogo</h3></div>
|
||||
<div class="card-body">
|
||||
@if($evento->luogo_indirizzo)
|
||||
<p class="mb-2"><i class="fas fa-location-dot text-danger mr-1"></i> <strong>{{ $evento->luogo_indirizzo }}</strong></p>
|
||||
@endif
|
||||
@if($evento->luogo_url_maps)
|
||||
<div class="mb-2">
|
||||
<a href="{{ $evento->luogo_url_maps }}" target="_blank" class="btn btn-sm btn-outline-primary">
|
||||
<i class="fas fa-external-link-alt mr-1"></i> Apri in Google Maps
|
||||
</a>
|
||||
</div>
|
||||
<iframe
|
||||
src="https://www.google.com/maps?q={{ urlencode($evento->luogo_indirizzo ?: $evento->luogo_url_maps) }}&output=embed"
|
||||
width="100%" height="200" style="border:0; border-radius: 8px;" allowfullscreen loading="lazy">
|
||||
</iframe>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-folder mr-2"></i>Gruppi</h3></div>
|
||||
<div class="card-body p-0">
|
||||
@if($evento->gruppi->count() > 0)
|
||||
<table class="table table-sm mb-0">
|
||||
<tbody>
|
||||
@foreach($evento->gruppi as $gruppo)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/gruppi/{{ $gruppo->id }}">
|
||||
<i class="fas fa-folder text-warning mr-1"></i>
|
||||
{{ $gruppo->nome }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="text-center text-muted py-3 mb-0">
|
||||
<span>Nessun gruppo associato</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-user-tie mr-2"></i>Responsabili</h3></div>
|
||||
<div class="card-body p-0">
|
||||
@if($evento->responsabili->count() > 0)
|
||||
<table class="table table-sm mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>Contatto</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($evento->responsabili as $resp)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/individui/{{ $resp->id }}">
|
||||
<i class="fas fa-user text-info mr-1"></i>
|
||||
{{ $resp->cognome }} {{ $resp->nome }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@if($resp->telefono_primario)
|
||||
<small class="text-success">{{ $resp->telefono_primario }}</small>
|
||||
@else
|
||||
<span class="text-muted">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="text-center text-muted py-3 mb-0">
|
||||
<span>Nessun responsabile</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($evento->note)
|
||||
<div class="card mt-3">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-sticky-note mr-2"></i>Note</h3></div>
|
||||
<div class="card-body">
|
||||
<p class="mb-0">{!! nl2br(e($evento->note)) !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-file mr-2"></i>Documenti</h3>
|
||||
<button type="button" class="btn btn-xs btn-success float-right" onclick="showDocumentoForm()">
|
||||
<i class="fas fa-plus mr-1"></i> Carica
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div id="documento-add-form" style="display:none;" class="p-3 bg-light border-bottom">
|
||||
<form action="/eventi/{{ $evento->id }}/documenti" method="POST" enctype="multipart/form-data" class="mb-0">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<input type="text" name="nome_file" class="form-control form-control-sm" placeholder="Nome documento" required>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="tipologia" class="form-control form-control-sm" required>
|
||||
<option value="">Tipologia...</option>
|
||||
<option value="documento">Documento</option>
|
||||
<option value="programma">Programma</option>
|
||||
<option value="locandina">Locandina</option>
|
||||
<option value="altro">Altro</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<input type="file" name="file" class="form-control form-control-sm" required>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<button type="submit" class="btn btn-xs btn-success"><i class="fas fa-upload mr-1"></i>Carica</button>
|
||||
<button type="button" class="btn btn-xs btn-secondary" onclick="hideDocumentoForm()"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@if($evento->documenti && $evento->documenti->count() > 0)
|
||||
<table class="table table-bordered table-hover table-striped mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th style="width: 120px;">Tipologia</th>
|
||||
<th style="width: 80px;">Dimensione</th>
|
||||
<th style="width: 130px;">Data Upload</th>
|
||||
<th style="width: 80px;">Azioni</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($evento->documenti as $documento)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fas fa-file text-secondary mr-1"></i>
|
||||
{{ $documento->nome_file }}
|
||||
</td>
|
||||
<td>{{ ucfirst($documento->tipologia) }}</td>
|
||||
<td>{{ number_format($documento->dimensione / 1024, 1) }} KB</td>
|
||||
<td>{{ $documento->created_at->format('d/m/Y') }}</td>
|
||||
<td>
|
||||
@if($documento->file_path)
|
||||
<button type="button" class="btn btn-xs btn-primary" onclick="previewDocumento({{ $documento->id }})" title="Anteprima">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
@endif
|
||||
<form action="/eventi/{{ $evento->id }}/documenti/{{ $documento->id }}" method="POST" class="d-inline">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="btn btn-xs btn-danger" onclick="return confirm('Eliminare questo documento?')" title="Elimina">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="text-center text-muted py-4">
|
||||
<i class="fas fa-file fa-2x mb-2"></i>
|
||||
<p class="mb-0">Nessun documento</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a href="/eventi/{{ $evento->id }}/edit" class="btn btn-warning">
|
||||
<i class="fas fa-edit mr-1"></i> Modifica
|
||||
</a>
|
||||
<form action="/eventi/{{ $evento->id }}" method="POST" class="d-inline">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Confermi l\'eliminazione di {{ $evento->nome_evento }}?')">
|
||||
<i class="fas fa-trash mr-1"></i> Elimina
|
||||
</button>
|
||||
</form>
|
||||
<a href="/eventi" class="btn btn-secondary">
|
||||
<i class="fas fa-arrow-left mr-1"></i> Torna all'elenco
|
||||
</a>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document" style="max-width: 90vw;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fas fa-file mr-2"></i><span id="previewModalTitle">Anteprima</span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Chiudi">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body text-center p-0" style="min-height: 400px;">
|
||||
<iframe id="previewFrame" src="" style="width: 100%; height: 70vh; border: none;"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a id="previewDownloadBtn" href="#" class="btn btn-primary" download>
|
||||
<i class="fas fa-download mr-1"></i> Scarica
|
||||
</a>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Chiudi</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('scripts')
|
||||
<script>
|
||||
function showDocumentoForm() {
|
||||
document.getElementById('documento-add-form').style.display = 'block';
|
||||
}
|
||||
|
||||
function hideDocumentoForm() {
|
||||
document.getElementById('documento-add-form').style.display = 'none';
|
||||
}
|
||||
|
||||
function previewDocumento(id) {
|
||||
document.getElementById('previewFrame').src = '/documenti/' + id + '/preview';
|
||||
document.getElementById('previewDownloadBtn').href = '/documenti/' + id + '/download';
|
||||
$('#previewModal').modal('show');
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user