Cancel orders (fixing #24)

This commit is contained in:
Raphael Michel
2015-03-12 23:35:55 +01:00
parent 7666d04580
commit ff7d4683a6
4 changed files with 83 additions and 10 deletions

View File

@@ -47,10 +47,10 @@
{% if order.status == "n" %}
<div class="row">
<div class="col-md-12 text-right">
<form action="" method="post">
{% csrf_token %}
<button type="submit" class="btn btn-danger">{% trans "Cancel order" %}</button>
</form>
<p>
<a href="{% url 'presale:event.order.cancel' event=request.event.slug organizer=request.event.organizer.slug order=order.code %}"
class="btn btn-danger">{% trans "Cancel order" %}</a>
</p>
</div>
</div>
{% endif %}

View File

@@ -0,0 +1,32 @@
{% extends "pretixpresale/event/base.html" %}
{% load i18n %}
{% block title %}{% trans "Cancel order" %}{% endblock %}
{% block content %}
<h2>
{% blocktrans trimmed with code=order.code %}
Cancel order: {{ code }}
{% endblocktrans %}
</h2>
<p>{% blocktrans trimmed %}
Do you really want to cancel this order? You cannot revert this action.
{% endblocktrans %}</p>
<form method="post" href="">
{% csrf_token %}
<div class="row checkout-button-row">
<div class="col-md-4">
<a class="btn btn-block btn-default btn-lg"
href="{% url "presale:event.order" event=request.event.slug organizer=request.event.organizer.slug order=order.code %}">
{% trans "No, take me back" %}
</a>
</div>
<div class="col-md-4 col-md-offset-4">
<button class="btn btn-block btn-danger btn-lg" type="submit">
{% trans "Yes, cancel order" %}
</button>
</div>
<div class="clearfix"></div>
</div>
</form>
{% endblock %}