Add a "Back" button to the guided_registration stages

"Next" is green, indicating that it's the default path, the way
forward. "Back" is available but blue.

For extra consistency, the initial "Get ticket" button is now also a btn-success
This commit is contained in:
James Polley 2017-09-30 18:15:28 +10:00
parent 4605ee0d98
commit e51ad76384
3 changed files with 9 additions and 2 deletions

View file

@ -43,7 +43,7 @@
</div>
<div class="panel-body">
<p>To attend the conference, you must register an attendee profile and purchase your ticket</p>
<a class="btn btn-lg btn-primary" role="button" href="{% url "guided_registration" %}">Get your ticket</a>
<a class="btn btn-lg btn-success" role="button" href="{% url "guided_registration" %}">Get your ticket</a>
</div>
</div>
{% else %}

View file

@ -45,7 +45,10 @@
{% endfor %}
<div class="btn-group">
<input class="btn btn-primary" type="submit" value="Next Step" />
{% if current_step > 1 %}
<a class="btn btn-primary" role="button" href="{{ previous_step }}">Back</a>
{% endif %}
<input class="btn btn-success" type="submit" value="Next Step" />
</div>
</form>

View file

@ -94,6 +94,7 @@ def guided_registration(request, page_number=None):
with the following data::
{
"previous_step": int(), # Previous step
"current_step": int(), # The current step in the
# registration
"sections": sections, # A list of
@ -152,6 +153,8 @@ def guided_registration(request, page_number=None):
page_number = int(page_number)
prev_step = page_number - 1
next_step = redirect("guided_registration", page_number + 1)
with BatchController.batch(request.user):
@ -206,6 +209,7 @@ def guided_registration(request, page_number=None):
return next_step
data = {
"previous_step": prev_step,
"current_step": page_number,
"sections": sections,
"title": title,