Skip to content

Commit

Permalink
Decouple badge pickup and at-con mode
Browse files Browse the repository at this point in the history
Reg often wants to start badge pickup before we're ready to open at-door badge sales. This takes a lot of pain out of the process by letting us set a different variable to ONLY enable badge pick-up. Also fixes a couple display issues with check-in times.
  • Loading branch information
kitsuta committed Oct 19, 2024
1 parent 4a97427 commit ca01952
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 31 deletions.
8 changes: 6 additions & 2 deletions uber/configspec.ini
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,15 @@ at_door_nopay_msg = string(default="You are already paid (or registered for a fr
at_door_waived_msg = string(default="Since it's so close to the end of the event, your badge is free! Please proceed to the preregistration line to pick it up.")

# There are a huge slew of behaviors which are different before and during the
# event. For example, during the event the registration page actually lets
# admins check people in. This switches between the "during the year" mode and
# event. For example, during the event admins can check people in and one-day badges
# are sold, if they are enabled. This switches between the "during the year" mode and
# the "on-site" mode.
at_the_con = boolean(default=False)

# If you want to ONLY let admins check people in without opening onsite sales or
# any other effects, use this option instead.
badge_pickup_enabled = boolean(default=False)

# This turns on a mix of features which are enabled during OR after the event
# and behaviors such as automated emails which are ONLY turned on afterwards.
post_con = boolean(default=False)
Expand Down
4 changes: 2 additions & 2 deletions uber/models/attendee.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def _misc_adjustments(self):
if self.badge_cost == 0 and self.paid in [c.NOT_PAID, c.PAID_BY_GROUP]:
self.paid = c.NEED_NOT_PAY

if c.AT_THE_CON and self.badge_num and not self.checked_in and self.is_new \
if (c.AT_THE_CON or c.BADGE_PICKUP_ENABLED) and self.badge_num and not self.checked_in and self.is_new \
and self.badge_type not in c.PREASSIGNED_BADGE_TYPES:
self.checked_in = datetime.now(UTC)

Expand Down Expand Up @@ -771,7 +771,7 @@ def cannot_edit_badge_status_reason(self):
return "This badge must be approved by an admin."
if self.badge_status == c.WATCHED_STATUS and not c.HAS_SECURITY_ADMIN_ACCESS:
return "Please escalate this case to someone with access to the watchlist."
if c.AT_THE_CON and not c.HAS_REG_ADMIN_ACCESS:
if (c.AT_THE_CON or c.BADGE_PICKUP_ENABLED) and not c.HAS_REG_ADMIN_ACCESS:
return "Altering the badge status is disabled during the event. The system will update it automatically."
return ''

Expand Down
1 change: 0 additions & 1 deletion uber/site_sections/reg_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def found_how(self, session):
key=lambda s: s.lower())}

