mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Product list: Show "sold out" before expanding variations
This commit is contained in:
@@ -69,6 +69,25 @@
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 availability-box">
|
||||
{% if not event.settings.show_variations_expanded %}
|
||||
{% if item.best_variation_availability <= 10 %}
|
||||
{% if not item.min_price %}
|
||||
<strong class="gone">{% trans "FULLY BOOKED" %}</strong>
|
||||
{% else %}
|
||||
<strong class="gone">{% trans "SOLD OUT" %}</strong>
|
||||
{% endif %}
|
||||
{% if allow_waitinglist and item.allow_waitinglist %}
|
||||
<br/>
|
||||
{% trans "Waiting list" %}
|
||||
{% endif %}
|
||||
<br>
|
||||
{% elif avail < 100 %}
|
||||
<strong class="unavailable">{% trans "Reserved" %}</strong>
|
||||
{% if allow_waitinglist and item.allow_waitinglist %}
|
||||
<br/>
|
||||
{% trans "Waiting list" %}
|
||||
{% endif %}
|
||||
<br>
|
||||
{% endif %}
|
||||
<a data-toggle="variations" class="js-only">
|
||||
{% trans "Show variants" %}
|
||||
</a>
|
||||
|
||||
@@ -354,6 +354,7 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web', require
|
||||
v.display_price.gross for v in item.available_variations])
|
||||
item.max_price = max([v.display_price.net if event.settings.display_net_prices else
|
||||
v.display_price.gross for v in item.available_variations])
|
||||
item.best_variation_availability = max([v.cached_availability[0] for v in item.available_variations])
|
||||
|
||||
item._remove = not bool(item.available_variations)
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
.availability-box {
|
||||
text-align: center;
|
||||
|
||||
&.gone {
|
||||
&.gone, .gone {
|
||||
color: $alert-danger-text;
|
||||
}
|
||||
&.unavailable {
|
||||
&.unavailable, .unavailable {
|
||||
color: $alert-warning-text;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user