-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9871e8a
commit 3b662a5
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{% extends "admin/base_site.html" %} | ||
{% load i18n admin_urls %} | ||
|
||
{% block content %} | ||
<div id="content-main"> | ||
<h1>Reporte de Usuarios por Evento</h1> | ||
|
||
<form method="get" class="form-inline"> | ||
<div style="margin-bottom: 20px;"> | ||
<label for="event_id">Evento:</label> | ||
<select name="event_id" id="event_id"> | ||
<option value="">Seleccionar evento</option> | ||
{% for event in events %} | ||
<option value="{{ event.id }}" {% if event.id|stringformat:"s" == selected_event %}selected{% endif %}> | ||
{{ event.name }} | ||
</option> | ||
{% endfor %} | ||
</select> | ||
|
||
<input type="text" name="search" placeholder="Buscar..." value="{{ search_term }}"> | ||
<button type="submit" class="button">Buscar</button> | ||
|
||
{% if selected_event %} | ||
<a href="{% url 'admin:export_csv' %}?event_id={{ selected_event }}" class="button">Exportar a CSV</a> | ||
{% endif %} | ||
</div> | ||
</form> | ||
|
||
{% if results %} | ||
<div class="results"> | ||
<table> | ||
<thead> | ||
<tr> | ||
{% for column in columns %} | ||
<th>{{ column }}</th> | ||
{% endfor %} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in results %} | ||
<tr> | ||
{% for value in row %} | ||
<td>{{ value }}</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
||
<div class="paginator"> | ||
{% if has_prev %} | ||
<a href="?event_id={{ selected_event }}&page={{ page|add:"-1" }}&search={{ search_term }}">« Anterior</a> | ||
{% endif %} | ||
|
||
<span class="current"> | ||
Página {{ page }} de {{ total_pages }} | ||
</span> | ||
|
||
{% if has_next %} | ||
<a href="?event_id={{ selected_event }}&page={{ page|add:"1" }}&search={{ search_term }}">Siguiente »</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% endblock %} |