1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-25 03:30:30 +02:00

Add PDF member lists

This commit is contained in:
Yohann D'ANELLO
2020-04-23 18:28:16 +02:00
parent 38b32b0623
commit b81f186866
15 changed files with 427 additions and 166 deletions

View File

@ -41,4 +41,10 @@
</div>
{% render_table memberships %}
</div>
<hr>
<a href="{% url 'wei:wei_memberships_bus_pdf' wei_pk=club.pk bus_pk=object.pk %}" data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}

View File

@ -45,4 +45,10 @@
</div>
{% render_table memberships %}
</div>
<hr>
<a href="{% url 'wei:wei_memberships_team_pdf' wei_pk=club.pk bus_pk=object.bus.pk team_pk=object.pk %}" data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}

View File

@ -0,0 +1,37 @@
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[margin=2cm]{geometry}
\usepackage{tabularx}
\begin{document}
\begin{center}
\huge{Liste des inscrits \og {{ wei.name }} \fg{}}
{% if bus %}
\LARGE{Bus {{ bus.name }}}
{% if team %}
\Large{Équipe {{ team.name }}}
{% endif %}
{% endif %}
\end{center}
\begin{center}
\begin{tabularx}{\textwidth}{|c|c|c|c|c|c|c|X|}
\hline
\textbf{Nom} & \textbf{Prénom} & \textbf{Genre} & \textbf{Département} & \textbf{Année} & \textbf{Bus} & \textbf{Équipe} & \textbf{Rôles} \\
\hline
{% for membership in memberships %}
{{ membership.user.last_name|safe }} & {{ membership.user.first_name|safe }} & {{ membership.registration.get_gender_display|safe }}
& {{ membership.user.profile.get_department_display|safe }} & {{ membership.user.profile.ens_year|safe }}A & {{ membership.bus.name|safe }}
& {% if membership.team %}{{ membership.team.name|safe }}{% else %}--{% endif %} & {{ membership.roles.all|join:", "|safe }} \\
\hline
{% endfor %}
\end{tabularx}
\end{center}
\end{document}

View File

@ -23,6 +23,12 @@
<a href="{% url 'wei:wei_registrations' pk=club.pk %}">
<button class="btn btn-block btn-info">{% trans "View unvalidated registrations..." %}</button>
</a>
<hr>
<a href="{% url 'wei:wei_memberships_pdf' wei_pk=club.pk %}" data-turbolinks="false">
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endblock %}
{% block extrajavascript %}