You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

107 lines
4.4 KiB

{% extends 'base.html' %}
{% block menuapp %}
{% endblock menuapp %}
{% block content %}
<div class="container-xl">
<div class="row g-3 mb-4 align-items-center justify-content-between">
<div class="col-auto">
{% if messages %}
<ul class="messages">
{% for message in messages %}
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% else %}alert-info{% endif %} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% for evento in eventos %}
<div class="card card-notification shadow-sm mb-4">
<div class="card-header px-4 py-3">
<div class="row g-3 align-items-center">
<div class="col-12 col-lg-auto text-center text-lg-start">
<h4 class="notification-title mb-1">{{ evento.nombre }}</h4>
<div class="app-card-body p-4">
<pre>{{ evento.descripcion }}</pre>
</div><!--//app-card-body-->
<ul class="notification-meta list-inline mb-0">
<li class="list-inline-item">Fecha: {{ evento.fecha }}</li>
<li class="list-inline-item">|</li>
<li class="list-inline-item">Plazas: {{ evento.plazas_disponibles }}. Quedan: {{ evento.plazas_restantes }}</li>
</ul>
</div><!--//col-->
</div><!--//row-->
<div class="col-auto">
{% if evento.evento.publicado or user.is_staff %} <!-- Solo mostrar eventos publicados a usuarios -->
{% if not evento.inscrito %}
{% if evento.plazas_restantes > 0 %}
<a class="btn btn-primary" href="{% url 'eventos:reservar_evento' evento.id %}">Reservar</a>
{% else %}
{% if not evento.en_espera %}
<a class="btn btn-warning" href="{% url 'eventos:apuntar_lista_espera' evento.evento.id %}">Apuntarse a la lista de espera</a>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% if user.is_staff and not evento.evento.publicado %}
<a class="btn btn-danger" href="{% url 'eventos:publicar_evento' evento.id %}">Publicar</a>
{% endif %}
</div>
</div><!--//card-header-->
<div class="row g-3 align-items-center">
<div class="col-12 col-lg-auto text-center text-lg-start">
{% if reservas %}
<table class="table table-hover mb-0 text-left">
<thead>
<tr>
<th class="cell">Apuntados</th>
</tr>
</thead>
<tbody>
{% for reserva in reservas %}
<tr>
<td class="cell">{{ reserva.usuario.nombre }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No hay nadie apuntado</p>
{% endif %}
{% if lista %}
<p></p>
<table class="table table-hover mb-0 text-left">
<thead>
<tr>
<th class="cell">Lista de espera</th>
<th class="cell">En lista desde...</th>
</tr>
</thead>
<tbody>
{% for l in lista %}
<tr>
<td class="cell">{{ l.usuario.nombre }}</td>
<td class="cell">{{ l.fecha_apuntado }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</div><!--//card-->
{% endfor %}
{% endblock %}