Modificación del de vista de dopcumentos del alumno

This commit is contained in:
2026-05-06 18:33:18 -06:00
parent 91d0813a9c
commit 964ed4bbd2
27 changed files with 1921 additions and 339 deletions
+35 -21
View File
@@ -11,22 +11,23 @@
<div class="card shadow mb-4">
<div class="card-header py-3">
<div class="d-sm-flex align-items-center justify-content-between">
@hasrole('Promotor')
<h6 class="m-0 font-weight-bold text-primary">Prospectos</h6>
@endrole
@hasrole('Control escolar')
<h6 class="m-0 font-weight-bold text-primary">Alumnos</h6>
@endrole
@can('alumno.create')
@if (Auth::user()->roles->contains('name', 'Promotor'))
<h6 class="m-0 font-weight-bold text-primary">Prospectos</h6>
<button onclick="Livewire.dispatch('create-prospecto')" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Agregar</button>
@endcan
@else
<h6 class="m-0 font-weight-bold text-primary">Alumnos</h6>
@endif
</div>
</div>
<div class="card-body row">
@hasrole('Promotor')
@if (Auth::user()->roles->contains('name', 'Promotor'))
<div class="col-sm-2 overflow-auto" style="height: 80vh">
<div class="list-group">
@forelse ($alumnos as $alumno)
@@ -64,14 +65,16 @@
</div>
@livewire('modal-prospecto')
@endrole
@hasrole('Control escolar')
@else
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
<thead>
<tr>
<th>Id</th>
<th>Foto</th>
<th>Alumno</th>
<th>Campus</th>
<th>Status</th>
@@ -86,10 +89,18 @@
<td>{{ $alumno->id }}</td>
<td class="text-center">
@foreach($alumno->alumnos as $user)
<img src="{{ $user?->profile_photo_url }}"
class="rounded-circle mr-3"
style="width:48px; height:48px; object-fit:cover; border:2px solid #36b9cc;" onclick="verFoto('{{ $user?->profile_photo_url }}','{{ $user->name }} {{ $user->apellidoPaterno }}')">
@endforeach
</td>
<td>
@foreach($alumno->alumnos as $user)
<a href="{{ route('alumno.show', $alumno->id) }}">
{{ $user->name }}
{{ $user->name }} {{ $user->apellidoPaterno }} {{ $user->apellidoMaterno }}
</a>
@endforeach
</td>
@@ -118,24 +129,20 @@
</span>
</td>
<td class="row mx-auto">
<td>
@can('alumno.edit')
<div class="col-sm-6 col-md-6">
<a class="btn btn-primary" href="{{ route('alumno.edit',$alumno->id) }}">
Edit
</a>
</div>
@endcan
@can('alumno.destroy')
<div class="col-sm-6 col-md-6">
<form class="delete-form" action="{{ route('alumno.destroy',$alumno->id) }}" method="POST">
@csrf
@method('DELETE')
<input type="submit" value="DELETE" class="btn btn-danger">
</form>
</div>
@endcan
</td>
@@ -151,8 +158,7 @@
</tbody>
</table>
@endrole
@endif
</div>
</div>
@@ -192,7 +198,6 @@ function verDocumento(url, docId) {
Livewire.dispatch('set-documento', { id: docId });
// 🔥 guardar instancia global
visorModalInstance = new bootstrap.Modal(
document.getElementById('visorModal')
);
@@ -208,12 +213,21 @@ document.addEventListener('livewire:init', () => {
visorModalInstance.hide();
}
// 🔥 limpiar iframe
document.getElementById('visorFrame').src = "";
});
});
function verFoto(url,nombre){
Swal.fire({
text: nombre,
imageUrl: url,
imageWidth: 400,
imageHeight: 400,
});
}
</script>
@endsection