mirror of
https://github.com/pretix/pretix.git
synced 2026-05-11 16:13:59 +00:00
Allow to link directly to voucher input form
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
{% load i18n %}
|
||||
{% load eventurl %}
|
||||
{% load rich_text %}
|
||||
{% if event.settings.voucher_explanation_text %}
|
||||
<div>
|
||||
{{ event.settings.voucher_explanation_text|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="get" action="{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}">
|
||||
<div class="row row-voucher">
|
||||
<div class="col-md-8 col-sm-6 col-xs-12">
|
||||
<label for="voucher" class="sr-only">{% trans "Voucher code" %}
|
||||
{% if "voucher_invalid" in request.GET %}<strong>{% trans "has error" context "form" %},</strong>{% endif %}
|
||||
<i>{% trans "required" context "form" %}</i></label>
|
||||
<div class="input-group{% if "voucher_invalid" in request.GET %} has-error{% endif %}">
|
||||
<span class="input-group-addon"><i class="fa fa-ticket fa-fw" aria-hidden="true"></i></span>
|
||||
<input type="text" class="form-control{% if "voucher_invalid" in request.GET %} has-error{% endif %}" name="voucher" id="voucher"
|
||||
{% if "voucher_invalid" in request.GET %} aria-describedby="error-message"{% endif %}
|
||||
placeholder="{% trans "Voucher code" %}" required="required">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
|
||||
<input type="hidden" name="next" value="{{ request.path }}" />
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<button class="btn btn-block btn-primary" type="submit">
|
||||
{% trans "Redeem voucher" %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -295,33 +295,7 @@
|
||||
{% if show_vouchers %}
|
||||
<aside class="front-page" aria-labelledby="redeem-a-voucher">
|
||||
<h3 id="redeem-a-voucher">{% trans "Redeem a voucher" %}</h3>
|
||||
{% if event.settings.voucher_explanation_text %}
|
||||
<div>
|
||||
{{ event.settings.voucher_explanation_text|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form method="get" action="{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}">
|
||||
<div class="row row-voucher">
|
||||
<div class="col-md-8 col-sm-6 col-xs-12">
|
||||
<label for="voucher" class="sr-only">{% trans "Voucher code" %}
|
||||
{% if "voucher_invalid" in request.GET %}<strong>{% trans "has error" context "form" %},</strong>{% endif %}
|
||||
<i>{% trans "required" context "form" %}</i></label>
|
||||
<div class="input-group{% if "voucher_invalid" in request.GET %} has-error{% endif %}">
|
||||
<span class="input-group-addon"><i class="fa fa-ticket fa-fw" aria-hidden="true"></i></span>
|
||||
<input type="text" class="form-control{% if "voucher_invalid" in request.GET %} has-error{% endif %}" name="voucher" id="voucher"
|
||||
{% if "voucher_invalid" in request.GET %} aria-describedby="error-message"{% endif %}
|
||||
placeholder="{% trans "Voucher code" %}" required="required">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<button class="btn btn-block btn-primary" type="submit">
|
||||
{% trans "Redeem voucher" %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</form>
|
||||
{% include "pretixpresale/event/fragment_voucher_form.html" %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
{% if not cart_namespace %}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{% extends "pretixpresale/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load l10n %}
|
||||
{% load money %}
|
||||
{% load eventurl %}
|
||||
{% load eventsignal %}
|
||||
{% load thumb %}
|
||||
{% load rich_text %}
|
||||
{% block title %}{% trans "Voucher redemption" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Redeem a voucher" %}</h2>
|
||||
{% include "pretixpresale/event/fragment_voucher_form.html" %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user