@log_pageview
@streamable
def attendee_receipt_discrepancies(self, session, include_pending=False, page=1):
'''
select model_receipt.owner_id
Expand Down
5 changes: 3 additions & 2 deletions uber/site_sections/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def index(self, session, message='', page='0', search_text='', uploaded_id='', o
page = int(page)
if search_text:
page = page or 1
if count == 1 and not c.AT_THE_CON:
if count == 1 and not c.AT_THE_CON and not c.BADGE_PICKUP_ENABLED:
raise HTTPRedirect(
'form?id={}&message={}', attendees.one().id,
'This attendee was the only{} search result'.format('' if invalid else ' valid'))
Expand Down Expand Up @@ -262,7 +262,8 @@ def form(self, session, message='', return_to='', **params):
'index?uploaded_id={}&message={}&search_text={}',
attendee.id,
message,
'{} {}'.format(attendee.first_name, attendee.last_name) if c.AT_THE_CON else '')
'{} {}'.format(attendee.first_name, attendee.last_name
) if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED else '')
receipt = session.refresh_receipt_and_model(attendee)
session.commit()
forms = load_forms(params, attendee, ['PersonalInfo', 'AdminBadgeExtras', 'AdminConsents', 'AdminStaffingInfo',
Expand Down
4 changes: 2 additions & 2 deletions uber/templates/accounts/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% if c.HAS_MERCH_ADMIN_ACCESS and c.AT_THE_CON %}
<div class="col"><a class="btn btn-outline-success" href="../merch_admin/">Merch Pickup</a></div>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
<div class="col ms-auto">
<form method="post" action="../registration/set_reg_station">
<input type="hidden" name="return_to" value="..{{ c.PAGE_PATH }}?{{ c.QUERY_STRING_NO_MSG }}" />
Expand Down Expand Up @@ -43,7 +43,7 @@
<button class="btn btn-outline-secondary attendee-types" id="{{ section }}" onClick="loadViewableAttendees('{{ section }}')">{{ section[:-6]|title }}</button>
{% endfor %}
</div>
{% if c.AT_THE_CON or reg_station_id %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED or reg_station_id %}
<span class="pull-right me-2">Workstation #: {{ reg_station_id|default("None",true) }}
{% if c.BADGE_PRINTING_ENABLED %}
{% set printer_text = "Standard Printer" if workstation_assignment and workstation_assignment.separate_printers else "Printer" %}
Expand Down
4 changes: 2 additions & 2 deletions uber/templates/dept_admin/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ <h3>Members</h3>
{% if c.AT_OR_POST_CON %}
<th>Worked</th>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
<th>Checked In</th>
{% endif %}
{% if can_admin_dept -%}
Expand Down Expand Up @@ -453,7 +453,7 @@ <h3>Members</h3>
<a href="#attendee_form?id={{ attendee.id }}&tab_view=Shifts">{{ attendee.worked_hours }}</a>
</td>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
<td>{{ attendee.checked_in|yesno("Checked In, Not Checked In") }}</td>
{% endif %}
{% if can_admin_dept -%}
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/forms/attendee/admin_badge_flags.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>
</div>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED or c.AFTER_EPOCH %}
<div class="col">
<div class="form-text">Checked In</div>
<div class="mb-4">
Expand Down
8 changes: 4 additions & 4 deletions uber/templates/group_admin/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</div>
{% endif %}
</div>
{% if c.AT_THE_CON and group.amount_unpaid %}
{% if (c.AT_THE_CON or c.AFTER_PREREG_TAKEDOWN) and group.amount_unpaid %}
<div class="alert alert-warning center" role="alert">
<h4>{{ group.name }} currently owes <strong>{{ group.amount_unpaid|format_currency }}</strong>.</h4>
{% if payment_enabled %}
Expand Down Expand Up @@ -133,7 +133,7 @@ <h3>New {{ c.DEALER_TERM|title if group.is_dealer else "Group" }} Info</h3>
<th>Amount Extra</th>
<th>Leader</th>
<th>Unassign</th>
{% if c.AT_THE_CON %}<th>Check In</th>{% endif %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}<th>Check In</th>{% endif %}
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -168,9 +168,9 @@ <h3>New {{ c.DEALER_TERM|title if group.is_dealer else "Group" }} Info</h3>
</form>
{% endif %}
</td>
{% if c.AT_THE_CON and attendee.checked_in %}
{% if (c.AT_THE_CON or c.BADGE_PICKUP_ENABLED) and attendee.checked_in %}
<td><b>Checked-in {{ attendee.checked_in_local|datetime("%-I:%M%p")|lower }} {{ attendee.checked_in_local|datetime("%a") }}</b></td>
{% elif c.AT_THE_CON %}
{% elif c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
{% if attendee.cannot_check_in_reason %}
<td>Can't checkin ({{ attendee.cannot_check_in_reason }})</td>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/preregistration/group_members.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ <h2 class="h5"> Members of "{{ group.name }}" </h2>
</form>
</div>

{% if c.REMAINING_BADGES > 50 and (not c.AT_THE_CON or not c.SPIN_TERMINAL_AUTH_KEY) %}
{% if c.REMAINING_BADGES > 50 and (not c.AT_THE_CON and not c.AFTER_PREREG_TAKEDOWN or not c.SPIN_TERMINAL_AUTH_KEY) %}
<script type="text/javascript">
{% if receipt and receipt.current_amount_owed %}
$(function(){
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/preregistration/group_promo_codes.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h2> Members of "{{ group.name }}" </h2>
</form>
</div>

{% if c.REMAINING_BADGES > 50 and (not c.AT_THE_CON or not c.SPIN_TERMINAL_AUTH_KEY) %}
{% if c.REMAINING_BADGES > 50 and (not c.AT_THE_CON and not c.AFTER_PREREG_TAKEDOWN or not c.SPIN_TERMINAL_AUTH_KEY) %}
<script type="text/javascript">
$(function() {
{% if attendee.amount_unpaid %}
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/registration/attendee_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
{{ save_buttons }}
</div>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
{% include 'registration/attendee_pending_warning.html' %}
{% endif %}
{% include 'badge_printing/queue_badge.html' %}
Expand Down
4 changes: 2 additions & 2 deletions uber/templates/registration/attendee_shifts.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
});
</script>

<h2>{{ attendee.full_name }} {% if c.AT_THE_CON %}({{ attendee.badge }}){% endif %}</h2>
<h2>{{ attendee.full_name }} {% if c.AT_THE_CON and attendee.badge_num %}({{ attendee.badge }}){% endif %}</h2>

<table width="100%">
<tr>
Expand Down Expand Up @@ -93,7 +93,7 @@ <h2>{{ attendee.full_name }} {% if c.AT_THE_CON %}({{ attendee.badge }}){% endif
{% if attendee.shifts %}
<b>
Shifts signed up for by {{ attendee.full_name }}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
{% if attendee.checked_in %}
<i>[checked in]</i>
{% else %}
Expand Down
6 changes: 3 additions & 3 deletions uber/templates/registration/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% include "registration/menu.html" %}

{% include "check_in.html" %}
{% set can_check_in = c.AT_THE_CON and not attendee.checked_in and not attendee.cannot_check_in_reason and (not receipt or not receipt.current_amount_owed) %}
{% set can_check_in = (c.AT_THE_CON or c.BADGE_PICKUP_ENABLED) and not attendee.checked_in and not attendee.cannot_check_in_reason and (not receipt or not receipt.current_amount_owed) %}

<div class="row mb-3">
<div class="col">
Expand Down Expand Up @@ -43,7 +43,7 @@

<div class="card">
<div class="card-body">
{% if c.AT_THE_CON and receipt and receipt.current_amount_owed and not attendee.is_new %}
{% if (c.AT_THE_CON or c.BADGE_PICKUP_ENABLED) and receipt and receipt.current_amount_owed and not attendee.is_new %}
<div class="alert alert-warning center" role="alert">
<h4>{{ attendee.full_name }} currently owes <strong>{{ (receipt.current_amount_owed / 100)|format_currency }}</strong>.</h4>
{% if payment_enabled %}
Expand Down Expand Up @@ -121,7 +121,7 @@ <h4>{{ attendee.full_name }} currently owes <strong>{{ (receipt.current_amount_o
{% else %}Please ask an admin with receipt access to correct their receipt.{% endif %}
</div>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
{% include 'registration/attendee_pending_warning.html' %}
{% endif %}
{% include 'badge_printing/queue_badge.html' %}
Expand Down
8 changes: 4 additions & 4 deletions uber/templates/registration/index_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h5 class="modal-title">
{% if workstation_assignment and workstation_assignment.printer_id %}Re-a{% else %}A{% endif %}ssign Printers
</button>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
<form method="post" action="set_reg_station">
<input type="hidden" name="return_to" value="..{{ c.PAGE_PATH }}?{{ c.QUERY_STRING_NO_MSG }}" />
<div class="row g-sm-2 row-cols-auto">
Expand Down Expand Up @@ -186,7 +186,7 @@ <h5 class="modal-title">
{% endif %}
</div>
<div class="col col-auto">
{% if c.AT_THE_CON %}Workstation #: {{ reg_station_id|default("None",true) }}<br/>{% endif %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}Workstation #: {{ reg_station_id|default("None",true) }}<br/>{% endif %}
{% if c.BADGE_PRINTING_ENABLED %}
{% set printer_text = "Standard Printer" if workstation_assignment and workstation_assignment.separate_printers else "Printer" %}
{{ printer_text }}: {{ workstation_assignment.printer_id|default("None") if workstation_assignment else "None" }}
Expand Down Expand Up @@ -246,7 +246,7 @@ <h5 class="modal-title">
{% if c.DONATION_TIER_OPTS|length > 1 %}<th> <a href="index?order={{ order.amount_extra }}&page={{ page }}&search_text={{ search_text|urlencode }}&invalid={{ invalid }}">Upgrade</a></th>{% endif %}
<th> <a href="index?order={{ order.paid }}&page={{ page }}&search_text={{ search_text|urlencode }}&invalid={{ invalid }}">Paid</a> </th>
<th>{% if c.COLLECT_EXACT_BIRTHDATE %}<a href="index?order={{ order.birthdate }}&page={{ page }}&search_text={{ search_text|urlencode }}&invalid={{ invalid }}">{% endif%}Age{% if c.COLLECT_EXACT_BIRTHDATE %}</a>{% endif %}</th>
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED or c.AFTER_EPOCH %}
<th> <a href="index?order={{ order.checked_in }}&page={{ page }}&search_text={{ search_text|urlencode }}&invalid={{ invalid }}"><nobr>Checked In</nobr></a> </th>
{% endif %}
{% endblock tableheadings %}
Expand Down Expand Up @@ -287,7 +287,7 @@ <h5 class="modal-title">
{% if c.DONATION_TIER_OPTS|length > 1 %}<td id="amount_extra_{{ attendee.id }}">{{ attendee.amount_extra_label }}</td>{% endif %}
<td id="paid_{{ attendee.id }}" ><nobr>{{ attendee.paid_label }}</nobr></td>
<td> <nobr>{{ attendee.age_group_conf.desc }}</nobr> </td>
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
{% if attendee.checked_in %}
<td>
{% if attendee.paid == c.LOST_BADGE %}
Expand Down
2 changes: 1 addition & 1 deletion uber/templates/registration/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"../reg_admin/receipt_items?id={id}", "Receipt Items", c.HAS_REG_ADMIN_ACCESS,
"../registration/watchlist?id={id}", "Watch List Entry", attendee.banned and c.HAS_SECURITY_ADMIN_ACCESS,
"../registration/index", "Return to Attendee List", c.PRE_CON or c.POST_CON,
"../registration/index?search_text={id}", "Return to Attendee List", c.AT_THE_CON,
"../registration/index?search_text={id}", "Return to Attendee List", c.AT_THE_CON or c.BADGE_PICKUP_ENABLED,
) }}
4 changes: 2 additions & 2 deletions uber/templates/registration/staffers.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% if c.AT_OR_POST_CON %}
<th>Worked</th>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
<th><nobr>Checked In</nobr></th>
{% endif %}
</tr></thead>
Expand All @@ -40,7 +40,7 @@
{% if c.AT_OR_POST_CON %}
<td data-order="{{ attendee.worked_hours }}" data-search="{{ attendee.worked_hours }}"> <a href="shifts?id={{ attendee.id }}">{{ attendee.worked_hours }}</a> </td>
{% endif %}
{% if c.AT_THE_CON %}
{% if c.AT_THE_CON or c.BADGE_PICKUP_ENABLED %}
<td>{{ attendee.checked_in|yesno("Checked In,Not Checked In") }}</td>
{% endif %}
</tr>
Expand Down

0 comments on commit ca01952

Please sign in to comment.