Allow to enter a voucher before choosing a subevent

This commit is contained in:
Raphael Michel
2021-03-29 11:04:57 +02:00
parent 127c44d699
commit 2b660ccbf7
7 changed files with 49 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
{% load i18n %}
{% load eventurl %}
{% for subev in subevent_list %}
<a href="{% eventurl event "presale:event.index" subevent=subev.id cart_namespace=cart_namespace %}"
<a href="{% if request.GET.voucher %}{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}?voucher={{ request.GET.voucher|urlencode }}&subevent={{ subev.pk }}{% else %}{% eventurl event "presale:event.index" subevent=subev.id cart_namespace=cart_namespace %}{% endif %}"
class="subevent-row">
<div class="row">
<div class="col-md-6">

View File

@@ -101,6 +101,12 @@
{{ frontpage_text|rich_text }}
</div>
{% endif %}
{% if request.GET.voucher %}
<div class="alert alert-info">
{% trans "Please select a date to redeem your voucher." %}
</div>
{% endif %}
{% endif %}
{% if subevent and "year" not in request.GET %}

View File

@@ -10,7 +10,13 @@
{% block content %}
<h2>{% trans "Voucher redemption" %}</h2>
{% if subevent %}
{% if request.GET.subevent and subevent.pk|stringformat:"i" != request.GET.subevent %}
<div class="alert alert-warning">
{% trans "This voucher is valid only for the following specific date and time." %}
</div>
{% endif %}
<h3>{{ subevent.name }}</h3>
{% with ev=subevent %}
<div class="info-row">