Add housing constraints field, see #25

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-01-16 22:26:00 +01:00
parent e031e143c2
commit c5a8581a80
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
5 changed files with 277 additions and 209 deletions

File diff suppressed because it is too large Load Diff

View File

@ -107,8 +107,8 @@ class StudentRegistrationForm(forms.ModelForm):
class Meta: class Meta:
model = StudentRegistration model = StudentRegistration
fields = ('team', 'student_class', 'birth_date', 'gender', 'address', 'zip_code', 'city', 'phone_number', fields = ('team', 'student_class', 'birth_date', 'gender', 'address', 'zip_code', 'city', 'phone_number',
'health_issues', 'school', 'responsible_name', 'responsible_phone', 'responsible_email', 'school', 'health_issues', 'housing_constraints', 'responsible_name', 'responsible_phone',
'give_contact_to_animath', 'email_confirmed',) 'responsible_email', 'give_contact_to_animath', 'email_confirmed',)
class PhotoAuthorizationForm(forms.ModelForm): class PhotoAuthorizationForm(forms.ModelForm):
@ -205,8 +205,9 @@ class CoachRegistrationForm(forms.ModelForm):
""" """
class Meta: class Meta:
model = CoachRegistration model = CoachRegistration
fields = ('team', 'gender', 'address', 'zip_code', 'city', 'phone_number', 'health_issues', fields = ('team', 'gender', 'address', 'zip_code', 'city', 'phone_number',
'professional_activity', 'give_contact_to_animath', 'email_confirmed',) 'professional_activity', 'health_issues', 'housing_constraints',
'give_contact_to_animath', 'email_confirmed',)
class VolunteerRegistrationForm(forms.ModelForm): class VolunteerRegistrationForm(forms.ModelForm):

View File

@ -0,0 +1,30 @@
# Generated by Django 5.0.1 on 2024-01-16 21:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("registration", "0008_alter_payment_valid"),
]
operations = [
migrations.AddField(
model_name="participantregistration",
name="housing_constraints",
field=models.TextField(
blank=True,
help_text="You can fill in something here if you have any housing constraints, e.g. medical problems, scheduling issues, gender issues, or anything else you feel is relevant to the organizers. Leave empty if you have nothing specific to declare.",
verbose_name="housing constraints",
),
),
migrations.AlterField(
model_name="participantregistration",
name="health_issues",
field=models.TextField(
blank=True,
help_text="You can indicate here your allergies or anything that is important to know for organizers.",
verbose_name="health issues",
),
),
]

View File

@ -157,7 +157,16 @@ class ParticipantRegistration(Registration):
health_issues = models.TextField( health_issues = models.TextField(
verbose_name=_("health issues"), verbose_name=_("health issues"),
blank=True, blank=True,
help_text=_("You can indicate here your allergies or anything that is important to know for organizers"), help_text=_("You can indicate here your allergies or anything that is important to know for organizers."),
)
housing_constraints = models.TextField(
verbose_name=_("housing constraints"),
blank=True,
help_text=_("You can fill in something here if you have any housing constraints, "
"e.g. medical problems, scheduling issues, gender issues, "
"or anything else you feel is relevant to the organizers. "
"Leave empty if you have nothing specific to declare."),
) )
photo_authorization = models.FileField( photo_authorization = models.FileField(

View File

@ -53,8 +53,15 @@
<dt class="col-sm-6 text-end">{% trans "Phone number:" %}</dt> <dt class="col-sm-6 text-end">{% trans "Phone number:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.phone_number }}</dd> <dd class="col-sm-6">{{ user_object.registration.phone_number }}</dd>
<dt class="col-sm-6 text-end">{% trans "Health issues:" %}</dt> {% if user_object.registration.health_issues %}
<dd class="col-sm-6">{{ user_object.registration.health_issues|default:any }}</dd> <dt class="col-sm-6 text-end">{% trans "Health issues:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.health_issues }}</dd>
{% endif %}
{% if user_object.registration.housing_constraints %}
<dt class="col-sm-6 text-end">{% trans "Housing constraints:" %}</dt>
<dd class="col-sm-6">{{ user_object.registration.housing_constraints }}</dd>
{% endif %}
<dt class="col-sm-6 text-end">{% trans "Photo authorization:" %}</dt> <dt class="col-sm-6 text-end">{% trans "Photo authorization:" %}</dt>
<dd class="col-sm-6"> <dd class="col-sm-6">