feat(schedule): group reservations by real time slots and clean date-time formatting v3.4.2
This commit is contained in:
@@ -179,25 +179,35 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-3">
|
||||
<!-- Timeline View -->
|
||||
<!-- Timeline View: Agrupado por franja horaria real sin repeticiones -->
|
||||
<div id="timeline-view">
|
||||
{% for hour in range(7, 22) %}
|
||||
<div class="row border-bottom py-3 align-items-start {% if time_blocks[hour] %}bg-light-subtle{% endif %}">
|
||||
<div class="col-md-2 col-3">
|
||||
<div class="text-center p-2 rounded bg-body-tertiary border">
|
||||
<strong class="h5 text-primary mb-0 font-monospace">{% if hour < 10 %}0{% endif %}{{ hour }}:00</strong>
|
||||
<div class="small text-muted font-monospace">{{ hour+1 }}:00 hs</div>
|
||||
{% for slot in grouped_slots %}
|
||||
<div class="row border-bottom py-3 align-items-stretch bg-light-subtle mb-3 rounded border mx-0">
|
||||
<div class="col-lg-2 col-md-3 col-12 mb-3 mb-md-0 d-flex flex-column justify-content-center">
|
||||
<div class="text-center p-3 rounded bg-body-tertiary border shadow-sm h-100 d-flex flex-column justify-content-center">
|
||||
<div class="badge bg-primary-subtle text-primary border border-primary-subtle mb-2 font-monospace">
|
||||
<i class="bi bi-clock me-1"></i>{{ slot.shift }}
|
||||
</div>
|
||||
<strong class="h4 text-primary d-block mb-0 font-monospace">{{ slot.start_time }}</strong>
|
||||
<div class="small fw-bold text-dark font-monospace">a {{ slot.end_time }} hs</div>
|
||||
<div class="badge bg-secondary-subtle text-secondary border mt-2 align-self-center font-monospace" style="font-size: 0.75rem;">
|
||||
<i class="bi bi-hourglass-split me-1"></i>{{ slot.duration_display }}
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<span class="badge bg-light text-muted border" style="font-size: 0.72rem;">
|
||||
{{ slot.items | length }} {% if slot.items | length == 1 %}asignatura{% else %}asignaturas{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-10 col-9">
|
||||
{% if time_blocks[hour] %}
|
||||
<div class="row g-2">
|
||||
{% for item in time_blocks[hour] %}
|
||||
<div class="col-md-6">
|
||||
<div class="card border-0 shadow-sm h-100 border-start border-4 border-primary">
|
||||
<div class="card-body p-3">
|
||||
<div class="col-lg-10 col-md-9 col-12">
|
||||
<div class="row g-2">
|
||||
{% for item in slot.items %}
|
||||
<div class="col-md-6 col-xl-6">
|
||||
<div class="card border-0 shadow-sm h-100 border-start border-4 {% if item.reservation.is_virtual %}border-info{% else %}border-primary{% endif %}">
|
||||
<div class="card-body p-3 d-flex flex-column justify-content-between">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div>
|
||||
<h6 class="card-title fw-bold mb-1 text-primary">
|
||||
@@ -207,62 +217,76 @@
|
||||
{{ item.reservation.subject_code }}
|
||||
</span>
|
||||
<span class="badge bg-info-subtle text-info border">
|
||||
{{ item.reservation.shift or 'Tarde' }}
|
||||
{{ item.reservation.shift or slot.shift }}
|
||||
</span>
|
||||
{% if item.reservation.commission %}
|
||||
<span class="badge bg-light text-dark border font-monospace">
|
||||
{{ item.reservation.commission.code or item.reservation.commission.name }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="badge bg-{% if item.reservation.status == 'CONFIRMED' or item.reservation.status.value == 'CONFIRMED' %}success-subtle text-success border border-success-subtle{% else %}warning-subtle text-warning border border-warning-subtle{% endif %}">
|
||||
{% if item.reservation.status == 'CONFIRMED' or item.reservation.status.value == 'CONFIRMED' %}
|
||||
Confirmada
|
||||
<i class="bi bi-check-circle me-1"></i>Confirmada
|
||||
{% else %}
|
||||
Pendiente
|
||||
<i class="bi bi-clock me-1"></i>Pendiente
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="small text-muted mb-2">
|
||||
<span class="fw-semibold text-dark me-2">
|
||||
{% if item.reservation.is_virtual %}
|
||||
<i class="bi bi-laptop me-1 text-info"></i>{{ item.classroom.code }}
|
||||
{% else %}
|
||||
<i class="bi bi-door-open me-1 text-success"></i>{{ item.classroom.code }}
|
||||
{% endif %}
|
||||
</span>
|
||||
<span class="me-2">
|
||||
<i class="bi bi-layers me-1"></i>{% if item.classroom.floor == 0 %}PB{% else %}Piso {{ item.classroom.floor }}{% endif %}
|
||||
{% if item.classroom.building %} · {{ item.classroom.building }}{% endif %}
|
||||
</span>
|
||||
<span>
|
||||
<i class="bi bi-clock me-1 text-warning"></i>{{ item.reservation.start_time }} - {{ item.reservation.end_time }} hs
|
||||
<i class="bi bi-clock me-1 text-warning"></i>{{ item.reservation.time_display }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center pt-2 border-top">
|
||||
<span class="small text-muted">
|
||||
<i class="bi bi-people me-1"></i>{{ item.reservation.expected_attendees }} estudiantes
|
||||
</span>
|
||||
<div class="d-flex gap-1">
|
||||
{% if item.reservation.effective_virtual_link %}
|
||||
<a href="{{ item.reservation.effective_virtual_link }}" target="_blank" class="btn btn-sm btn-outline-success py-0 px-2 d-inline-flex align-items-center" title="Unirse a Videollamada (Zoom / Meet)">
|
||||
<i class="bi bi-camera-video me-1"></i>Zoom/Meet
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if user.can_edit_reservation(item.reservation) %}
|
||||
<a href="/schedule/edit_reservation?id={{ item.reservation.id }}" class="btn btn-sm btn-outline-warning py-0 px-2" title="Modificar Reserva">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="/schedule/view_reservation?id={{ item.reservation.id }}" class="btn btn-sm btn-outline-secondary py-0 px-2" title="Ver Ficha Detallada">
|
||||
<i class="bi bi-eye me-1"></i>Detalles
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center pt-2 border-top mt-2">
|
||||
<span class="small text-muted">
|
||||
<i class="bi bi-people me-1"></i>{{ item.reservation.expected_attendees }} estudiantes
|
||||
{% if item.reservation.teacher_name or item.user.name %}
|
||||
· <i class="bi bi-person me-1"></i>{{ item.reservation.teacher_name or item.user.name }}
|
||||
{% endif %}
|
||||
</span>
|
||||
<div class="d-flex gap-1">
|
||||
{% if item.reservation.effective_virtual_link %}
|
||||
<a href="{{ item.reservation.effective_virtual_link }}" target="_blank" class="btn btn-sm btn-outline-success py-0 px-2 d-inline-flex align-items-center" title="Unirse a Videollamada (Zoom / Meet)">
|
||||
<i class="bi bi-camera-video me-1"></i>Zoom/Meet
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if user.can_edit_reservation(item.reservation) %}
|
||||
<a href="/schedule/edit_reservation?id={{ item.reservation.id }}" class="btn btn-sm btn-outline-warning py-0 px-2" title="Modificar Reserva">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="/schedule/view_reservation?id={{ item.reservation.id }}" class="btn btn-sm btn-outline-secondary py-0 px-2" title="Ver Ficha Detallada">
|
||||
<i class="bi bi-eye me-1"></i>Detalles
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-muted py-2 small ps-2">
|
||||
<i class="bi bi-dash-circle me-1"></i>Sin clases programadas en este horario
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center py-4 text-muted">
|
||||
<i class="bi bi-calendar-check fs-2 d-block mb-2"></i>
|
||||
No hay clases programadas para esta fecha con los filtros aplicados.
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -284,15 +308,16 @@
|
||||
<tbody>
|
||||
{% for reservation in reservations %}
|
||||
<tr>
|
||||
<td class="ps-3 font-monospace fw-bold">
|
||||
{{ reservation.start_time }} - {{ reservation.end_time }} hs
|
||||
<td class="ps-3 font-monospace fw-bold text-nowrap">
|
||||
<i class="bi bi-clock me-1 text-primary"></i>{{ reservation.time_display }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-secondary-subtle text-secondary font-monospace border">
|
||||
{{ reservation.classroom.code if reservation.classroom else 'Sin Aula' }}
|
||||
</span>
|
||||
<small class="text-muted d-block">
|
||||
{% if reservation.classroom and reservation.classroom.floor == 0 %}Planta Baja{% elif reservation.classroom %}Piso {{ reservation.classroom.floor }}{% endif %}
|
||||
{% if reservation.classroom and reservation.classroom.floor == 0 %}PB{% elif reservation.classroom %}Piso {{ reservation.classroom.floor }}{% endif %}
|
||||
{% if reservation.classroom and reservation.classroom.building %} · {{ reservation.classroom.building }}{% endif %}
|
||||
</small>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user