Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application form - All tentative changes #14

Merged
merged 33 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5535bea
test changes
carmen-chau Sep 9, 2024
dc21b8d
deleted migration file
carmen-chau Sep 11, 2024
1e9cd60
added new pronoun choices, reformatted error checking
carmen-chau Sep 11, 2024
21cd283
merging develop changes
carmen-chau Sep 11, 2024
8e3dba8
black format changes
carmen-chau Sep 11, 2024
3e4eae3
reverting landing.html changes
carmen-chau Sep 11, 2024
dea8880
added gender field
carmen-chau Sep 14, 2024
bd68815
removed ethnicity
carmen-chau Sep 14, 2024
f81136a
added tshirt size
carmen-chau Sep 14, 2024
856ea3c
added dietary restriction, made ethnicity changes
carmen-chau Sep 14, 2024
617ef95
black changes
carmen-chau Sep 14, 2024
8a5c3c6
black.... again?
carmen-chau Sep 14, 2024
436d9ba
attempting to fix black problems
carmen-chau Sep 14, 2024
1a53d30
deleting dummy comment
carmen-chau Sep 14, 2024
a26888d
i hope this black fix works
carmen-chau Sep 14, 2024
89b3b7c
added under-represented group question
carmen-chau Sep 15, 2024
07f4328
added sexual identity:
carmen-chau Sep 15, 2024
88bee13
added highest former education
carmen-chau Sep 15, 2024
a824698
fixed typo
carmen-chau Sep 15, 2024
7d3aea8
reduced options for curr education
carmen-chau Sep 17, 2024
803c2f2
added how many hackathons field
carmen-chau Sep 20, 2024
a6cfa80
black changes
carmen-chau Sep 20, 2024
93e8d43
added new hackathon question, modified ethnicity field
carmen-chau Sep 21, 2024
75d87c7
modified technical experience question
carmen-chau Sep 21, 2024
443b803
changed what past experience field
carmen-chau Sep 21, 2024
5d07d0f
added team role question
carmen-chau Sep 21, 2024
046f4e6
added discover method, made word count bigger for personal info
carmen-chau Sep 21, 2024
c31d843
removed comments
carmen-chau Sep 25, 2024
c46529b
more comment deletion
carmen-chau Sep 25, 2024
4d8d3eb
removing more comments
carmen-chau Sep 25, 2024
b40f019
remove comments
carmen-chau Sep 25, 2024
b2bacfc
remove comments
carmen-chau Sep 25, 2024
ce0f9c3
removed ethnicity comment
carmen-chau Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hackathon_site/event/jinja2/event/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,4 @@ <h3 class="row center">Contact Us</h3>

