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,15 +27,17 @@
<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 %}
<div class="form-group"> {% if not request.event.has_subevents or voucher.subevent %}
<label class="col-md-3 control-label" for="id_url">{% trans "Voucher link" %}</label> <div class="form-group">
<div class="col-md-9"> <label class="col-md-3 control-label" for="id_url">{% trans "Voucher link" %}</label>
<input type="text" name="url" <div class="col-md-9">
value="{% abseventurl request.event "presale:event.redeem" %}?voucher={{ voucher.code }}" <input type="text" name="url"
class="form-control" value="{% abseventurl request.event "presale:event.redeem" %}?voucher={{ voucher.code }}&subevent={{ voucher.subevent_id }}"
id="id_url" readonly> class="form-control"
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" %}