diff --git a/apps/participation/templates/participation/team_detail.html b/apps/participation/templates/participation/team_detail.html index 231ecbf..03dc45f 100644 --- a/apps/participation/templates/participation/team_detail.html +++ b/apps/participation/templates/participation/team_detail.html @@ -62,11 +62,13 @@
{% trans "Health sheets:" %}
- {% for participant in team.participants.all %} - {% if participant.health_sheet %} - {{ participant }}{% if not forloop.last %},{% endif %} - {% else %} - {{ participant }} ({% trans "Not uploaded yet" %}){% if not forloop.last %},{% endif %} + {% for student in team.students.all %} + {% if student.under_18 %} + {% if student.health_sheet %} + {{ student }}{% if not forloop.last %},{% endif %} + {% else %} + {{ student }} ({% trans "Not uploaded yet" %}){% if not forloop.last %},{% endif %} + {% endif %} {% endif %} {% endfor %}
diff --git a/apps/participation/views.py b/apps/participation/views.py index 5b3da16..9e31f77 100644 --- a/apps/participation/views.py +++ b/apps/participation/views.py @@ -177,7 +177,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView) context["can_validate"] = team.students.count() >= 4 and team.coaches.exists() and \ all(r.email_confirmed for r in team.students.all()) and \ all(r.photo_authorization for r in team.participants.all()) and \ - all(r.health_sheet for r in team.participants.all()) and \ + all(r.health_sheet for r in team.students.all() if r.under_18) and \ all(r.parental_authorization for r in team.students.all() if r.under_18) return context diff --git a/apps/registration/migrations/0004_auto_20210121_2153.py b/apps/registration/migrations/0004_auto_20210121_2153.py new file mode 100644 index 0000000..bdb2728 --- /dev/null +++ b/apps/registration/migrations/0004_auto_20210121_2153.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.11 on 2021-01-21 20:53 + +from django.db import migrations, models +import registration.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('registration', '0003_auto_20210118_1738'), + ] + + operations = [ + migrations.RemoveField( + model_name='participantregistration', + name='health_sheet', + ), + migrations.AddField( + model_name='studentregistration', + name='health_sheet', + field=models.FileField(blank=True, default='', upload_to=registration.models.get_random_health_filename, verbose_name='health sheet'), + ), + ] diff --git a/apps/registration/models.py b/apps/registration/models.py index 42ec201..4cf4416 100644 --- a/apps/registration/models.py +++ b/apps/registration/models.py @@ -146,13 +146,6 @@ class ParticipantRegistration(Registration): default="", ) - health_sheet = models.FileField( - verbose_name=_("health sheet"), - upload_to=get_random_health_filename, - blank=True, - default="", - ) - @property def under_18(self): return (timezone.now().date() - self.birth_date).days < 18 * 365.24 @@ -208,6 +201,13 @@ class StudentRegistration(ParticipantRegistration): default="", ) + health_sheet = models.FileField( + verbose_name=_("health sheet"), + upload_to=get_random_health_filename, + blank=True, + default="", + ) + @property def type(self): return _("student") diff --git a/apps/registration/templates/registration/tex/Autorisation_droit_image_majeur.tex b/apps/registration/templates/registration/tex/Autorisation_droit_image_majeur.tex index 150144a..d1934fe 100644 --- a/apps/registration/templates/registration/tex/Autorisation_droit_image_majeur.tex +++ b/apps/registration/templates/registration/tex/Autorisation_droit_image_majeur.tex @@ -106,7 +106,7 @@ Signature pr\'ec\'ed\'ee de la mention \og lu et approuv\'e \fg{} \begin{minipage}[c]{0.5\textwidth} -\underline{L'\'el\`eve :}\\ +\underline{Le participant :}\\ Fait \`a :\\ le diff --git a/apps/registration/templates/registration/user_detail.html b/apps/registration/templates/registration/user_detail.html index 28df841..cdc6017 100644 --- a/apps/registration/templates/registration/user_detail.html +++ b/apps/registration/templates/registration/user_detail.html @@ -57,20 +57,20 @@ {% endif %} - -
{% trans "Health sheet:" %}
-
- {% if user_object.registration.health_sheet %} - {% trans "Download" %} - {% endif %} - {% if user_object.registration.team and not user_object.registration.team.participation.valid %} - - {% endif %} -
{% endif %} {% if user_object.registration.studentregistration %} {% if user_object.registration.under_18 %} +
{% trans "Health sheet:" %}
+
+ {% if user_object.registration.health_sheet %} + {% trans "Download" %} + {% endif %} + {% if user_object.registration.team and not user_object.registration.team.participation.valid %} + + {% endif %} +
+
{% trans "Parental authorization:" %}
{% if user_object.registration.parental_authorization %} diff --git a/apps/registration/urls.py b/apps/registration/urls.py index 2a3df92..d0314cd 100644 --- a/apps/registration/urls.py +++ b/apps/registration/urls.py @@ -30,7 +30,7 @@ urlpatterns = [ path("photo-authorization-template/child/", ChildPhotoAuthorizationTemplateView.as_view(), name="photo_authorization_child_template"), path("instructions-template/", InstructionsTemplateView.as_view(), name="instructions_template"), - path("user//upload-health_sheet/", UserUploadHealthSheetView.as_view(), + path("user//upload-health-sheet/", UserUploadHealthSheetView.as_view(), name="upload_user_health_sheet"), path("user//upload-parental-authorization/", UserUploadParentalAuthorizationView.as_view(), name="upload_user_parental_authorization"), diff --git a/tfjm/static/Fiche_sanitaire.pdf b/tfjm/static/Fiche_sanitaire.pdf index b828b9d..c4f8c7e 100644 Binary files a/tfjm/static/Fiche_sanitaire.pdf and b/tfjm/static/Fiche_sanitaire.pdf differ