mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 05:58:25 +02:00
Add parental and photo authorizations + make health and vaccine sheet and motivation letter optional
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
from datetime import date, datetime
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.mail import send_mail
|
||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
@ -307,7 +308,7 @@ class ParticipantRegistration(Registration):
|
||||
"""
|
||||
The team is selected for final.
|
||||
"""
|
||||
translation.activate('fr')
|
||||
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
|
||||
subject = "[TFJM²] " + str(_("Team selected for the final tournament"))
|
||||
site = Site.objects.first()
|
||||
from participation.models import Tournament
|
||||
@ -425,7 +426,7 @@ class StudentRegistration(ParticipantRegistration):
|
||||
'priority': 5,
|
||||
'content': content,
|
||||
})
|
||||
if not self.health_sheet:
|
||||
if settings.HEALTH_SHEET_REQUIRED and not self.health_sheet:
|
||||
text = _("You have not uploaded your health sheet. "
|
||||
"You can do it by clicking on <a href=\"{health_url}\">this link</a>.")
|
||||
health_url = reverse_lazy("registration:upload_user_health_sheet", args=(self.id,))
|
||||
@ -436,7 +437,7 @@ class StudentRegistration(ParticipantRegistration):
|
||||
'priority': 5,
|
||||
'content': content,
|
||||
})
|
||||
if not self.vaccine_sheet:
|
||||
if settings.VACCINE_SHEET_REQUIRED and not self.vaccine_sheet:
|
||||
text = _("You have not uploaded your vaccine sheet. "
|
||||
"You can do it by clicking on <a href=\"{vaccine_url}\">this link</a>.")
|
||||
vaccine_url = reverse_lazy("registration:upload_user_vaccine_sheet", args=(self.id,))
|
||||
@ -801,7 +802,7 @@ class Payment(models.Model):
|
||||
return checkout_intent
|
||||
|
||||
def send_remind_mail(self):
|
||||
translation.activate('fr')
|
||||
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
|
||||
subject = "[TFJM²] " + str(_("Reminder for your payment"))
|
||||
site = Site.objects.first()
|
||||
for registration in self.registrations.all():
|
||||
@ -812,7 +813,7 @@ class Payment(models.Model):
|
||||
registration.user.email_user(subject, message, html_message=html)
|
||||
|
||||
def send_helloasso_payment_confirmation_mail(self):
|
||||
translation.activate('fr')
|
||||
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
|
||||
subject = "[TFJM²] " + str(_("Payment confirmation"))
|
||||
site = Site.objects.first()
|
||||
for registration in self.registrations.all():
|
||||
|
@ -0,0 +1,66 @@
|
||||
\documentclass[a4paper,french,11pt]{article}
|
||||
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{lmodern}
|
||||
\usepackage[french]{babel}
|
||||
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amssymb}
|
||||
%\usepackage{anyfontsize}
|
||||
\usepackage{fancybox}
|
||||
\usepackage{eso-pic,graphicx}
|
||||
\usepackage{xcolor}
|
||||
|
||||
|
||||
% Specials
|
||||
\newcommand{\writingsep}{\vrule height 4ex width 0pt}
|
||||
|
||||
% Page formating
|
||||
\hoffset -1in
|
||||
\voffset -1in
|
||||
\textwidth 180 mm
|
||||
\textheight 250 mm
|
||||
\oddsidemargin 15mm
|
||||
\evensidemargin 15mm
|
||||
\pagestyle{fancy}
|
||||
|
||||
% Headers and footers
|
||||
\fancyfoot{}
|
||||
\lhead{}
|
||||
\rhead{}
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
% \lfoot{\footnotesize Address}
|
||||
% \rfoot{\footnotesize todo association}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\includegraphics[height=2cm]{/code/static/eteam.png}\hfill{\fontsize{55pt}{55pt}ETEAM Tournament}
|
||||
|
||||
\vfill
|
||||
|
||||
\begin{center}
|
||||
\Large \bf Parental authorisation for minors
|
||||
\end{center}
|
||||
|
||||
I, \hrulefill,\\
|
||||
legal representative, residing at \writingsep\hrulefill\\
|
||||
\writingsep\hrulefill,\\
|
||||
\writingsep autorise {{ registration|default:"\hrulefill" }},\\
|
||||
born on {{ registration.birth_date }},
|
||||
to participate in the European Tournament of Enthusiastic Apprentice Mathematicians (ETEAM) organised in:
|
||||
{{ tournament.place }}, from {{ tournament.date_start }} to {{ tournament.date_end }}.
|
||||
|
||||
The participant will travel to the abovementioned location on Monday morning and will leave the premises on Friday afternoon by independant means and under the responsibility of the legal representative.
|
||||
|
||||
|
||||
\vspace{8ex}
|
||||
|
||||
Signature:
|
||||
|
||||
\vfill
|
||||
\vfill
|
||||
|
||||
\end{document}
|
@ -0,0 +1,112 @@
|
||||
\documentclass[a4paper,french,11pt]{article}
|
||||
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage{lmodern}
|
||||
\usepackage[french]{babel}
|
||||
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amssymb}
|
||||
%\usepackage{anyfontsize}
|
||||
\usepackage{fancybox}
|
||||
\usepackage{eso-pic,graphicx}
|
||||
\usepackage{xcolor}
|
||||
|
||||
|
||||
% Specials
|
||||
\newcommand{\writingsep}{\vrule height 4ex width 0pt}
|
||||
|
||||
% Page formating
|
||||
\hoffset -1in
|
||||
\voffset -1in
|
||||
\textwidth 180 mm
|
||||
\textheight 250 mm
|
||||
\oddsidemargin 15mm
|
||||
\evensidemargin 15mm
|
||||
\pagestyle{fancy}
|
||||
|
||||
% Headers and footers
|
||||
\fancyfoot{}
|
||||
\lhead{}
|
||||
\rhead{}
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
%\lfoot{\footnotesize Address}
|
||||
%\rfoot{\footnotesize todo association}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\includegraphics[height=2cm]{/code/static/eteam.png}\hfill{\fontsize{55pt}{55pt}{ETEAM Tournament}}
|
||||
|
||||
\vfill
|
||||
|
||||
\begin{center}
|
||||
|
||||
|
||||
\LARGE
|
||||
Video and interview consent and release form
|
||||
\end{center}
|
||||
\normalsize
|
||||
|
||||
|
||||
\thispagestyle{empty}
|
||||
|
||||
\bigskip
|
||||
|
||||
|
||||
|
||||
I, {{ registration|safe|default:"\dotfill" }}\\
|
||||
residing at {{ registration.address|safe|default:"\dotfill" }} {{ registration.zip_code|safe|default:"" }} {{ registration.city|safe|default:"" }}
|
||||
{{ registration.country|safe|default:"" }},\\
|
||||
|
||||
\medskip
|
||||
Tick the appropriate box(es).\\
|
||||
|
||||
\medskip
|
||||
|
||||
\fbox{\textcolor{white}{A}} Authorise the ETEAM organizers, for the ETEAM tournament from {{ tournament.date_start }} to {{ tournament.date_end }} in: {{ tournament.place }}, to photograph or film me and to distribute the photos and/or videos taken on this occasion on its website and on partner websites. I hereby grant ETEAM the right to use my image free of charge on all its information media: brochures, websites, social networks. ETEAM hereby becomes the assignee of the rights for these photographs. There is no time limit on the validity of this release nor are there any geographic limitations on where these materials may be distributed.\\
|
||||
|
||||
\medskip
|
||||
ETEAM commits itself, in accordance with the legal regulations in force relating to image rights, to ensuring that the publication and distribution of the image as well as the accompanying comments do not infringe on the private life, dignity and reputation of the person photographed.\\
|
||||
|
||||
\medskip
|
||||
\fbox{\textcolor{white}{A}} Authorise the broadcasting in the media (Press, Television, Internet) of photographs taken during any media coverage of this event.\\
|
||||
\medskip
|
||||
|
||||
\medskip
|
||||
\fbox{\textcolor{white}{A}} By signing this form, I acknowledge that I have completely read and fully understand the above consent and release and agree to be bound thereby. I hereby release any and all claims against any person or organisation utilising this material for marketing, educational, promotional, and/or any other lawful purpose whatsoever.\\
|
||||
|
||||
\medskip
|
||||
\fbox{\textcolor{white}{A}} I agree to be kept informed of other activities organised by ETEAM and its partners.\\
|
||||
\bigskip
|
||||
|
||||
Signature preceded by the words \og read and approved \fg{}
|
||||
\medskip
|
||||
|
||||
|
||||
\begin{minipage}[c]{0.5\textwidth}
|
||||
|
||||
\underline{Legal representative:}\\
|
||||
|
||||
\end{minipage}
|
||||
\begin{minipage}[c]{0.5\textwidth}
|
||||
|
||||
\underline{The participant:}\\
|
||||
|
||||
|
||||
\end{minipage}
|
||||
|
||||
|
||||
\vfill
|
||||
\vfill
|
||||
\begin{minipage}[c]{0.5\textwidth}
|
||||
% \footnotesize Address
|
||||
\end{minipage}
|
||||
\begin{minipage}[c]{0.5\textwidth}
|
||||
\footnotesize
|
||||
% \begin{flushright}
|
||||
% todo association
|
||||
% \end{flushright}
|
||||
\end{minipage}
|
||||
\end{document}
|
@ -89,25 +89,29 @@
|
||||
|
||||
{% if user_object.registration.studentregistration %}
|
||||
{% if user_object.registration.under_18 and user_object.registration.team.participation.tournament and not user_object.registration.team.participation.tournament.remote %}
|
||||
<dt class="col-sm-6 text-sm-end">{% trans "Health sheet:" %}</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if user_object.registration.health_sheet %}
|
||||
<a href="{{ user_object.registration.health_sheet.url }}">{% trans "Download" %}</a>
|
||||
{% endif %}
|
||||
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadHealthSheetModal">{% trans "Replace" %}</button>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% if TFJM.HEALTH_SHEET_REQUIRED %}
|
||||
<dt class="col-sm-6 text-sm-end">{% trans "Health sheet:" %}</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if user_object.registration.health_sheet %}
|
||||
<a href="{{ user_object.registration.health_sheet.url }}">{% trans "Download" %}</a>
|
||||
{% endif %}
|
||||
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadHealthSheetModal">{% trans "Replace" %}</button>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-sm-6 text-sm-end">{% trans "Vaccine sheet:" %}</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if user_object.registration.vaccine_sheet %}
|
||||
<a href="{{ user_object.registration.vaccine_sheet.url }}">{% trans "Download" %}</a>
|
||||
{% endif %}
|
||||
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadVaccineSheetModal">{% trans "Replace" %}</button>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% if TFJM.VACCINE_SHEET_REQUIRED %}
|
||||
<dt class="col-sm-6 text-sm-end">{% trans "Vaccine sheet:" %}</dt>
|
||||
<dd class="col-sm-6">
|
||||
{% if user_object.registration.vaccine_sheet %}
|
||||
<a href="{{ user_object.registration.vaccine_sheet.url }}">{% trans "Download" %}</a>
|
||||
{% endif %}
|
||||
{% if user_object.registration.team and not user_object.registration.team.participation.valid %}
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadVaccineSheetModal">{% trans "Replace" %}</button>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% endif %}
|
||||
|
||||
<dt class="col-sm-6 text-sm-end">{% trans "Parental authorization:" %}</dt>
|
||||
<dd class="col-sm-6">
|
||||
@ -165,7 +169,7 @@
|
||||
<dd class="col-sm-6">{{ user_object.registration.give_contact_to_animath|yesno }}</dd>
|
||||
</dl>
|
||||
|
||||
{% if user_object.registration.participates and user_object.registration.team.participation.valid %}
|
||||
{% if TFJM.PAYMENT_MANAGEMENT and user_object.registration.participates and user_object.registration.team.participation.valid %}
|
||||
<hr>
|
||||
{% for payment in user_object.registration.payments.all %}
|
||||
<dl class="row">
|
||||
@ -226,15 +230,19 @@
|
||||
{% include "base_modal.html" with modal_id="uploadPhotoAuthorization" modal_enctype="multipart/form-data" %}
|
||||
|
||||
{% if user_object.registration.under_18 %}
|
||||
{% trans "Upload health sheet" as modal_title %}
|
||||
{% trans "Upload" as modal_button %}
|
||||
{% url "registration:upload_user_health_sheet" pk=user_object.registration.pk as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="uploadHealthSheet" modal_enctype="multipart/form-data" %}
|
||||
{% if TFJM.HEALTH_SHEET_REQUIRED %}
|
||||
{% trans "Upload health sheet" as modal_title %}
|
||||
{% trans "Upload" as modal_button %}
|
||||
{% url "registration:upload_user_health_sheet" pk=user_object.registration.pk as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="uploadHealthSheet" modal_enctype="multipart/form-data" %}
|
||||
{% endif %}
|
||||
|
||||
{% trans "Upload vaccine sheet" as modal_title %}
|
||||
{% trans "Upload" as modal_button %}
|
||||
{% url "registration:upload_user_vaccine_sheet" pk=user_object.registration.pk as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="uploadVaccineSheet" modal_enctype="multipart/form-data" %}
|
||||
{% if TFJM.VACCINE_SHEET_REQUIRED %}
|
||||
{% trans "Upload vaccine sheet" as modal_title %}
|
||||
{% trans "Upload" as modal_button %}
|
||||
{% url "registration:upload_user_vaccine_sheet" pk=user_object.registration.pk as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="uploadVaccineSheet" modal_enctype="multipart/form-data" %}
|
||||
{% endif %}
|
||||
|
||||
{% trans "Upload parental authorization" as modal_title %}
|
||||
{% trans "Upload" as modal_button %}
|
||||
|
@ -442,7 +442,10 @@ class AuthorizationTemplateView(TemplateView):
|
||||
return context
|
||||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
tex = render_to_string(self.template_name, context=context, request=self.request)
|
||||
translation.activate(settings.PREFERRED_LANGUAGE_CODE)
|
||||
|
||||
template_name = self.get_template_names()[0]
|
||||
tex = render_to_string(template_name, context=context, request=self.request)
|
||||
temp_dir = mkdtemp()
|
||||
with open(os.path.join(temp_dir, "texput.tex"), "w") as f:
|
||||
f.write(tex)
|
||||
@ -451,20 +454,34 @@ class AuthorizationTemplateView(TemplateView):
|
||||
process.wait()
|
||||
return FileResponse(open(os.path.join(temp_dir, "texput.pdf"), "rb"),
|
||||
content_type="application/pdf",
|
||||
filename=self.template_name.split("/")[-1][:-3] + "pdf")
|
||||
filename=template_name.split("/")[-1][:-3] + "pdf")
|
||||
|
||||
|
||||
class AdultPhotoAuthorizationTemplateView(AuthorizationTemplateView):
|
||||
template_name = "registration/tex/Autorisation_droit_image_majeur.tex"
|
||||
def get_template_names(self):
|
||||
if settings.TFJM_APP == "TFJM":
|
||||
return ["registration/tex/Autorisation_droit_image_majeur.tex"]
|
||||
elif settings.TFJM_APP == "ETEAM":
|
||||
return ["registration/tex/photo_authorization_eteam_adult.tex"]
|
||||
|
||||
|
||||
class ChildPhotoAuthorizationTemplateView(AuthorizationTemplateView):
|
||||
template_name = "registration/tex/Autorisation_droit_image_mineur.tex"
|
||||
def get_template_names(self):
|
||||
if settings.TFJM_APP == "TFJM":
|
||||
return ["registration/tex/Autorisation_droit_image_mineur.tex"]
|
||||
elif settings.TFJM_APP == "ETEAM":
|
||||
return ["registration/tex/photo_authorization_eteam_child.tex"]
|
||||
|
||||
|
||||
class ParentalAuthorizationTemplateView(AuthorizationTemplateView):
|
||||
template_name = "registration/tex/Autorisation_parentale.tex"
|
||||
|
||||
def get_template_names(self):
|
||||
if settings.TFJM_APP == "TFJM":
|
||||
return ["registration/tex/Autorisation_parentale.tex"]
|
||||
elif settings.TFJM_APP == "ETEAM":
|
||||
return ["registration/tex/parental_authorization_eteam.tex"]
|
||||
|
||||
|
||||
class InstructionsTemplateView(AuthorizationTemplateView):
|
||||
template_name = "registration/tex/Instructions.tex"
|
||||
|
Reference in New Issue
Block a user