Skip to content

Commit

Permalink
Customize check-in notes
Browse files Browse the repository at this point in the history
Adds the volunteer ribbon note to check-in for Super MAGFest.
  • Loading branch information
kitsuta committed Jan 15, 2024
1 parent 493b1ae commit dd50ace
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
15 changes: 15 additions & 0 deletions magprime/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pockets import classproperty
from pockets.autolog import log
from residue import CoerceUTF8 as UnicodeText, UUID
from markupsafe import Markup

from uber.config import c
from uber.custom_tags import readable_join
Expand Down Expand Up @@ -59,6 +60,20 @@ def accoutrements(self):
stuff = (' with ' if stuff else '') + readable_join(stuff)

return stuff

@property
def check_in_notes(self):
notes = []
if self.age_group_conf['consent_form']:
notes.append("Before checking this attendee in, please collect a signed parental consent form, which must be notarized if the guardian is not there. If the guardian is there, and they have not already completed one, have them sign one in front of you.")

if self.accoutrements:
notes.append(f"Please check this attendee in {self.accoutrements}.")

if c.VOLUNTEER_RIBBON in self.ribbon_ints:
notes.append("Instruct this attendee to go to STOPS for their volunteer ribbon.")

return Markup("<br/><br/>".join(notes))

@presave_adjustment
def set_superstar_ribbon(self):
Expand Down
11 changes: 1 addition & 10 deletions magprime/templates/forms/attendee/check_in_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block badge_info %}
<div class="row g-sm-3">
<div class="col">
{% set badge_display_extra = '' if not attendee.accoutrements else ' (' ~ attendee.accoutrements ~ ')' %}
{% set badge_display_extra = '' if not attendee.accoutrements else ' (' ~ attendee.accoutrements[6:]|replace("a ","") ~ ')' %}
{{ form_macros.form_input(check_in_form.badge_type, hidden_field_text=attendee.badge_type_label ~ badge_display_extra) }}
</div>
{% if c.NUMBERED_BADGES and attendee.badge_num %}
Expand All @@ -18,12 +18,3 @@
{% endif %}
</div>
{% endblock %}

{% block accoutrements %}
{% if attendee.accoutrements or c.VOLUNTEER_RIBBON in attendee.ribbon_ints %}
<div class="alert alert-info">
{% if attendee.accoutrements %}Please check this attendee in {{ attendee.accoutrements }}.{% endif %}{% if c.VOLUNTEER_RIBBON in attendee.ribbon_ints %}
Instruct this attendee to go to STOPS for their volunteer ribbon.{% endif %}
</div>
{% endif %}
{% endblock %}

0 comments on commit dd50ace

Please sign in to comment.