From c92485b81686cf9fadde0d3d1dd39d8321f6f43d Mon Sep 17 00:00:00 2001 From: Eric Li Date: Tue, 19 Nov 2024 20:10:42 -0600 Subject: [PATCH] Add ability accessibility and photo questions --- hiss/application/admin.py | 3 ++- hiss/application/forms.py | 24 ++++++++++++------- .../migrations/0026_auto_20241119_1945.py | 23 ++++++++++++++++++ hiss/application/models.py | 7 ++++++ hiss/create_application_application.sql | 11 +++++++++ hiss/static/style.css | 9 +++++-- 6 files changed, 66 insertions(+), 11 deletions(-) create mode 100644 hiss/application/migrations/0026_auto_20241119_1945.py diff --git a/hiss/application/admin.py b/hiss/application/admin.py index 4d73696c..ebca4f0a 100644 --- a/hiss/application/admin.py +++ b/hiss/application/admin.py @@ -211,6 +211,7 @@ class ApplicationAdmin(admin.ModelAdmin): # ("dietary_restrictions", ChoiceDropdownFilter), ("shirt_size", ChoiceDropdownFilter), ("datetime_submitted", DateRangeFilter), + ("accessibility_requirements", ChoiceDropdownFilter), RaceFilter, ) list_display = ( @@ -283,7 +284,7 @@ class ApplicationAdmin(admin.ModelAdmin): }, ), ("Confirmation Deadline", {"fields": ["confirmation_deadline"]}), - ("Miscellaneous", {"fields": ["notes", "is_adult"]}), + ("Miscellaneous", {"fields": ["notes", "is_adult", "accessibility_requirements"]}), ] formfield_overrides = { AddressField: {"widget": AddressWidget(attrs={"style": "width: 300px;"})} diff --git a/hiss/application/forms.py b/hiss/application/forms.py index 387ed8e3..a5a5d1c7 100644 --- a/hiss/application/forms.py +++ b/hiss/application/forms.py @@ -186,7 +186,7 @@ class ApplicationModelForm(forms.ModelForm): (TENSORFLOW, "Tensorflow"), (PYTORCH, "PyTorch"), (FLUTTER, "Flutter"), - (REACT_NATIVE, "React Native") + (REACT_NATIVE, "React Native"), ) # SKILLS technology_experience = forms.MultipleChoiceField( @@ -215,9 +215,9 @@ class ApplicationModelForm(forms.ModelForm): (KOSHER, "Kosher"), (GLUTEN_FREE, "Gluten-Free"), (FOOD_ALLERGY, "Food Allergy"), - (OTHER_DIETARY_RESTRICTION, "Other") + (OTHER_DIETARY_RESTRICTION, "Other"), ) - + dietary_restrictions = forms.MultipleChoiceField( label="Do you have any dietary restrictions?", help_text="Select all that apply", @@ -242,6 +242,13 @@ def __init__(self, *args, **kwargs): } super().__init__(*args, **kwargs) + + photo_agreement = "Do you grant permission for TAMUhack to use your name, likeness, voice, and any photographs, video recordings, or audio recordings taken during the event 'TAMUhack 2025' for promotional and media purposes, including but not limited to publications, websites, social media, and press releases?" + accessibilities = "Please check this box if you require any accommodations to ensure accessibility during this event. Our team will follow up to discuss your needs." + + self.fields["agree_to_photos"].label = mark_safe(photo_agreement) + self.fields["accessibility_requirements"].label = mark_safe(accessibilities) + self.fields["agree_to_coc"].label = mark_safe( 'I agree to the MLH Code of Conduct' ) @@ -255,10 +262,7 @@ def __init__(self, *args, **kwargs): ' and the MLH Privacy Policy' ) - mlh_newsletter = ( - "I authorize MLH to send me occasional emails about relevant events, career opportunities, and community announcements." - ) - + mlh_newsletter = "I authorize MLH to send me occasional emails about relevant events, career opportunities, and community announcements." self.fields["agree_to_mlh_stuff"].label = mark_safe(mlh_stuff) self.fields["signup_to_mlh_newsletter"].label = mark_safe(mlh_newsletter) @@ -312,8 +316,10 @@ class Meta: "agree_to_coc": forms.CheckboxInput, "agree_to_mlh_stuff": forms.CheckboxInput, "signup_to_mlh_newsletter": forms.CheckboxInput, + "agree_to_photos": forms.CheckboxInput, + "accessibility_requirements": forms.CheckboxInput, "travel_reimbursement": forms.CheckboxInput, - 'tamu_email': forms.EmailInput(attrs={'placeholder': 'netid@tamu.edu'}), + "tamu_email": forms.EmailInput(attrs={"placeholder": "netid@tamu.edu"}), "extra_links": forms.TextInput( attrs={ "placeholder": "ex. GitHub, Devpost, personal website, LinkedIn, etc." @@ -358,6 +364,8 @@ class Meta: "emergency_contact_phone", "emergency_contact_email", "notes", + "agree_to_photos", + "accessibility_requirements", "agree_to_coc", "agree_to_mlh_stuff", "signup_to_mlh_newsletter", diff --git a/hiss/application/migrations/0026_auto_20241119_1945.py b/hiss/application/migrations/0026_auto_20241119_1945.py new file mode 100644 index 00000000..406d451a --- /dev/null +++ b/hiss/application/migrations/0026_auto_20241119_1945.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.13 on 2024-11-20 01:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('application', '0025_auto_20241024_1250'), + ] + + operations = [ + migrations.AddField( + model_name='application', + name='accessibility_requirements', + field=models.BooleanField(blank=True, choices=[(True, 'Agree'), (False, 'Disagree')], default=None, null=True), + ), + migrations.AddField( + model_name='application', + name='agree_to_photos', + field=models.BooleanField(choices=[(True, 'Agree')], default=None, null=True), + ), + ] diff --git a/hiss/application/models.py b/hiss/application/models.py index ff0101e4..df165475 100644 --- a/hiss/application/models.py +++ b/hiss/application/models.py @@ -499,6 +499,13 @@ class Application(models.Model): help_text="Please note that freshmen under 18 must be accompanied by an adult or prove that they go to Texas " "A&M.", ) + + agree_to_photos = models.BooleanField( + choices=AGREE, null=True, default=None + ) + accessibility_requirements = models.BooleanField( + choices=AGREE_DISAGREE, null=True, default=None, blank=True + ) # LOGISTICAL INFO shirt_size = models.CharField( diff --git a/hiss/create_application_application.sql b/hiss/create_application_application.sql index 359c348a..e02b1992 100644 --- a/hiss/create_application_application.sql +++ b/hiss/create_application_application.sql @@ -251,3 +251,14 @@ ALTER TABLE "application_application" ADD COLUMN "wares" varchar(255) DEFAULT '' ALTER TABLE "application_application" ALTER COLUMN "wares" DROP DEFAULT; COMMIT; +-- 0020 +BEGIN; +-- +-- Alter field agree_to_photography on application +-- +-- Alter field accessibility_requirements on application +-- +ALTER TABLE "application_application" ADD COLUMN "agree_to_photography" BOOLEAN NOT NULL DEFAULT FALSE; +ALTER TABLE "application_application" ADD COLUMN "accessibility_requirements" BOOLEAN NOT NULL DEFAULT FALSE; +COMMIT; + diff --git a/hiss/static/style.css b/hiss/static/style.css index 92acbfce..fe8b3a6c 100644 --- a/hiss/static/style.css +++ b/hiss/static/style.css @@ -662,6 +662,8 @@ label[for="id_agree_to_mlh_stuff"], label[for="id_signup_to_mlh_newsletter"], label[for="id_is_adult"], label[for="id_travel_reimbursement"], +label[for="id_agree_to_photos"], +label[for="id_accessibility_requirements"], #id_travel_reimbursement ~ .helptext { margin-left: 45px; } @@ -670,12 +672,15 @@ label[for=id_is_adult] { margin-top: -20px; } -#id_agree_to_mlh_stuff { +#id_agree_to_mlh_stuff, #id_agree_to_photos { top: -100px; } +#id_signup_to_mlh_newsletter, #id_accessibility_requirements { + top: -50px; +} + #id_agree_to_coc, -#id_signup_to_mlh_newsletter, #id_is_adult, #id_travel_reimbursement { top: -30px;