Added option to show remaining quota to users

This commit is contained in:
Raphael Michel
2016-03-22 18:39:28 +01:00
parent 4110c1c77a
commit 9c44159bb6
12 changed files with 216 additions and 150 deletions

View File

@@ -5,9 +5,9 @@
</div>
{% elif avail < 100 %}
<div class="col-md-2 col-xs-6 availability-box unavailable">
<strong>{% trans "Unavailable" %}</strong><br />
<strong>{% trans "Reserved" %}</strong><br />
<small>
{% trans "This item is currently unavailable but might become available again." %}
{% trans "All remaining products are reserved but might become available again." %}
</small>
</div>
{% endif %}

View File

@@ -0,0 +1,8 @@
{% load i18n %}
{% if avail.0 > 0 and avail.1 != None %}
<p><small>
{% blocktrans trimmed with num=avail.1 %}
{{ num }} currently available
{% endblocktrans %}
</small></p>
{% endif %}

View File

@@ -96,6 +96,9 @@
<div class="row-fluid product-row variation">
<div class="col-md-8 col-xs-12">
{{ var }}
{% if event.settings.show_quota_left %}
{% include "pretixpresale/event/fragment_quota_left.html" with avail=var.cached_availability %}
{% endif %}
</div>
<div class="col-md-2 col-xs-6 price">
{{ event.currency }} {{ var.price|floatformat:2 }}
@@ -109,7 +112,7 @@
{% if 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.cached_availability.1 }}"
max="{{ var.order_max }}"
name="variation_{{ item.id }}_{{ var.id }}">
</div>
{% else %}
@@ -132,7 +135,10 @@
</a>
{% endif %}
<strong>{{ item.name }}</strong>
{% if item.description %}<p>{{ item.description }}</p>{% endif %}
{% if item.description %}<p class="description">{{ item.description }}</p>{% endif %}
{% if event.settings.show_quota_left %}
{% include "pretixpresale/event/fragment_quota_left.html" with avail=item.cached_availability %}
{% endif %}
</div>
<div class="col-md-2 col-xs-6 price">
{{ event.currency }} {{ item.price|floatformat:2 }}
@@ -146,7 +152,7 @@
{% if 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.cached_availability.1 }}" name="item_{{ item.id }}">
max="{{ item.order_max }}" name="item_{{ item.id }}">
</div>
{% else %}
{% include "pretixpresale/event/fragment_availability.html" with avail=item.cached_availability.0 %}