Changeset - 7fac10241ec7
[Not reviewed]
0 3 0
Joel Addison - 4 years ago 2020-01-10 12:49:17
joel@addison.net.au
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.
3 files changed with 29 insertions and 22 deletions:
0 comments (0 inline, 0 general)
pinaxcon/registrasion/models.py
Show inline comments
...
 
@@ -78,12 +78,13 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 
    name = models.CharField(
 
        verbose_name="Your name (for your conference nametag)",
 
        max_length=64,
 
        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,
 
    )
 

	
 
    free_text_1 = models.CharField(
...
 
@@ -130,12 +131,13 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 
    address_postcode = models.CharField(
 
        verbose_name="Postal/Zip code",
 
        max_length=1024,
 
        blank=True,
 
    )
 
    country = CountryField(
 
        verbose_name="Country",
 
        default="AU",
 
    )
 
    state = models.CharField(
 
        max_length=256,
 
        verbose_name="State/Territory/Province",
 
        help_text="If your Country is Australia, you must list a state.",
...
 
@@ -156,18 +158,20 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 
    accessibility_requirements = models.CharField(
 
        verbose_name="Accessibility-related requirements",
 
        max_length=256,
 
        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 "
 
            "hope to also provide a programme for older children and will let you "
 
            "know closer to the conference. If you're wanting to bring your children "
 
            "to LCA, please let us know their age(s) so we can ensure we have "
...
 
@@ -214,7 +218,7 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 

	
 
    def first_name(self):
 
        return wrap(self.name, 15, break_long_words=False)[0]
 

	
 
    def last_name(self):
 
        names = wrap(self.name, 15, break_long_words=False)
 
        return names[1] if len(names) > 1 else ''
...
 
\ No newline at end of file
 
        return names[1] if len(names) > 1 else ''
pinaxcon/templates/registrasion/report.html
Show inline comments
...
 
@@ -21,34 +21,32 @@
 
<hr />
 

	
 
{% for report in reports %}
 
<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 %}
 

	
 
{% endblock %}
 

	
vendor/registrasion/registrasion/reporting/views.py
Show inline comments
...
 
@@ -595,21 +595,25 @@ def attendee(request, form, user_id=None):
 
                value = bleach.clean(str(value))
 
            except TypeError:
 
                value = "Bad value for %s" % field.name
 

	
 
        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
 
    except AttributeError:  # No reservation_duration set -- default to 24h
 
        reservation = datetime.datetime.now() + datetime.timedelta(hours=24)
 

	
 
    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((
 
        reverse(views.badge, args=[user_id]),
 
        "View badge",
 
    ))
...
 
@@ -884,22 +888,23 @@ def attendee_data(request, form, user_id=None):
 
        else:
 
            try:
 
                return bleach.clean(str(attr))
 
            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:
 
        profile = by_user[item.cart.user]
 
        line = [
 
            item.cart.user.id,
 
            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
 
        ]
 
        data.append(line)
 

	
0 comments (0 inline, 0 general)