Display checkbox for items with max_per_order == 1

This commit is contained in:
Raphael Michel
2017-03-24 17:30:37 +01:00
parent 446698d52f
commit d3a26d8022
2 changed files with 22 additions and 5 deletions

View File

@@ -171,9 +171,16 @@
</div>
{% elif var.cached_availability.0 == 100 %}
<div class="col-md-2 col-xs-6 availability-box available">
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
max="{{ var.order_max }}"
name="variation_{{ item.id }}_{{ var.id }}">
{% if item.max_per_order == 1 %}
<label class="item-checkbox-label">
<input type="checkbox" value="1"
name="variation_{{ item.id }}_{{ var.id }}">
</label>
{% else %}
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
max="{{ var.order_max }}"
name="variation_{{ item.id }}_{{ var.id }}">
{% endif %}
</div>
{% else %}
{% include "pretixpresale/event/fragment_availability.html" with avail=var.cached_availability.0 event=event item=item var=var %}
@@ -231,8 +238,15 @@
</div>
{% elif item.cached_availability.0 == 100 %}
<div class="col-md-2 col-xs-6 availability-box available">
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
max="{{ item.order_max }}" name="item_{{ item.id }}">
{% if item.max_per_order == 1 %}
<label class="item-checkbox-label">
<input type="checkbox" value="1"
name="item_{{ item.id }}">
</label>
{% else %}
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
max="{{ item.order_max }}" name="item_{{ item.id }}">
{% endif %}
</div>
{% else %}
{% include "pretixpresale/event/fragment_availability.html" with avail=item.cached_availability.0 event=event item=item var=0 %}

View File

@@ -26,6 +26,9 @@
color: $alert-warning-text;
}
}
.item-checkbox-label {
display: block;
}
.productpicture {
float: left;