eventos_por_usuario.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends "base.html" %}
  2. {% block content %}
  3. <h2>Eventos en los que participa o ha participado {{ usuario.get_full_name|default:usuario.nombre }}</h2>
  4. {% if reservas %}
  5. <table class="table table-striped">
  6. <thead>
  7. <tr>
  8. <th>Evento</th>
  9. <th>Fecha</th>
  10. {% if user.is_staff %}
  11. <th>Acciones</th>
  12. {% endif %}
  13. </tr>
  14. </thead>
  15. <tbody>
  16. {% for reserva in reservas %}
  17. <tr>
  18. <td><a href="{% url 'eventos:detalle_evento' reserva.evento.id %}">{{ reserva.evento.nombre }}</a></td>
  19. <td>{{ reserva.evento.fecha }}</td>
  20. {% if user.is_staff %}
  21. <td>
  22. <form action="{% url 'eventos:cancelar_reserva_admin' reserva.id %}" method="post" style="display:inline;">
  23. {% csrf_token %}
  24. <button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('¿Eliminar esta inscripción?')">
  25. Eliminar
  26. </button>
  27. </form>
  28. </td>
  29. {% endif %}
  30. </tr>
  31. {% endfor %}
  32. </tbody>
  33. </table>
  34. {% else %}
  35. <p>No está inscrito en ningún evento.</p>
  36. {% endif %}
  37. <a href="{% url 'eventos:estadisticas_por_usuario' %}">← Volver a estadísticas</a>
  38. {% endblock %}