Skip to content

Commit

Permalink
Add ability to export attraction signups
Browse files Browse the repository at this point in the history
Requested via Slack.
  • Loading branch information
kitsuta committed Dec 18, 2024
1 parent 995bf7e commit 5dbdf98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions uber/site_sections/attractions_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ def event(
'event': event,
'message': message
}

@csv_file
def signups_export(self, out, session, id):
event = session.attraction_event(id)
out.writerow(['Attendee', 'Badge #', 'Cellphone', 'Email', 'Signup Time', 'Checked In'])
for signup in event.signups:
out.writerow([signup.attendee.full_name, signup.attendee.badge_num, signup.attendee.cellphone,
signup.attendee.email, signup.signup_time_local, signup.checkin_time_local or 'N/A'])

@csrf_protected
@not_site_mappable
Expand Down
5 changes: 4 additions & 1 deletion uber/templates/attractions_admin/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ <h2 class="event-title">
</form>

{%- if event.signups -%}
<h2 class="attendees-title">Attendees Signed Up</h2>
<div class="d-flex align-items-center gap-3 mt-3">
<h2>Attendees Signed Up</h2>
<a href="signups_export?id={{ event.id }}"><i class="fa fa-download"></i> Download CSV</a>
</div>
<table id="attendees-table" class="table table-hover table-responsive datatable"
data-paging="false"
data-info="false">
Expand Down

0 comments on commit 5dbdf98

Please sign in to comment.