Voucher: Do not show URL if subevent is required

This commit is contained in:
Raphael Michel
2019-03-14 15:34:51 +01:00
parent 7fc926f23e
commit b83752005a

View File

@@ -27,16 +27,18 @@
<legend>{% trans "Voucher details" %}</legend> <legend>{% trans "Voucher details" %}</legend>
{% bootstrap_field form.code layout="control" %} {% bootstrap_field form.code layout="control" %}
{% if voucher.pk %} {% if voucher.pk %}
{% if not request.event.has_subevents or voucher.subevent %}
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label" for="id_url">{% trans "Voucher link" %}</label> <label class="col-md-3 control-label" for="id_url">{% trans "Voucher link" %}</label>
<div class="col-md-9"> <div class="col-md-9">
<input type="text" name="url" <input type="text" name="url"
value="{% abseventurl request.event "presale:event.redeem" %}?voucher={{ voucher.code }}" value="{% abseventurl request.event "presale:event.redeem" %}?voucher={{ voucher.code }}&subevent={{ voucher.subevent_id }}"
class="form-control" class="form-control"
id="id_url" readonly> id="id_url" readonly>
</div> </div>
</div> </div>
{% endif %} {% endif %}
{% endif %}
{% bootstrap_field form.max_usages layout="control" %} {% bootstrap_field form.max_usages layout="control" %}
{% bootstrap_field form.valid_until layout="control" %} {% bootstrap_field form.valid_until layout="control" %}
<div class="form-group"> <div class="form-group">