fix mailing an email
This commit is contained in:
@@ -2,6 +2,26 @@
|
||||
@section('title', 'Nuovo Gruppo')
|
||||
@section('page_title', 'Nuovo Gruppo')
|
||||
|
||||
@push('styles')
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2-bootstrap4-theme@1.0.0/dist/select2-bootstrap4.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
|
||||
color: #333;
|
||||
}
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-search__field {
|
||||
height: 28px !important;
|
||||
min-height: 28px !important;
|
||||
width: auto !important;
|
||||
min-width: 30px;
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<form action="/gruppi" method="POST">
|
||||
@csrf
|
||||
@@ -37,10 +57,9 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Diocesi</label>
|
||||
<select name="diocesi_id" class="form-control">
|
||||
<option value="">Seleziona...</option>
|
||||
<select name="diocesi_ids[]" class="form-control select2-multi" multiple style="width: 100%;">
|
||||
@foreach($diocesi as $d)
|
||||
<option value="{{ $d->id }}" {{ old('diocesi_id') == $d->id ? 'selected' : '' }}>{{ $d->nome }}</option>
|
||||
<option value="{{ $d->id }}" {{ in_array($d->id, old('diocesi_ids', [])) ? 'selected' : '' }}>{{ $d->nome }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -89,6 +108,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-address-book mr-2"></i>Contatti del Gruppo</h3>
|
||||
<button type="button" class="btn btn-xs btn-success float-right" onclick="aggiungiContatto()">
|
||||
<i class="fas fa-plus mr-1"></i> Aggiungi Contatto
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-bordered mb-0" id="contatti-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th style="width: 20%;">Tipo</th>
|
||||
<th style="width: 40%;">Valore</th>
|
||||
<th style="width: 25%;">Etichetta</th>
|
||||
<th style="width: 80px;">Primario</th>
|
||||
<th style="width: 50px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="contatti-tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="no-contatti-msg" class="text-center text-muted py-4">
|
||||
<p class="mb-0">Nessun contatto. Clicca su "Aggiungi Contatto" per iniziare.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-users mr-2"></i>Membri</h3>
|
||||
@@ -138,10 +184,69 @@
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.select2-multi').select2({
|
||||
theme: 'bootstrap4',
|
||||
placeholder: 'Cerca diocesi...',
|
||||
width: '100%',
|
||||
sorter: function(data) {
|
||||
return data.sort(function(a, b) {
|
||||
if (a.selected && !b.selected) return -1;
|
||||
if (!a.selected && b.selected) return 1;
|
||||
return a.text.localeCompare(b.text, 'it');
|
||||
});
|
||||
},
|
||||
language: {
|
||||
noResults: function() { return 'Nessuna diocesi trovata'; },
|
||||
searching: function() { return 'Ricerca...'; }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let contattiIndex = 0;
|
||||
let membriIndex = 0;
|
||||
const membriResponsabiliMap = new Map();
|
||||
|
||||
function aggiungiContatto() {
|
||||
const tbody = document.getElementById('contatti-tbody');
|
||||
const noMsg = document.getElementById('no-contatti-msg');
|
||||
if (noMsg) noMsg.style.display = 'none';
|
||||
|
||||
const row = document.createElement('tr');
|
||||
const idx = contattiIndex;
|
||||
row.innerHTML = `
|
||||
<td>
|
||||
<select name="contatti[${idx}][tipo]" class="form-control" required>
|
||||
<option value="">Seleziona...</option>
|
||||
<option value="email">Email</option>
|
||||
<option value="telefono">Telefono</option>
|
||||
<option value="cellulare">Cellulare</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="contatti[${idx}][valore]" class="form-control" placeholder="Es. info@example.com" required></td>
|
||||
<td><input type="text" name="contatti[${idx}][etichetta]" class="form-control" placeholder="Es. Ufficio"></td>
|
||||
<td class="text-center">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="contatto-primary-${idx}" name="contatti[${idx}][is_primary]" value="1">
|
||||
<label class="custom-control-label" for="contatto-primary-${idx}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><button type="button" class="btn btn-danger btn-xs" onclick="rimuoviContatto(this)"><i class="fas fa-trash"></i></button></td>
|
||||
`;
|
||||
tbody.appendChild(row);
|
||||
contattiIndex++;
|
||||
}
|
||||
|
||||
function rimuoviContatto(btn) {
|
||||
const row = btn.closest('tr');
|
||||
row.remove();
|
||||
if (document.getElementById('contatti-tbody').children.length === 0) {
|
||||
document.getElementById('no-contatti-msg').style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
function aggiungiMembro() {
|
||||
const tbody = document.getElementById('membri-tbody');
|
||||
const noMsg = document.getElementById('no-membri-msg');
|
||||
|
||||
@@ -2,6 +2,26 @@
|
||||
@section('title', 'Modifica Gruppo')
|
||||
@section('page_title', 'Modifica Gruppo')
|
||||
|
||||
@push('styles')
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2-bootstrap4-theme@1.0.0/dist/select2-bootstrap4.min.css" rel="stylesheet" />
|
||||
<style>
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
|
||||
color: #333;
|
||||
}
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-search__field {
|
||||
height: 28px !important;
|
||||
min-height: 28px !important;
|
||||
width: auto !important;
|
||||
min-width: 30px;
|
||||
border: none !important;
|
||||
background: transparent !important;
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<form action="/gruppi/{{ $gruppo->id }}" method="POST">
|
||||
@csrf @method('PUT')
|
||||
@@ -31,10 +51,9 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Diocesi</label>
|
||||
<select name="diocesi_id" class="form-control">
|
||||
<option value="">Seleziona...</option>
|
||||
<select name="diocesi_ids[]" class="form-control select2-multi" multiple style="width: 100%;">
|
||||
@foreach($diocesi as $d)
|
||||
<option value="{{ $d->id }}" {{ old('diocesi_id', $gruppo->diocesi_id) == $d->id ? 'selected' : '' }}>{{ $d->nome }}</option>
|
||||
<option value="{{ $d->id }}" {{ in_array($d->id, old('diocesi_ids', $selectedDiocesiIds ?? [])) ? 'selected' : '' }}>{{ $d->nome }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -91,6 +110,55 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-address-book mr-2"></i>Contatti del Gruppo</h3>
|
||||
<button type="button" class="btn btn-xs btn-success float-right" onclick="aggiungiContatto()">
|
||||
<i class="fas fa-plus mr-1"></i> Aggiungi Contatto
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-bordered mb-0" id="contatti-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th style="width: 20%;">Tipo</th>
|
||||
<th style="width: 40%;">Valore</th>
|
||||
<th style="width: 25%;">Etichetta</th>
|
||||
<th style="width: 80px;">Primario</th>
|
||||
<th style="width: 50px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="contatti-tbody">
|
||||
@forelse(old('contatti', $gruppo->gruppoContatti) as $idx => $contatto)
|
||||
@php $contattoVal = is_array($contatto) ? $contatto : $contatto->toArray(); @endphp
|
||||
<tr>
|
||||
<td>
|
||||
<select name="contatti[{{ $idx }}][tipo]" class="form-control" required>
|
||||
<option value="email" {{ ($contattoVal['tipo'] ?? '') === 'email' ? 'selected' : '' }}>Email</option>
|
||||
<option value="telefono" {{ ($contattoVal['tipo'] ?? '') === 'telefono' ? 'selected' : '' }}>Telefono</option>
|
||||
<option value="cellulare" {{ ($contattoVal['tipo'] ?? '') === 'cellulare' ? 'selected' : '' }}>Cellulare</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="contatti[{{ $idx }}][valore]" class="form-control" value="{{ $contattoVal['valore'] ?? '' }}" required></td>
|
||||
<td><input type="text" name="contatti[{{ $idx }}][etichetta]" class="form-control" value="{{ $contattoVal['etichetta'] ?? '' }}" placeholder="Es. Ufficio"></td>
|
||||
<td class="text-center">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="contatto-primary-{{ $idx }}" name="contatti[{{ $idx }}][is_primary]" value="1" {{ !empty($contattoVal['is_primary']) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="contatto-primary-{{ $idx }}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><button type="button" class="btn btn-danger btn-xs" onclick="rimuoviContatto(this)"><i class="fas fa-trash"></i></button></td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="no-contatti-msg" class="text-center text-muted py-4" style="{{ $gruppo->gruppoContatti->count() > 0 ? 'display:none;' : '' }}">
|
||||
<p class="mb-0">Nessun contatto. Clicca su "Aggiungi Contatto" per iniziare.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-users mr-2"></i>Membri</h3>
|
||||
@@ -352,7 +420,67 @@
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.select2-multi').select2({
|
||||
theme: 'bootstrap4',
|
||||
placeholder: 'Cerca diocesi...',
|
||||
width: '100%',
|
||||
sorter: function(data) {
|
||||
return data.sort(function(a, b) {
|
||||
if (a.selected && !b.selected) return -1;
|
||||
if (!a.selected && b.selected) return 1;
|
||||
return a.text.localeCompare(b.text, 'it');
|
||||
});
|
||||
},
|
||||
language: {
|
||||
noResults: function() { return 'Nessuna diocesi trovata'; },
|
||||
searching: function() { return 'Ricerca...'; }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let contattiIndex = {{ old('contatti') ? count(old('contatti')) : $gruppo->gruppoContatti->count() }};
|
||||
|
||||
function aggiungiContatto() {
|
||||
const tbody = document.getElementById('contatti-tbody');
|
||||
const noMsg = document.getElementById('no-contatti-msg');
|
||||
if (noMsg) noMsg.style.display = 'none';
|
||||
|
||||
const row = document.createElement('tr');
|
||||
const idx = contattiIndex;
|
||||
row.innerHTML = `
|
||||
<td>
|
||||
<select name="contatti[${idx}][tipo]" class="form-control" required>
|
||||
<option value="">Seleziona...</option>
|
||||
<option value="email">Email</option>
|
||||
<option value="telefono">Telefono</option>
|
||||
<option value="cellulare">Cellulare</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="contatti[${idx}][valore]" class="form-control" placeholder="Es. info@example.com" required></td>
|
||||
<td><input type="text" name="contatti[${idx}][etichetta]" class="form-control" placeholder="Es. Ufficio"></td>
|
||||
<td class="text-center">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" id="contatto-primary-${idx}" name="contatti[${idx}][is_primary]" value="1">
|
||||
<label class="custom-control-label" for="contatto-primary-${idx}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><button type="button" class="btn btn-danger btn-xs" onclick="rimuoviContatto(this)"><i class="fas fa-trash"></i></button></td>
|
||||
`;
|
||||
tbody.appendChild(row);
|
||||
contattiIndex++;
|
||||
}
|
||||
|
||||
function rimuoviContatto(btn) {
|
||||
const row = btn.closest('tr');
|
||||
row.remove();
|
||||
if (document.getElementById('contatti-tbody').children.length === 0) {
|
||||
document.getElementById('no-contatti-msg').style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
function showMembroForm() {
|
||||
console.log('showMembroForm called');
|
||||
var card = document.getElementById('membro-card');
|
||||
|
||||
@@ -161,7 +161,7 @@ $entityType = $entityType ?? 'gruppi';
|
||||
<td>{{ Str::limit($gruppo->descrizione, 50) ?: '-' }}</td>
|
||||
@endif
|
||||
@if(in_array('diocesi', $visibleColumns))
|
||||
<td>{{ $gruppo->diocesi?->nome ?? '-' }}</td>
|
||||
<td>{{ $gruppo->diocesi->count() > 0 ? $gruppo->diocesi->pluck('nome')->implode(', ') : '-' }}</td>
|
||||
@endif
|
||||
@if(in_array('livello', $visibleColumns))
|
||||
<td><span class="badge badge-{{ ($gruppo->depth ?? 0) == 0 ? 'primary' : 'secondary' }}">{{ $gruppo->depth ?? 0 }}</span></td>
|
||||
@@ -176,7 +176,7 @@ $entityType = $entityType ?? 'gruppi';
|
||||
<td>
|
||||
@php $resp = $gruppo->getResponsabili() @endphp
|
||||
@if($resp->count() > 0)
|
||||
{{ $resp->pluck('cognome')->implode(', ') }}
|
||||
{{ $resp->map(fn($r) => $r->nome . ' ' . $r->cognome)->implode(', ') }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@@ -189,10 +189,10 @@ $entityType = $entityType ?? 'gruppi';
|
||||
<td>{{ $gruppo->città_incontro ?: '-' }}</td>
|
||||
@endif
|
||||
@if(in_array('telefono', $visibleColumns))
|
||||
<td>-</td>
|
||||
<td>{{ $gruppo->telefono_primario ?? '-' }}</td>
|
||||
@endif
|
||||
@if(in_array('email', $visibleColumns))
|
||||
<td>-</td>
|
||||
<td>{{ $gruppo->email_primaria ?? '-' }}</td>
|
||||
@endif
|
||||
@if(in_array('tag', $visibleColumns))
|
||||
<td>
|
||||
|
||||
@@ -20,7 +20,7 @@ $responsabili = $gruppo->getResponsabili();
|
||||
</a>
|
||||
<span class="badge badge-{{ ($gruppo->depth ?? 0) == 0 ? 'primary' : 'secondary' }} badge-level">{{ $gruppo->depth ?? 0 }}</span>
|
||||
<small class="text-muted ml-2">
|
||||
{{ $gruppo->diocesi?->nome ?? '' }}
|
||||
{{ $gruppo->diocesi->count() > 0 ? $gruppo->diocesi->pluck('nome')->implode(', ') : '' }}
|
||||
@if($responsabili->count() > 0)
|
||||
· <i class="fas fa-user text-info"></i> {{ $responsabili->pluck('cognome')->implode(', ') }}
|
||||
@endif
|
||||
|
||||
@@ -26,7 +26,7 @@ $canDeleteGruppi = Auth::user()->canDelete('gruppi');
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
@@ -35,52 +35,113 @@ $canDeleteGruppi = Auth::user()->canDelete('gruppi');
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm table-borderless">
|
||||
<tr>
|
||||
<td style="width: 130px;"><strong>Path:</strong></td>
|
||||
<td class="text-muted small">{{ $gruppo->full_path }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Gruppo Padre:</strong></td>
|
||||
<td>
|
||||
@if($gruppo->parent)
|
||||
<a href="{{ route('gruppi.show', $gruppo->parent->id) }}">{{ $gruppo->parent->nome }}</a>
|
||||
@else
|
||||
<span class="badge badge-success">Gruppo radice</span>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<tr>
|
||||
<td style="width: 130px;"><strong>Path:</strong></td>
|
||||
<td class="text-muted small">{{ $gruppo->full_path }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Gruppo Padre:</strong></td>
|
||||
<td>
|
||||
@if($gruppo->parent)
|
||||
<a href="{{ route('gruppi.show', $gruppo->parent->id) }}">{{ $gruppo->parent->nome }}</a>
|
||||
@else
|
||||
<span class="badge badge-success">Gruppo radice</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Diocesi:</strong></td>
|
||||
<td>
|
||||
@if($gruppo->diocesi->count() > 0)
|
||||
@foreach($gruppo->diocesi as $diocesi)
|
||||
<span class="badge badge-secondary mr-1">{{ $diocesi->nome }}</span>
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<tr>
|
||||
<td style="width: 130px;"><strong>Responsabili:</strong></td>
|
||||
<td>
|
||||
@php $responsabili = $gruppo->getResponsabili() @endphp
|
||||
@if($responsabili->count() > 0)
|
||||
@foreach($responsabili as $resp)
|
||||
<a href="{{ route('individui.show', $resp->id) }}">
|
||||
<i class="fas fa-user text-info mr-1"></i>
|
||||
{{ $resp->nome_completo }}
|
||||
</a><br>
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Email:</strong></td>
|
||||
<td>{{ $gruppo->email_primaria ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Telefono:</strong></td>
|
||||
<td>{{ $gruppo->telefono_primario ?? '-' }}</td>
|
||||
</tr>
|
||||
@if($gruppo->gruppoContatti->count() > 0)
|
||||
<tr>
|
||||
<td><strong>Altri Contatti:</strong></td>
|
||||
<td>
|
||||
@foreach($gruppo->gruppoContatti as $contatto)
|
||||
@if(!$contatto->is_primary || ($contatto->tipo !== 'email' && $contatto->tipo !== 'telefono' && $contatto->tipo !== 'cellulare'))
|
||||
<div>
|
||||
@if($contatto->etichetta)<small class="text-muted">{{ $contatto->etichetta }}:</small>@endif
|
||||
<span>{{ $contatto->valore }}</span>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Diocesi:</strong></td>
|
||||
<td>{{ $gruppo->diocesi?->nome ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Responsabili:</strong></td>
|
||||
<td>
|
||||
@php $responsabili = $gruppo->getResponsabili() @endphp
|
||||
@if($responsabili->count() > 0)
|
||||
@foreach($responsabili as $resp)
|
||||
<a href="{{ route('individui.show', $resp->id) }}">
|
||||
<i class="fas fa-user text-info mr-1"></i>
|
||||
{{ $resp->nome_completo }}
|
||||
</a><br>
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
</div>
|
||||
|
||||
@php $incontroEvento = $gruppo->eventi->where('is_incontro_gruppo', true)->first(); @endphp
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-3">
|
||||
<div class="card h-100">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-chart-pie mr-2"></i>Statistiche</h3></div>
|
||||
<div class="card-body d-flex align-items-center">
|
||||
<div class="row text-center w-100">
|
||||
<div class="col-6">
|
||||
<h2 class="mb-0 text-primary">{{ $gruppo->individui->count() }}</h2>
|
||||
<small class="text-muted">Membri</small>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h2 class="mb-0 text-warning">{{ $gruppo->children->count() }}</h2>
|
||||
<small class="text-muted">Sottogruppi</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card h-100">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-map-marker-alt mr-2"></i>Luogo Incontro</h3></div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<tr>
|
||||
<td style="width: 100px;"><strong>Indirizzo:</strong></td>
|
||||
<td style="width: 80px;"><strong>Indirizzo:</strong></td>
|
||||
<td>{{ $gruppo->indirizzo_incontro ?: '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -94,34 +155,78 @@ $canDeleteGruppi = Auth::user()->canDelete('gruppi');
|
||||
</table>
|
||||
@if($gruppo->mappa_posizione)
|
||||
<a href="{{ $gruppo->mappa_posizione }}" target="_blank" class="btn btn-sm btn-outline-primary mt-2">
|
||||
<i class="fas fa-external-link-alt mr-1"></i> Visualizza su mappa
|
||||
<i class="fas fa-external-link-alt mr-1"></i> Mappa
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-chart-pie mr-2"></i>Statistiche</h3></div>
|
||||
@if($incontroEvento)
|
||||
<div class="col-md-3">
|
||||
<div class="card card-success h-100">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-calendar-check mr-2"></i>
|
||||
Giorno di Incontro
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row text-center">
|
||||
<div class="col-6">
|
||||
<div class="border-right">
|
||||
<h2 class="mb-0 text-primary">{{ $gruppo->individui->count() }}</h2>
|
||||
<small class="text-muted">Membri</small>
|
||||
</div>
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<tr>
|
||||
<td style="width: 70px;"><strong>Evento:</strong></td>
|
||||
<td>{{ $incontroEvento->nome_evento }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Quando:</strong></td>
|
||||
<td>
|
||||
@if($incontroEvento->tipo_recorrenza === 'settimanale')
|
||||
{{ $incontroEvento->giorno_settimana_label }}
|
||||
<span class="badge badge-info ml-1">Sett.</span>
|
||||
@elseif($incontroEvento->tipo_recorrenza === 'mensile')
|
||||
{{ $incontroEvento->occorrenza_mensile_label }}
|
||||
<span class="badge badge-info ml-1">Mens.</span>
|
||||
@elseif($incontroEvento->tipo_recorrenza === 'annuale')
|
||||
{{ $incontroEvento->mese_annuale_label }}
|
||||
<span class="badge badge-info ml-1">Ann.</span>
|
||||
@elseif($incontroEvento->tipo_recorrenza === 'altro')
|
||||
{{ $incontroEvento->giorno_settimana_label }}
|
||||
<span class="badge badge-info ml-1">Altro</span>
|
||||
@else
|
||||
{{ $incontroEvento->data_specifica?->format('d/m/Y') ?: '-' }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($incontroEvento->ora_inizio)
|
||||
<tr>
|
||||
<td><strong>Ora:</strong></td>
|
||||
<td>ore {{ $incontroEvento->ora_inizio->format('H:i') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
@if($incontroEvento->responsabili->count() > 0)
|
||||
<hr>
|
||||
<small class="text-muted"><strong>Resp.:</strong></small>
|
||||
@foreach($incontroEvento->responsabili as $resp)
|
||||
<div class="mt-1">
|
||||
<i class="fas fa-user text-info mr-1"></i>
|
||||
<a href="/individui/{{ $resp->id }}">{{ $resp->cognome }} {{ $resp->nome }}</a>
|
||||
@if($resp->telefono_primario)
|
||||
<br><small class="text-success ml-3">{{ $resp->telefono_primario }}</small>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h2 class="mb-0 text-warning">{{ $gruppo->children->count() }}</h2>
|
||||
<small class="text-muted">Sottogruppi</small>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="mt-2">
|
||||
<a href="/eventi/{{ $incontroEvento->id }}" class="btn btn-xs btn-outline-primary">
|
||||
<i class="fas fa-eye mr-1"></i> Vedi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
@endif
|
||||
<div class="col-md-3">
|
||||
<div class="card h-100">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><i class="fas fa-camera mr-2"></i>Avatar</h3>
|
||||
</div>
|
||||
@@ -130,113 +235,38 @@ $canDeleteGruppi = Auth::user()->canDelete('gruppi');
|
||||
<img src="{{ $gruppo->avatar_url }}"
|
||||
alt="{{ $gruppo->nome }}"
|
||||
class="img-thumbnail mb-2"
|
||||
style="max-width: 120px; max-height: 120px; object-fit: cover; border-radius: 50%;">
|
||||
style="max-width: 100px; max-height: 100px; object-fit: cover; border-radius: 50%;">
|
||||
<br>
|
||||
<form id="remove-avatar-form" class="d-inline">
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="removeAvatar()">
|
||||
<i class="fas fa-trash mr-1"></i>Rimuovi
|
||||
<i class="fas fa-trash mr-1"></i>
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<div class="bg-secondary d-flex align-items-center justify-content-center mb-3"
|
||||
style="width: 120px; height: 120px; margin: 0 auto; border-radius: 50%;">
|
||||
<i class="fas fa-folder fa-4x text-white"></i>
|
||||
<div class="bg-secondary d-flex align-items-center justify-content-center mx-auto mb-3"
|
||||
style="width: 100px; height: 100px; border-radius: 50%;">
|
||||
<i class="fas fa-folder fa-3x text-white"></i>
|
||||
</div>
|
||||
@endif
|
||||
<form id="avatar-upload-form" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="custom-file mb-2">
|
||||
<input type="file" class="custom-file-input" id="avatar-input" name="avatar" accept="image/jpeg,image/png,image/gif,image/webp">
|
||||
<label class="custom-file-label" for="avatar-input">Scegli immagine...</label>
|
||||
<label class="custom-file-label" for="avatar-input">Scegli...</label>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="uploadAvatar()">
|
||||
<i class="fas fa-upload mr-1"></i>Carica
|
||||
<i class="fas fa-upload mr-1"></i> Carica
|
||||
</button>
|
||||
</form>
|
||||
<div id="avatar-message" class="mt-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$incontroEvento = $gruppo->eventi->where('is_incontro_gruppo', true)->first();
|
||||
@endphp
|
||||
@if($incontroEvento)
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card card-success">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<i class="fas fa-calendar-check mr-2"></i>
|
||||
Giorno di Incontro
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-sm table-borderless mb-0">
|
||||
<tr>
|
||||
<td style="width: 100px;"><strong>Evento:</strong></td>
|
||||
<td>{{ $incontroEvento->nome_evento }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Quando:</strong></td>
|
||||
<td>
|
||||
@if($incontroEvento->tipo_recorrenza === 'settimanale')
|
||||
{{ $incontroEvento->giorno_settimana_label }}
|
||||
<span class="badge badge-info ml-1">Settimanale</span>
|
||||
@elseif($incontroEvento->tipo_recorrenza === 'mensile')
|
||||
{{ $incontroEvento->occorrenza_mensile_label }}
|
||||
@if($incontroEvento->mesi_recorrenza)
|
||||
<small class="text-muted">({{ $incontroEvento->mesi_recorrenza_label }})</small>
|
||||
@endif
|
||||
<span class="badge badge-info ml-1">Mensile</span>
|
||||
@elseif($incontroEvento->tipo_recorrenza === 'annuale')
|
||||
{{ $incontroEvento->mese_annuale_label }}
|
||||
@if($incontroEvento->giorno_mese)
|
||||
, giorno {{ $incontroEvento->giorno_mese }}
|
||||
@endif
|
||||
<span class="badge badge-info ml-1">Annuale</span>
|
||||
@elseif($incontroEvento->tipo_recorrenza === 'altro')
|
||||
{{ $incontroEvento->giorno_settimana_label }}
|
||||
<span class="badge badge-info ml-1">Altro</span>
|
||||
@else
|
||||
{{ $incontroEvento->data_specifica?->format('d/m/Y') ?: '-' }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($incontroEvento->ora_inizio)
|
||||
<tr>
|
||||
<td><strong>Ora:</strong></td>
|
||||
<td>ore {{ $incontroEvento->ora_inizio->format('H:i') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
@if($incontroEvento->responsabili->count() > 0)
|
||||
<hr>
|
||||
<small class="text-muted"><strong>Responsabili:</strong></small>
|
||||
@foreach($incontroEvento->responsabili as $resp)
|
||||
<div class="mt-1">
|
||||
<i class="fas fa-user text-info mr-1"></i>
|
||||
<a href="/individui/{{ $resp->id }}">{{ $resp->cognome }} {{ $resp->nome }}</a>
|
||||
@if($resp->telefono_primario)
|
||||
<br><small class="text-success ml-3">{{ $resp->telefono_primario }}</small>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="mt-2">
|
||||
<a href="/eventi/{{ $incontroEvento->id }}" class="btn btn-xs btn-outline-primary">
|
||||
<i class="fas fa-eye mr-1"></i> Vedi evento
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($gruppo->descrizione)
|
||||
@if($gruppo->descrizione)
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><h3 class="card-title"><i class="fas fa-align-left mr-2"></i>Descrizione</h3></div>
|
||||
<div class="card-body">
|
||||
@@ -413,7 +443,7 @@ $canDeleteGruppi = Auth::user()->canDelete('gruppi');
|
||||
{{ $child->nome }}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ $child->diocesi?->nome ?? '-' }}</td>
|
||||
<td>@if($child->diocesi->count() > 0)@foreach($child->diocesi as $dio)<span class="badge badge-secondary mr-1">{{ $dio->nome }}</span>@endforeach @else <span class="text-muted">-</span>@endif</td>
|
||||
<td>{{ $child->getResponsabili()->isNotEmpty() ? $child->getResponsabili()->first()->nome_completo : '-' }}</td>
|
||||
<td class="text-center">
|
||||
@if($child->individui()->count() > 0)
|
||||
|
||||
Reference in New Issue
Block a user