From 77e7eb106f6bff6330cf9e4c8040259c5aa58029 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Tue, 26 Mar 2024 21:53:19 -0400 Subject: [PATCH] Add custom staffing checkbox label Changes the label for the staffing checkbox for people who don't have any assigned departments to tell them that there's a waiting list. --- magstock/forms.py | 7 ++++- .../forms/attendee/staffing_info.html | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 magstock/templates/forms/attendee/staffing_info.html diff --git a/magstock/forms.py b/magstock/forms.py index bf3555c..1b27daf 100644 --- a/magstock/forms.py +++ b/magstock/forms.py @@ -114,4 +114,9 @@ class PreregOtherInfo: waiver_signature = Consents.waiver_signature waiver_date_display = Consents.waiver_date_display waiver_date = Consents.waiver_date - waiver_consent = Consents.waiver_consent \ No newline at end of file + waiver_consent = Consents.waiver_consent + + def staffing_label(self): + return ("We already have enough volunteers to run MAGStock this year. If you'd like to be added " + "to our waitlist, click here and indicate your areas of interest. If we can accommodate more " + "volunteers, Staffing Operations will reach out to you in mid-May") \ No newline at end of file diff --git a/magstock/templates/forms/attendee/staffing_info.html b/magstock/templates/forms/attendee/staffing_info.html new file mode 100644 index 0000000..e56b339 --- /dev/null +++ b/magstock/templates/forms/attendee/staffing_info.html @@ -0,0 +1,26 @@ +{% extends 'uber/templates/forms/attendee/staffing_info.html' %} + +{% block staffing %} +{% set staffing_message = "" %} +{% set label_text = "" %} +{% if not admin_area %} + {% if attendee.badge_type in [c.CONTRACTOR_BADGE, c.STAFF_BADGE] %} + {% set staffing_message = "This checkbox is required for Contractors, Volunteers, and Staff. Please contact Staffing Operations if you wish to change your status." %} + {% elif attendee.shifts %} + {% set staffing_message = "Please " ~ 'see Staffing Operations to change your volunteer status.' if c.AT_THE_CON else 'unassign yourself from shifts before changing your volunteer status.' %} + {% endif %} + {% if not attendee.assigned_depts %} + {% set label_text = "We already have enough volunteers to run MAGStock this year. If you'd like to be added to our waitlist, click here and indicate your areas of interest. If we can accommodate more volunteers, Staffing Operations will reach out to you in mid-May." %} + {% endif %} +{% endif %} +
+
{{ form_macros.toggle_checkbox(staffing_info.staffing, + [staffing_info.requested_depts_ids], toggle_required=True, label_text=label_text, help_text=staffing_message) }}
+
+ +{% if c.PUBLIC_DEPARTMENT_OPTS_WITH_DESC|length > 1 %} +
+
{{ form_macros.form_input(staffing_info.requested_depts_ids) }}
+
+{% endif %} +{% endblock %} \ No newline at end of file