Improve attendee reports

Display attendee profile data in normal table without DataTables so
sorting is not applied, causing data to be confusing to read.
Include item quantity in attendee data report for accurate schwag packing.
This commit is contained in:
Joel Addison 2020-01-10 22:49:17 +10:00
parent d2ca86bba2
commit 7fac10241e
3 changed files with 29 additions and 22 deletions

View file

@ -81,6 +81,7 @@ class AttendeeProfile(rego.AttendeeProfileBase):
help_text="Your name, as you'd like it to appear on your badge. ", help_text="Your name, as you'd like it to appear on your badge. ",
) )
company = models.CharField( company = models.CharField(
verbose_name="Company",
max_length=64, max_length=64,
help_text="The name of your company, as you'd like it on your badge", help_text="The name of your company, as you'd like it on your badge",
blank=True, blank=True,
@ -133,6 +134,7 @@ class AttendeeProfile(rego.AttendeeProfileBase):
blank=True, blank=True,
) )
country = CountryField( country = CountryField(
verbose_name="Country",
default="AU", default="AU",
) )
state = models.CharField( state = models.CharField(
@ -159,12 +161,14 @@ class AttendeeProfile(rego.AttendeeProfileBase):
blank=True, blank=True,
) )
gender = models.CharField( gender = models.CharField(
verbose_name="Gender",
help_text="Gender data will only be used for demographic purposes.", help_text="Gender data will only be used for demographic purposes.",
max_length=64, max_length=64,
blank=True, blank=True,
) )
children = models.CharField( children = models.CharField(
verbose_name="Child Ages and Information",
max_length=256, max_length=256,
help_text="Linux.conf.au is a family friendly conference and provides " help_text="Linux.conf.au is a family friendly conference and provides "
"free child-care for pre-school children from 6 months up to 5 years. We " "free child-care for pre-school children from 6 months up to 5 years. We "

View file

@ -24,9 +24,6 @@
<h3>{{ report.title }}</h3> <h3>{{ report.title }}</h3>
{% if report.headings %} {% if report.headings %}
<table class="table table-striped table-reportdata"> <table class="table table-striped table-reportdata">
{% else %}
<table class="table table-striped">
{% endif %}
<thead> <thead>
<tr> <tr>
{% for heading in report.headings %} {% for heading in report.headings %}
@ -34,13 +31,14 @@
{% endfor %} {% endfor %}
</tr> </tr>
</thead> </thead>
{% else %}
<table class="table table-striped">
{% endif %}
<tbody> <tbody>
{% for line in report.rows %} {% for line in report.rows %}
<tr> <tr>
{% for item in line %} {% for item in line %}
<td> <td>{{ item|safe }}</td>
{{ item|safe }}
</td>
{% endfor %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}

View file

@ -598,6 +598,8 @@ def attendee(request, form, user_id=None):
profile_data.append((field.verbose_name, value)) profile_data.append((field.verbose_name, value))
profile_data.insert(1, ("Email", attendee.user.email))
cart = CartController.for_user(attendee.user) cart = CartController.for_user(attendee.user)
try: try:
reservation = cart.cart.reservation_duration + cart.cart.time_last_updated reservation = cart.cart.reservation_duration + cart.cart.time_last_updated
@ -606,7 +608,9 @@ def attendee(request, form, user_id=None):
profile_data.append(("Current cart reserved until", reservation)) profile_data.append(("Current cart reserved until", reservation))
reports.append(ListReport("Profile", ["", ""], profile_data)) # No column headings, as this has row headings instead and sorting makes
# everything confusing.
reports.append(ListReport("Profile", None, profile_data))
links = [] links = []
links.append(( links.append((
@ -887,7 +891,7 @@ def attendee_data(request, form, user_id=None):
except TypeError: except TypeError:
return "Bad value found for %s" % attr return "Bad value found for %s" % attr
headings = ["User ID", "Name", "Email", "Product", "Item Status"] headings = ["User ID", "Name", "Email", "Product", "Quantity", "Item Status"]
headings.extend(field_names) headings.extend(field_names)
data = [] data = []
for item in items: for item in items:
@ -897,6 +901,7 @@ def attendee_data(request, form, user_id=None):
getattr(profile, name_field), getattr(profile, name_field),
profile.attendee.user.email, profile.attendee.user.email,
item.product, item.product,
item.quantity,
status_display[item.cart.status], status_display[item.cart.status],
] + [ ] + [
display_field(profile, field) for field in fields display_field(profile, field) for field in fields