mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-12-06 11:57:41 +01:00
Merge branch 'guest_list' into 'main'
Guest list See merge request bde/nk20!363
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{% comment %}
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
{% load i18n perms %}
|
||||
{% load i18n perms crispy_forms_tags %}
|
||||
{% load render_table from django_tables2 %}
|
||||
{% load static django_tables2 i18n %}
|
||||
|
||||
@@ -37,11 +37,20 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<div id="guests_table">
|
||||
{% render_table guests %}
|
||||
</div>
|
||||
{% if export %}
|
||||
<div class="card-footer text-center">
|
||||
<button class="btn btn-block btn-primary mb-3" onclick="window.location.href='?_export=1&table=guests'">
|
||||
{% trans "Export to CSV" %}
|
||||
</button>
|
||||
<a href="{% url 'activity:guest_pdf' activity_pk=activity.pk %}" data-turbolinks="false">
|
||||
<button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "Export to PDF" %}</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{% url 'activity:guest_pdf' activity_pk=activity.pk %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ email_form|crispy }}
|
||||
<button class="btn btn-primary" type="submit">{% trans "Share" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -118,5 +127,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
errMsg(xhr.responseJSON);
|
||||
});
|
||||
});
|
||||
{% if mail %}
|
||||
var mails = {{ mail|safe }};
|
||||
for (const mail of mails) {
|
||||
addMsg(gettext("An email has been sent to") + " " + mail, "success");
|
||||
}
|
||||
{% endif %}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
24
apps/activity/templates/activity/guest_list.html
Normal file
24
apps/activity/templates/activity/guest_list.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% load i18n %}
|
||||
{% now "Y-m-d" as today %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>[Note Kfet] Liste des invité·e·s à l'activité {{ activity.name }}</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Bonjour,
|
||||
|
||||
Vous trouverez en pièce-jointe la liste des invité·e·s à l'activité : {{ activity.name }}
|
||||
Cette liste vous est partagée par {{ user_identity }} (en copie de ce mail).
|
||||
|
||||
Bonne journée
|
||||
|
||||
--
|
||||
<p>
|
||||
Le BDE<br>
|
||||
{% trans "Mail generated by the Note Kfet on the" %} {% now "j F Y à H:i:s" %}
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
13
apps/activity/templates/activity/guest_list.txt
Normal file
13
apps/activity/templates/activity/guest_list.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
{% load i18n %}
|
||||
|
||||
Bonjour,
|
||||
|
||||
Vous trouverez en pièce-jointe la liste des invité·e·s à l'activité : {{ activity.name }}
|
||||
Cette liste vous est partagée par {{ user_identity }} (en copie de ce mail).
|
||||
|
||||
Bonne journée
|
||||
|
||||
--
|
||||
Le BDE
|
||||
|
||||
{% trans "Mail generated by the Note Kfet on the" %} {% now "j F Y à H:i:s" %}
|
||||
42
apps/activity/templates/activity/guestlist_sample.tex
Normal file
42
apps/activity/templates/activity/guestlist_sample.tex
Normal file
@@ -0,0 +1,42 @@
|
||||
\documentclass[a4paper,portrait,12pt]{article}
|
||||
|
||||
\usepackage{fontspec}
|
||||
\usepackage[margin=1.5cm]{geometry}
|
||||
\usepackage{longtable}
|
||||
|
||||
\begin{document}
|
||||
\begin{center}
|
||||
\LARGE{Liste des personnes invitées à l'activité « {{ activity.name }} »}
|
||||
|
||||
\end{center}
|
||||
|
||||
\normalsize
|
||||
\noindent En tout,\textbf{ {{total}} }personnes sont invitées à l'activité {{ activity.name }}. \\
|
||||
Elle aura lieu du {{ activity.date_start.astimezone.date }} à {{ activity.date_start.astimezone.time }}
|
||||
jusqu'au {{ activity.date_end.astimezone.date }} à {{ activity.date_end.astimezone.time }}.
|
||||
|
||||
\begin{center}
|
||||
\normalsize
|
||||
\begin{longtable}{c||c|c|c|c|}
|
||||
& \textbf{Nom} & \textbf{Prénom} & \textbf{École} & \textbf{Entrée} \\
|
||||
\hline\hline
|
||||
{% for guest in guests %}
|
||||
{{ forloop.counter }} & {{ guest.last_name|safe }} & {{ guest.first_name|safe }} & {{ guest.school|safe }} & \\
|
||||
\hline
|
||||
{% endfor %}
|
||||
\end{longtable}
|
||||
\end{center}
|
||||
|
||||
|
||||
\footnotesize
|
||||
\kern -3pt
|
||||
\hrule width 2in
|
||||
\kern 2.6pt
|
||||
\noindent AVERTISSEMENT :
|
||||
Cette liste contient des données personnelles (prénom, nom, école)
|
||||
et doit être traitée conformément au RGPD.
|
||||
Elle ne doit être utilisée que pour les besoins stricts de
|
||||
l’organisation de l'activité et ne doit pas être diffusée.
|
||||
Toute copie, extraction ou conservation non nécessaire est interdite.
|
||||
|
||||
\end{document}
|
||||
Reference in New Issue
Block a user