G26-Telemetry-Software/Plataform_Web/templates/gestion_temporadas.html
2026-06-30 17:39:25 +02:00

100 lines
5 KiB
HTML

{% extends 'base.html' %}
{% load static %}
{% block title %}Gestión de Temporadas | Gades Manager{% endblock title %}
{% block content %}
<div class="row mb-3 flex-shrink-0">
<div class="col-12">
<div class="bg-dark text-white p-3 rounded-3 shadow-sm d-flex justify-content-between align-items-center" style="border-left: 5px solid #0d6efd;">
<div>
<h1 class="display-6 fw-bold mb-1">Gestión de Temporadas</h1>
<p class="text-white-50 mb-0">Crea, edita y elimina temporadas del equipo.</p>
</div>
<a href="{% url 'crear_temporada' %}" class="btn btn-primary fw-bold">+ Nueva Temporada</a>
</div>
</div>
</div>
<div class="row g-4" style="overflow-y: auto;">
{% if messages %}
<div class="col-12">
{% for message in messages %}
<div class="alert alert-success py-2 small mb-0">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
<div class="col-12">
<div class="card border-0 shadow-sm">
<div class="card-body p-4">
<div class="table-responsive">
<table class="table table-hover align-middle">
<thead class="table-dark">
<tr>
<th>Nombre</th>
<th>Fecha inicio</th>
<th>Fecha fin</th>
<th>Presupuesto</th>
<th>Miembros</th>
<th>Estado</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
{% for temporada in temporadas %}
<tr>
<td class="fw-semibold">{{ temporada.nombre }}</td>
<td>{{ temporada.fecha_inicio|date:"d/m/Y" }}</td>
<td>{{ temporada.fecha_fin|date:"d/m/Y" }}</td>
<td>{{ temporada.presupuesto|floatformat:2 }} €</td>
<td>{{ temporada.miembros.count }}</td>
<td>
{% if temporada.actual %}
<span class="badge bg-success">Activa</span>
{% else %}
<span class="badge bg-secondary">Anterior</span>
{% endif %}
</td>
<td class="d-flex gap-2">
<a href="{% url 'editar_temporada' temporada.pk %}" class="btn btn-sm btn-outline-primary">Editar</a>
<button type="button" class="btn btn-sm btn-outline-danger" data-bs-toggle="modal" data-bs-target="#eliminarModal{{ temporada.pk }}">Eliminar</button>
</td>
</tr>
<div class="modal fade" id="eliminarModal{{ temporada.pk }}" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Confirmar eliminación</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
¿Seguro que quieres eliminar la temporada <strong>{{ temporada.nombre }}</strong>? Esta acción no se puede deshacer.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<form method="post" action="{% url 'eliminar_temporada' temporada.pk %}">
{% csrf_token %}
<button type="submit" class="btn btn-danger fw-bold">Eliminar</button>
</form>
</div>
</div>
</div>
</div>
{% empty %}
<tr>
<td colspan="7" class="text-center text-secondary py-4">No hay temporadas creadas todavía.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock content %}