Registrasion updates
Show applied vouchers on attendee registration admin page. Add head title and page title to more areas. Update the dashboard to show warning for empty categories and have button to open voucher page. Fix exception on attendee page when user does not have attendee object.
This commit is contained in:
parent
0420fa6b1a
commit
d4b0b52253
9 changed files with 79 additions and 23 deletions
|
@ -4,4 +4,6 @@
|
||||||
<li>{{ item.quantity }} × {{ item.product }} {{ suffix }}</li>
|
<li>{{ item.quantity }} × {{ item.product }} {{ suffix }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>No items.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -41,6 +41,20 @@
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
<h3>Currently applied vouchers</h3>
|
||||||
|
|
||||||
|
{% if vouchers %}
|
||||||
|
<ul>
|
||||||
|
{% for voucher in vouchers %}
|
||||||
|
<li>{{ voucher.code }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>No vouchers applied.</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
<h3>Apply voucher</h3>
|
<h3>Apply voucher</h3>
|
||||||
|
|
||||||
<form class="form-horizontal" method="POST">
|
<form class="form-horizontal" method="POST">
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{% extends "registrasion/base.html" %}
|
{% extends "registrasion/base.html" %}
|
||||||
{% load lca2018_tags %}
|
{% load lca2018_tags %}
|
||||||
|
|
||||||
|
{% block head_title %}Your Profile{% endblock %}
|
||||||
|
{% block page_title %}Your Profile{% endblock %}
|
||||||
|
|
||||||
{% block scripts_extra %}
|
{% block scripts_extra %}
|
||||||
{{ form.media.js }}
|
{{ form.media.js }}
|
||||||
|
@ -22,7 +23,6 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block proposals_body %}
|
{% block proposals_body %}
|
||||||
<h1>Your Profile</h1>
|
|
||||||
<p>These details will appear on your badge, your invoices, and will be used to order catered food at the conference.</p>
|
<p>These details will appear on your badge, your invoices, and will be used to order catered food at the conference.</p>
|
||||||
|
|
||||||
<form class="form-horizontal" method="post" action="">
|
<form class="form-horizontal" method="post" action="">
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{% extends "registrasion/base.html" %}
|
{% extends "registrasion/base.html" %}
|
||||||
{% load registrasion_tags %}
|
{% load registrasion_tags %}
|
||||||
{% load lca2018_tags %}
|
{% load lca2018_tags %}
|
||||||
|
{% load lca2019_tags %}
|
||||||
|
|
||||||
{% block page_title %}Review your selection{% endblock %}
|
{% block page_title %}Review your selection{% endblock %}
|
||||||
{% block page_lead %}
|
{% block page_lead %}
|
||||||
|
@ -15,12 +16,12 @@
|
||||||
|
|
||||||
|
|
||||||
{% block proposals_body %}
|
{% block proposals_body %}
|
||||||
<h1 class="mb-4">Order Review</h1>
|
<h2 class="mb-4">Order Review</h2>
|
||||||
|
|
||||||
{% items_pending as pending %}
|
{% items_pending as pending %}
|
||||||
{% if pending %}
|
{% if pending %}
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<h2>Current selection</h2>
|
<h3>Current selection</h3>
|
||||||
<p>You've selected the following items, which will be in your invoice when you check out:<p>
|
<p>You've selected the following items, which will be in your invoice when you check out:<p>
|
||||||
{% include "registrasion/_items_list.html" with items=pending %}
|
{% include "registrasion/_items_list.html" with items=pending %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,14 +30,14 @@
|
||||||
{% items_purchased as purchased %}
|
{% items_purchased as purchased %}
|
||||||
{% if purchased %}
|
{% if purchased %}
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<h2>Previously purchased</h2>
|
<h3>Previously purchased</h3>
|
||||||
<p>You've already paid for the following items:</p>
|
<p>You've already paid for the following items:</p>
|
||||||
{% include "registrasion/_items_list.html" with items=purchased suffix="<em>(PAID)</em>" %}
|
{% include "registrasion/_items_list.html" with items=purchased suffix="<em>(PAID)</em>" %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<h2>Modify your selection</h2>
|
<h3>Modify your selection</h3>
|
||||||
|
|
||||||
{% missing_categories as missing %}
|
{% missing_categories as missing %}
|
||||||
{% if missing %}
|
{% if missing %}
|
||||||
|
@ -51,21 +52,21 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<p>
|
{% available_categories as available %}
|
||||||
<strong>You can change your selection from these categories:</strong>
|
{% if available|contains_items_not_in:missing %}
|
||||||
{% available_categories as available %}
|
<p><strong>You can change your selection from these categories:</strong></p>
|
||||||
{% include "registrasion/_category_list.html" with categories=available exclude=missing %}
|
{% include "registrasion/_category_list.html" with categories=available exclude=missing %}
|
||||||
</p>
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<h2>Voucher</h2>
|
<h3>Voucher</h3>
|
||||||
<p>If you have been given a voucher, please <a id="voucher-form-button" href="{% url "voucher_code" %}">enter your voucher code</a> now.
|
<p>If you have been given a voucher, please <a id="voucher-form-button" href="{% url "voucher_code" %}">enter your voucher code</a> now.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="my-4">
|
<div class="my-4">
|
||||||
<h2>What next?</h2>
|
<h3>What next?</h3>
|
||||||
{% if pending %}
|
{% if pending %}
|
||||||
<p>You can either check out an invoice and pay for your selections, or return to
|
<p>You can either check out an invoice and pay for your selections, or return to
|
||||||
the dashboard.</p>
|
the dashboard.</p>
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{% extends "registrasion/base.html" %}
|
{% extends "registrasion/base.html" %}
|
||||||
{% load crispy_forms_tags %}
|
{% load crispy_forms_tags %}
|
||||||
|
|
||||||
|
{% block head_title %}Apply Voucher{% endblock %}
|
||||||
|
{% block page_title %}Apply Voucher{% endblock %}
|
||||||
|
|
||||||
{% block proposals_body %}
|
{% block proposals_body %}
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
{% load lca2018_tags %}
|
{% load lca2018_tags %}
|
||||||
{% load lca2019_tags %}
|
{% load lca2019_tags %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
|
{% load waffle_tags %}
|
||||||
|
|
||||||
{% if user.is_staff %}
|
{% if user.is_staff %}
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
@ -46,6 +47,9 @@
|
||||||
<p>If you would like to change the details on your badge or your attendee statistics, you may edit your attendee profile here.</p>
|
<p>If you would like to change the details on your badge or your attendee statistics, you may edit your attendee profile here.</p>
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-primary" role="button" href="{% url "attendee_edit" %}">Edit attendee profile</a>
|
<a class="btn btn-primary" role="button" href="{% url "attendee_edit" %}">Edit attendee profile</a>
|
||||||
|
{% flag "badge_preview" %}
|
||||||
|
<a class="btn btn-info" role="button" href="{% url "user_badge" %}">Preview my badge</a>
|
||||||
|
{% endflag %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3 mb-md-0">
|
||||||
|
@ -66,29 +70,51 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% if pending %}
|
{% if pending %}
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3">
|
||||||
<h4>Items pending payment</h4>
|
<h4>Items pending payment</h4>
|
||||||
{% include "registrasion/_items_list.html" with items=pending %}
|
{% include "registrasion/_items_list.html" with items=pending %}
|
||||||
<a class="btn btn-lg btn-primary" role="button" href="{% url "checkout" %}">Check out and pay</a>
|
<a class="btn btn-primary" role="button" href="{% url "checkout" %}"><i class="fa fa-credit-card"></i> Check out and pay</a>
|
||||||
|
<a class="btn btn-secondary" role="button" href="{% url "voucher_code" %}">Apply voucher</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% items_purchased as purchased %}
|
{% items_purchased as purchased %}
|
||||||
{% if purchased %}
|
{% if purchased %}
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3">
|
||||||
<h4>Paid Items</h4>
|
<h4>Paid Items</h4>
|
||||||
{% include "registrasion/_items_list.html" with items=purchased %}
|
{% include "registrasion/_items_list.html" with items=purchased %}
|
||||||
|
|
||||||
|
{% if not pending %}
|
||||||
|
<a class="btn btn-secondary" role="button" href="{% url "voucher_code" %}">Apply voucher</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3">
|
||||||
<h4>Add/Update Items</h4>
|
<h4>Add/Update Items</h4>
|
||||||
{% include "registrasion/_category_list.html" with categories=categories %}
|
{% missing_categories as missing %}
|
||||||
|
{% if missing %}
|
||||||
|
<div class="alert alert-warning my-4 pb-4">
|
||||||
|
<h5 class="alert-heading">You have empty categories</h5>
|
||||||
|
<p>You have <em>not</em> selected anything from the following
|
||||||
|
categories. If your ticket includes any of these, you still need to
|
||||||
|
make a selection:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{% include "registrasion/_category_list.html" with categories=missing %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% available_categories as available %}
|
||||||
|
{% if available|contains_items_not_in:missing %}
|
||||||
|
<p><strong>You can change your selection from these categories:</strong></p>
|
||||||
|
{% include "registrasion/_category_list.html" with categories=available exclude=missing %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% invoices as invoices %}
|
{% invoices as invoices %}
|
||||||
{% if invoices %}
|
{% if invoices %}
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3">
|
||||||
<h4>Invoices</h4>
|
<h4>Invoices</h4>
|
||||||
<ul>
|
<ul>
|
||||||
{% for invoice in invoices %}
|
{% for invoice in invoices %}
|
||||||
|
@ -99,14 +125,14 @@
|
||||||
</ul>
|
</ul>
|
||||||
{% if invoices|any_is_void %}
|
{% if invoices|any_is_void %}
|
||||||
<div class="mt-auto">
|
<div class="mt-auto">
|
||||||
<button id="toggle-void-invoices" onclick="toggleVoidInvoices();" class="btn btn-lg btn-default">Show void invoices</button>
|
<button type="button" class="btn btn-sm btn-outline-dark" id="toggle-void-invoices" onclick="toggleVoidInvoices();">Show void invoices</button>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if false %}
|
{% if false %}
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3">
|
||||||
<h4>Raffle Tickets</h4>
|
<h4>Raffle Tickets</h4>
|
||||||
|
|
||||||
<p><a href="/raffle/tickets/">View all my raffle tickets</a></p>
|
<p><a href="/raffle/tickets/">View all my raffle tickets</a></p>
|
||||||
|
@ -117,7 +143,7 @@
|
||||||
|
|
||||||
{% available_credit as credit %}
|
{% available_credit as credit %}
|
||||||
{% if credit %}
|
{% if credit %}
|
||||||
<div class="col-md-6 mb-3 mb-md-0">
|
<div class="col-md-6 mb-3">
|
||||||
<h4>Credit</h4>
|
<h4>Credit</h4>
|
||||||
<p>You have ${{ credit }} leftover from refunded invoices. This credit will be automatically applied to new invoices. Contact the conference organisers if you wish to arrange a refund to your original payment source.</p>
|
<p>You have ${{ credit }} leftover from refunded invoices. This credit will be automatically applied to new invoices. Contact the conference organisers if you wish to arrange a refund to your original payment source.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -48,6 +48,11 @@ def any_is_void(invoices):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter
|
||||||
|
def contains_items_not_in(list1, list2):
|
||||||
|
return len(set(list1).difference(list2)) > 0
|
||||||
|
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def listlookup(lookup, target):
|
def listlookup(lookup, target):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -562,9 +562,13 @@ def attendee(request, form, user_id=None):
|
||||||
|
|
||||||
reports = []
|
reports = []
|
||||||
|
|
||||||
profile_data = []
|
|
||||||
try:
|
try:
|
||||||
attendee = people.Attendee.objects.get(user__id=user_id)
|
attendee = people.Attendee.objects.get(user__id=user_id)
|
||||||
|
except people.DoesNotExist:
|
||||||
|
return reports
|
||||||
|
|
||||||
|
profile_data = []
|
||||||
|
try:
|
||||||
name = attendee.attendeeprofilebase.attendee_name()
|
name = attendee.attendeeprofilebase.attendee_name()
|
||||||
|
|
||||||
profile = people.AttendeeProfileBase.objects.get_subclass(
|
profile = people.AttendeeProfileBase.objects.get_subclass(
|
||||||
|
|
1
vendor/registrasion/registrasion/views.py
vendored
1
vendor/registrasion/registrasion/views.py
vendored
|
@ -1077,6 +1077,7 @@ def amend_registration(request, user_id):
|
||||||
"cancelled": ic.items_released(),
|
"cancelled": ic.items_released(),
|
||||||
"form": formset,
|
"form": formset,
|
||||||
"voucher_form": voucher_form,
|
"voucher_form": voucher_form,
|
||||||
|
"vouchers": current_cart.cart.vouchers.all(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return render(request, "registrasion/amend_registration.html", data)
|
return render(request, "registrasion/amend_registration.html", data)
|
||||||
|
|
Loading…
Reference in a new issue