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. ",
)
company = models.CharField(
verbose_name="Company",
max_length=64,
help_text="The name of your company, as you'd like it on your badge",
blank=True,
@ -133,6 +134,7 @@ class AttendeeProfile(rego.AttendeeProfileBase):
blank=True,
)
country = CountryField(
verbose_name="Country",
default="AU",
)
state = models.CharField(
@ -159,12 +161,14 @@ class AttendeeProfile(rego.AttendeeProfileBase):
blank=True,
)
gender = models.CharField(
verbose_name="Gender",
help_text="Gender data will only be used for demographic purposes.",
max_length=64,
blank=True,
)
children = models.CharField(
verbose_name="Child Ages and Information",
max_length=256,
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 "
@ -217,4 +221,4 @@ class AttendeeProfile(rego.AttendeeProfileBase):
def last_name(self):
names = wrap(self.name, 15, break_long_words=False)
return names[1] if len(names) > 1 else ''
return names[1] if len(names) > 1 else ''

View file

@ -24,28 +24,26 @@
<h3>{{ report.title }}</h3>
{% if report.headings %}
<table class="table table-striped table-reportdata">
<thead>
<tr>
{% for heading in report.headings %}
<th>{{ heading }}</th>
{% endfor %}
</tr>
</thead>
{% else %}
<table class="table table-striped">
{% endif %}
<thead>
<tr>
{% for heading in report.headings %}
<th>{{ heading }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for line in report.rows %}
<tr>
{% for item in line %}
<td>
{{ item|safe }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<tbody>
{% for line in report.rows %}
<tr>
{% for item in line %}
<td>{{ item|safe }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<hr class="my-5" />
{% endfor %}

View file

@ -598,6 +598,8 @@ def attendee(request, form, user_id=None):
profile_data.append((field.verbose_name, value))
profile_data.insert(1, ("Email", attendee.user.email))
cart = CartController.for_user(attendee.user)
try:
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))
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.append((
@ -887,7 +891,7 @@ def attendee_data(request, form, user_id=None):
except TypeError:
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)
data = []
for item in items:
@ -897,6 +901,7 @@ def attendee_data(request, form, user_id=None):
getattr(profile, name_field),
profile.attendee.user.email,
item.product,
item.quantity,
status_display[item.cart.status],
] + [
display_field(profile, field) for field in fields