Skip to content

Commit

Permalink
Add ability accessibility and photo questions
Browse files Browse the repository at this point in the history
  • Loading branch information
ericli18 committed Nov 20, 2024
1 parent 2f604a2 commit c92485b
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 11 deletions.
3 changes: 2 additions & 1 deletion hiss/application/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class ApplicationAdmin(admin.ModelAdmin):
# ("dietary_restrictions", ChoiceDropdownFilter),
("shirt_size", ChoiceDropdownFilter),
("datetime_submitted", DateRangeFilter),
("accessibility_requirements", ChoiceDropdownFilter),
RaceFilter,
)
list_display = (
Expand Down Expand Up @@ -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;"})}
Expand Down
24 changes: 16 additions & 8 deletions hiss/application/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand All @@ -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 <a href="https://static.mlh.io/docs/mlh-code-of-conduct.pdf">MLH Code of Conduct</a>'
)
Expand All @@ -255,10 +262,7 @@ def __init__(self, *args, **kwargs):
' and the <a href="https://mlh.io/privacy">MLH Privacy Policy</a>'
)

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)

Expand Down Expand Up @@ -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': '[email protected]'}),
"tamu_email": forms.EmailInput(attrs={"placeholder": "[email protected]"}),
"extra_links": forms.TextInput(
attrs={
"placeholder": "ex. GitHub, Devpost, personal website, LinkedIn, etc."
Expand Down Expand Up @@ -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",
Expand Down
23 changes: 23 additions & 0 deletions hiss/application/migrations/0026_auto_20241119_1945.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
7 changes: 7 additions & 0 deletions hiss/application/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 11 additions & 0 deletions hiss/create_application_application.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

9 changes: 7 additions & 2 deletions hiss/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down

0 comments on commit c92485b

Please sign in to comment.