From 73ea3d17173dfdfe395be4b1fb484f2d4f10b9fa Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Fri, 7 Jun 2024 17:24:24 +0200 Subject: [PATCH] Auto select the single tournament for ETEAM Signed-off-by: Emmy D'Anello --- participation/forms.py | 6 + participation/signals.py | 2 + .../tex/photo_authorization_eteam_child.tex | 107 ++++++++++++++++++ registration/views.py | 3 + 4 files changed, 118 insertions(+) create mode 100644 registration/templates/registration/tex/photo_authorization_eteam_child.tex diff --git a/participation/forms.py b/participation/forms.py index caec0c2..b14e1e1 100644 --- a/participation/forms.py +++ b/participation/forms.py @@ -75,6 +75,12 @@ class ParticipationForm(forms.ModelForm): """ Form to update the problem of a team participation. """ + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + if settings.TFJM_APP == "ETEAM": + # One single tournament only + del self.fields['tournament'] + class Meta: model = Participation fields = ('tournament', 'final',) diff --git a/participation/signals.py b/participation/signals.py index db5ebec..8c621ed 100644 --- a/participation/signals.py +++ b/participation/signals.py @@ -15,6 +15,8 @@ def create_team_participation(instance, created, raw, **_): """ if not raw: participation = Participation.objects.get_or_create(team=instance)[0] + if settings.TFJM_APP == "ETEAM": + participation.tournament = Tournament.objects.first() participation.save() if not created: participation.team.create_mailing_list() diff --git a/registration/templates/registration/tex/photo_authorization_eteam_child.tex b/registration/templates/registration/tex/photo_authorization_eteam_child.tex new file mode 100644 index 0000000..e00114e --- /dev/null +++ b/registration/templates/registration/tex/photo_authorization_eteam_child.tex @@ -0,0 +1,107 @@ +\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{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} diff --git a/registration/views.py b/registration/views.py index df27f6e..9d1a7d7 100644 --- a/registration/views.py +++ b/registration/views.py @@ -436,6 +436,9 @@ class AuthorizationTemplateView(TemplateView): if not Tournament.objects.filter(name__iexact=self.request.GET.get("tournament_name")).exists(): raise PermissionDenied("Ce tournoi n'existe pas.") context["tournament"] = Tournament.objects.get(name__iexact=self.request.GET.get("tournament_name")) + elif settings.TFJM_APP == "ETEAM": + # One single tournament + context["tournament"] = Tournament.objects.first() else: raise PermissionDenied("Merci d'indiquer un tournoi.")