Skip to content

Commit

Permalink
Merge pull request #4381 from magfest/config-emergency-procedures
Browse files Browse the repository at this point in the history
Add temporarily disabling of emergency procedures
  • Loading branch information
kitsuta committed Jun 14, 2024
2 parents a04f4a5 + 01f01bb commit 1827cfd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
10 changes: 8 additions & 2 deletions uber/configspec.ini
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ shiftless_depts = string_list(default=list())
# signed up for in order to receive a specific perk. If any of these is set to 0,
# that perk is turned off for the event.

# Volunteers with Staff badges always get a staff shirt as long as this is more than 0
# If shirts_per_staffer is set to 0 and this is not set to 0, staff get the same shirt
# that volunteers get. Otherwise, they get separate staff shirts with separate sizes.
hours_for_shirt = integer(default=6)

# Access to staff suite and/or tea room
Expand Down Expand Up @@ -426,7 +427,7 @@ out_of_shirts = boolean(default=False)

# This is the number of staff shirts that each staffer gets.
# You can populate [[staff_event_shirt]] to allow staff to choose to
# replace 1 or more of their staff shirts with event shirts
# replace 1 or more of their staff shirts with event shirts.
#
# Staff shirts are for wearing on-shift. Use hours_for_shirt
# to grant staff and volunteers an event shirt instead.
Expand Down Expand Up @@ -489,6 +490,11 @@ volunteer_agreement_enabled = boolean(default=False)
# Much like the volunteer agreement, but for an emergency procedures document.
emergency_procedures_enabled = boolean(default=False)

# Emergency procedures documents might not always be ready when the volunteer
# checklist opens. When this is turned off, the link is removed from the step
# and the deadline is replaced with "Coming Soon!"
emergency_procedures_ready = boolean(default=False)

# This controls whether we ask volunteers to provide a name for a credits roll.
volunteer_credits_roll = boolean(default=False)

Expand Down
8 changes: 4 additions & 4 deletions uber/models/attendee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,12 +1439,12 @@ def paid_for_a_shirt(self):
@property
def num_free_event_shirts(self):
"""
If someone is staff-shirt-eligible, we use the number of event shirts they have selected (if any)
Volunteers also get a free event shirt.
If someone is staff-shirt-eligible, we use the number of event shirts they have selected (if any).
Volunteers also get a free event shirt. Staff get an event shirt if staff shirts are turned off for the event.
Returns: Integer representing the number of free event shirts this attendee should get.
"""
return max(0, self.num_event_shirts) if self.gets_staff_shirt else self.volunteer_event_shirt_eligible
return max(0, self.num_event_shirts) if self.gets_staff_shirt else bool(
self.volunteer_event_shirt_eligible or (self.badge_type == c.STAFF_BADGE and c.HOURS_FOR_SHIRT))

@property
def volunteer_event_shirt_eligible(self):
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/forms/attendee/badge_extras.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<div class="row g-sm-3">
<div class="col-12 col-sm-6">
<div class="form-text">{{ badge_extras.amount_extra.label.text }}</div>
<div class="form-control-plaintext h5">{{ attendee.amount_extra_label }}{% if c.AVAILABLE_MERCH_TIERS and attendee.amount_extra < c.AVAILABLE_MERCH_TIERS[-1] %}{{ macros.upgrade_button('amount-extra', text="Purchase Merch" if attendee.amount_extra == 0 else "Upgrade") }}{% endif %}</div>
<div class="form-control-plaintext h5">{{ attendee.amount_extra_label or "None" }}{% if c.AVAILABLE_MERCH_TIERS and attendee.amount_extra < c.AVAILABLE_MERCH_TIERS[-1] %}{{ macros.upgrade_button('amount-extra', text="Purchase Merch" if attendee.amount_extra == 0 else "Upgrade") }}{% endif %}</div>
</div>
</div>
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions uber/templates/staffing/emergency_procedures_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<li>
{{ macros.checklist_image(attendee.reviewed_emergency_procedures) }}
{% if not attendee.reviewed_emergency_procedures %}
Please review
Please review our
{% else %}
You have acknowledged that you reviewed our
{% endif %}
{% if not attendee.placeholder and (attendee.agreed_to_volunteer_agreement or not c.VOLUNTEER_AGREEMENT_ENABLED) %}<a href="emergency_procedures">Emergency Procedures</a>{% else %}Emergency Procedures{% endif %}
{% if c.EMERGENCY_PROCEDURES_READY and not attendee.placeholder and (attendee.agreed_to_volunteer_agreement or not c.VOLUNTEER_AGREEMENT_ENABLED) %}<a href="emergency_procedures">Emergency Procedures</a>{% else %}Emergency Procedures{% endif %}
{% if not attendee.reviewed_emergency_procedures %} and acknowledge that you have done so{% endif %}.
(Deadline: {{ c.EMERGENCY_PROCEDURES_DEADLINE }})
{% if c.EMERGENCY_PROCEDURES_READY %}(Deadline: {{ c.EMERGENCY_PROCEDURES_DEADLINE }}){% else %}(Coming Soon!){% endif %}
</li>
{% endif %}

0 comments on commit 1827cfd

Please sign in to comment.