forked from CGM_Public/pretix_original
Presale: Hide subevent lists if subevents exist but none are visible (Z#23186153) (#5054)
* Hide subevent lists (but not calendars) if subevents exist but none are visible, to avoid confusion during checkout
This commit is contained in:
@@ -71,14 +71,15 @@
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if subevent_list_foldable %}
|
||||
<details class="panel panel-{% if show_cart %}primary{% else %}default{% endif %}">
|
||||
<summary class="panel-heading">
|
||||
{% else %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{% endif %}
|
||||
<h3 class="panel-title"><b>
|
||||
{% if subevent_list.list_type != "list" or subevent_list.visible_events %}
|
||||
{% if subevent_list_foldable %}
|
||||
<details class="panel panel-{% if show_cart %}primary{% else %}default{% endif %}">
|
||||
<summary class="panel-heading">
|
||||
{% else %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{% endif %}
|
||||
<h3 class="panel-title"><b>
|
||||
{% if subevent_list_foldable %}
|
||||
{% if show_cart %}
|
||||
{% trans "Add tickets for a different date" %}
|
||||
@@ -88,35 +89,36 @@
|
||||
{% else %}
|
||||
{% trans "Choose date to book a ticket" %}
|
||||
{% endif %}</b>
|
||||
</h3>
|
||||
{% if subevent_list_foldable %}
|
||||
</summary>
|
||||
<div>
|
||||
{% else %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</h3>
|
||||
{% if subevent_list_foldable %}
|
||||
</summary>
|
||||
<div>
|
||||
{% else %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if filter_form.fields %}
|
||||
<div class="panel-subhead">
|
||||
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel-body">
|
||||
{% cache_large 15 subevent_list subevent_list_cache_key %}
|
||||
{% if subevent_list.list_type == "calendar" %}
|
||||
{% include "pretixpresale/event/fragment_subevent_calendar.html" %}
|
||||
{% elif subevent_list.list_type == "week" %}
|
||||
{% include "pretixpresale/event/fragment_subevent_calendar_week.html" %}
|
||||
{% else %}
|
||||
{% include "pretixpresale/event/fragment_subevent_list.html" %}
|
||||
{% endif %}
|
||||
{% endcache_large %}
|
||||
</div>
|
||||
{% if subevent_list_foldable %}
|
||||
<div class="panel-body">
|
||||
{% cache_large 15 subevent_list subevent_list_cache_key %}
|
||||
{% if subevent_list.list_type == "calendar" %}
|
||||
{% include "pretixpresale/event/fragment_subevent_calendar.html" %}
|
||||
{% elif subevent_list.list_type == "week" %}
|
||||
{% include "pretixpresale/event/fragment_subevent_calendar_week.html" %}
|
||||
{% else %}
|
||||
{% include "pretixpresale/event/fragment_subevent_list.html" %}
|
||||
{% endif %}
|
||||
{% endcache_large %}
|
||||
</div>
|
||||
</details>
|
||||
{% else %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if subevent_list_foldable %}
|
||||
</div>
|
||||
</details>
|
||||
{% else %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if subevent %}
|
||||
<h2 class="subevent-head">{{ subevent.name }}</h2>
|
||||
|
||||
@@ -815,6 +815,7 @@ class EventIndex(EventViewMixin, EventListMixin, CartMixin, TemplateView):
|
||||
se for se in context['subevent_list']
|
||||
if not se.presale_has_ended and (se.best_availability_state is None or se.best_availability_state >= Quota.AVAILABILITY_RESERVED)
|
||||
]
|
||||
context['visible_events'] = len(context['subevent_list']) > 0
|
||||
return context
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user