{% block scripts %}
<script src="{{ static('event/js/landing.js') }}"></script>
{% endblock %}
{% endblock %}
129 changes: 124 additions & 5 deletions hackathon_site/registration/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,21 @@ class Meta:
fields = [
"age",
"pronouns",
"ethnicity",
"free_response_pronouns",
"gender",
"free_response_gender",
# "ethnicity",
"phone_number",
"city",
"country",
"tshirt_size",
"dietary_restrictions",
"free_response_dietary_restrictions",
"under_represented_group",
"sexual_identity",
"free_response_sexual_identity",
"highest_formal_education",
"free_response_highest_formal_education",
"school",
"study_level",
"graduation_year",
Expand All @@ -134,9 +145,13 @@ class Meta:
"linkedin",
"github",
"devpost",
"how_many_hackathons",
"past_hackathon_info",
"what_past_experience",
"why_participate",
"what_technical_experience",
"what_past_experience",
"what_role_in_team_setting",
"discovery_method",
"conduct_agree",
"logistics_agree",
"email_agree",
Expand All @@ -149,6 +164,36 @@ class Meta:
choices=((None, ""),),
),
"resume": MaterialFileInput(),
"free_response_pronouns": forms.Textarea(
attrs={"class": "materialize-textarea", "data-length": 200}
),
"free_response_gender": forms.Textarea(
attrs={"class": "materialize-textarea", "data-length": 200}
),
"free_response_sexual_identity": forms.Textarea(
attrs={"class": "materialize-textarea", "data-length": 200}
),
"free_response_dietary_restrictions": forms.Textarea(
attrs={"class": "materialize-textarea", "data-length": 200}
),
"free_response_highest_formal_education": forms.Textarea(
attrs={"class": "materialize-textarea", "data-length": 200}
),
"past_hackathon_info": forms.Textarea(
attrs={
"class": "materialize-textarea",
"placeholder": "Insert past hackathon description here...",
"data-length": 1000,
}
),
"what_past_experience": forms.Textarea(
attrs={
"class": "materialize-textarea",
"placeholder": "Insert answer here...",
"data-length": 1000,
"style": "padding-top: 38px;",
}
),
"why_participate": forms.Textarea(
attrs={
"class": "materialize-textarea",
Expand All @@ -159,14 +204,14 @@ class Meta:
"what_technical_experience": forms.Textarea(
attrs={
"class": "materialize-textarea",
"placeholder": "My technical experience with software are...",
"placeholder": "My technical experience with software and hardware are...",
"data-length": 1000,
}
),
"what_past_experience": forms.Textarea(
"what_role_in_team_setting": forms.Textarea(
attrs={
"class": "materialize-textarea",
"placeholder": "My past experiences are...",
"placeholder": "I take on the role of...",
"data-length": 1000,
}
),
Expand All @@ -192,6 +237,12 @@ def clean(self):
raise forms.ValidationError(
_("User has already submitted an application."), code="invalid"
)
self.clean_age()
self.handle_free_response_pronouns()
self.handle_free_response_gender()
self.handle_free_response_sexual_identity()
self.handle_free_response_dietary_restrictions()
self.handle_highest_formal_education()
return cleaned_data

def clean_age(self):
Expand All @@ -206,6 +257,74 @@ def clean_age(self):
)
return user_age

def handle_free_response_pronouns(self):
user_pronouns = self.cleaned_data["pronouns"]
user_free_response_pronouns = self.cleaned_data["free_response_pronouns"]
if user_pronouns == "other" and not user_free_response_pronouns:
raise forms.ValidationError(
_(
"Since you've selected 'Other' for pronouns, please state what pronouns you go by."
),
code="free_response_pronouns",
)

def handle_free_response_gender(self):
user_gender = self.cleaned_data["gender"]
user_free_response_gender = self.cleaned_data["free_response_gender"]
if user_gender == "prefer-to-self-describe" and not user_free_response_gender:
raise forms.ValidationError(
_(
"Since you've selected 'Prefer to Self Describe' for gender, please state how you would like to be addressed"
),
code="free_response_gender",
)

def handle_free_response_dietary_restrictions(self):
user_dietary_restrictions = self.cleaned_data["dietary_restrictions"]
user_free_response_dietary_restrictions = self.cleaned_data[
"free_response_dietary_restrictions"
]
if (
user_dietary_restrictions == "allergies"
or user_dietary_restrictions == "other"
) and not user_free_response_dietary_restrictions:
raise forms.ValidationError(
_("Please provide more information about your dietary restrictions."),
code="free_response_dietary_restrictions",
)

def handle_free_response_sexual_identity(self):
user_sexual_identity = self.cleaned_data["sexual_identity"]
user_free_response_sexual_identity = self.cleaned_data[
"free_response_sexual_identity"
]
if (
user_sexual_identity == "different-identity"
and not user_free_response_sexual_identity
):
raise forms.ValidationError(
_(
"You've selected 'Different Identity', please state how you would like to identify yourself"
),
code="free_response_sexual_identity",
)

def handle_highest_formal_education(self):
user_highest_formal_education = self.cleaned_data["highest_formal_education"]
user_free_response_highest_formal_education = self.cleaned_data[
"free_response_highest_formal_education"
]
if (
user_highest_formal_education == "other"
and not user_free_response_highest_formal_education
):
raise forms.ValidationError(
_(
"You've selected 'Other' for highest formal education, please elaborate in the corresponding field."
),
code="free_response_highest_formal_education",
)

def save(self, commit=True):
self.instance = super().save(commit=False)
team = Team.objects.create()
Expand Down
29 changes: 23 additions & 6 deletions hackathon_site/registration/jinja2/registration/application.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,26 @@ <h4>Personal Information</h4>
{{ render_field(form.age, size="s12 m6 select2-wrapper") }}
{{ render_field(form.phone_number, size="s12 m6") }}
{{ render_field(form.pronouns, size="s12 m6 select2-wrapper") }}
{{ render_field(form.ethnicity, size="s12 m6 select2-wrapper") }}
{{ render_field(form.free_response_pronouns, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.gender, size="s12 m6 select2-wrapper") }}
{{ render_field(form.free_response_gender, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.sexual_identity, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.free_response_sexual_identity, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{# {{ render_field(form.ethnicity, size="s12 m6 select2-wrapper") }}#}
{{ render_field(form.city, size="s12 m6 select2-wrapper added-country-margin formAddTopMargin") }}
{{ render_field(form.country, size="s12 m6 select2-wrapper added-country-margin formAddTopMargin") }}
{{ render_field(form.tshirt_size, size="s12 m6 select2-wrapper") }}
{{ render_field(form.under_represented_group, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.dietary_restrictions, size="s12 m6 select2-wrapper") }}
{{ render_field(form.free_response_dietary_restrictions, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.highest_formal_education, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.free_response_highest_formal_education, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}

<div class="col s12">
<h4>Education</h4>
</div>
{{ render_field(form.school, size="s12 m6 select2-wrapper") }}
{{ render_field(form.study_level, size="s12 m6 select2-wrapper") }}
{{ render_field(form.study_level, show_help_text_as_label=True, size="s12 m6 select2-wrapper") }}
{{ render_field(form.graduation_year, size="s12 m6 select2-wrapper") }}
{{ render_field(form.program, size="s12 m6 select2-wrapper", show_help_text_as_label=True) }}

Expand All @@ -61,9 +72,13 @@ <h4>Online Profiles</h4>
<div class="col s12">
<h4>Questions</h4>
</div>
{{ render_field(form.how_many_hackathons, show_help_text_as_label=True, size="s12 select2-wrapper") }}
{{ render_field(form.past_hackathon_info, show_help_text_as_label=True) }}
{{ render_field(form.what_past_experience, show_help_text_as_label=True) }}
{{ render_field(form.why_participate, show_help_text_as_label=True) }}
{{ render_field(form.what_technical_experience, show_help_text_as_label=True) }}
{{ render_field(form.what_past_experience, show_help_text_as_label=True) }}
{{ render_field(form.what_role_in_team_setting, show_help_text_as_label=True) }}
{{ render_field(form.discovery_method, show_help_text_as_label=True, size="s12 select2-wrapper") }}

<div class="col s12">
<p>We are currently in the process of partnering with MLH. The following 3 checkboxes are for this partnership. If we do not end up partnering with MLH, your information will not be shared.</p>
Expand All @@ -78,10 +93,11 @@ <h4>Questions</h4>

{% block form_button %}
<div class="input-field col s12 center" style="margin-bottom: 0">
<p>You cannot edit this afterwards!</p>
<p>Please note: After submission, you will no longer be able to edit your answers!</p>
<br/>
<p>At present, this submission is intended for preregistration. Rest assured, we will notify you via email as soon as official registration becomes available.
</p>
<p>For the long answer questions, we recommended writing your answer in a separate document first, then pasting it into the form.</p>
{# <p>At present, this submission is intended for preregistration. Rest assured, we will notify you via email as soon as official registration becomes available.#}
{# </p>#}
<br/>
<button type="submit" class="btn-small waves-effect waves-light colorBtn">Submit</button>
</div>
Expand Down Expand Up @@ -127,6 +143,7 @@ <h4>Questions</h4>
e.stopPropagation();
});
});
$("#id_free_response_pronouns, #id_free_response_gender, #id_free_response_sexual_identity, #id_free_response_dietary_restrictions, #id_free_response_highest_formal_education, #id_what_role_in_team_setting, #id_past_hackathon_info, #id_what_hackathon_experience, #id_why_participate, #id_what_technical_experience").characterCounter(); // TODO: TEMPORARY LINE

// on first focus (bubbles up to document), open the menu
// https://stackoverflow.com/a/49261426/3882202
Expand Down
Loading
Loading