Add public filters based on meta data (#3673)

* Add public filters based on meta data

* Fix licenseheaders

* ignore empty values

* Fix tests

* Full non-widget implementation

* Widget support

* Add a few tests

* Allow to reorder properties

* Fix isort

* Allow to opt-out for specific events

* Fix name clash between new and old field to make migration feasible
This commit is contained in:
Raphael Michel
2023-11-10 12:10:01 +01:00
committed by GitHub
parent c0007a9566
commit d7aa94d6ae
34 changed files with 829 additions and 82 deletions

View File

@@ -1,6 +1,7 @@
{% load i18n %}
{% load eventurl %}
{% load urlreplace %}
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
<nav aria-label="{% trans "calendar navigation" %}">
<ul class="row calendar-nav">
<li class="col-sm-4 col-xs-2 text-left flip">

View File

@@ -1,6 +1,7 @@
{% load i18n %}
{% load eventurl %}
{% load urlreplace %}
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
<nav aria-label="{% trans "calendar navigation" %}">
<ul class="row calendar-nav">
<li class="col-sm-4 col-xs-2 text-left flip">

View File

@@ -1,5 +1,6 @@
{% load i18n %}
{% load eventurl %}
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
<ul class="list-unstyled">
{% for subev in subevent_list.subevent_list %}
<li class="subevent-row">

View File

@@ -70,7 +70,7 @@
{% endif %}
{% endif %}
{% if subevent and "date" not in request.GET %}
{% if subevent and "date" not in request.GET and "filtered" not in request.GET %}
<p>
{% if show_cart %}
<button class="subevent-toggle btn btn-primary btn-block btn-lg" aria-expanded="false">

View File

@@ -0,0 +1,25 @@
{% load i18n %}
{% load eventurl %}
{% load urlreplace %}
{% load bootstrap3 %}
{% load getitem %}
{% if filter_form.fields %}
<form class="event-list-filter-form" method="get">
<input type="hidden" name="filtered" value="1">
{% for f, v in request.GET.items %}
{% if f not in filter_form.fields %}
<input type="hidden" name="{{ f }}" value="{{ v }}">
{% endif %}
{% endfor %}
<div class="event-list-filter-form-row">
{% for f in filter_form.fields %}
{% bootstrap_field filter_form|getitem:f %}
{% endfor %}
<button type="submit" class="btn btn-primary">
<span class="fa fa-filter" aria-hidden="true"></span>
{% trans "Filter" %}
</button>
</div>
</form>
{% endif %}

View File

@@ -53,6 +53,7 @@
</div>
</div>
</form>
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
{% include "pretixpresale/fragment_calendar.html" with show_avail=request.organizer.settings.event_list_availability %}
{% if multiple_timezones %}

View File

@@ -46,6 +46,7 @@
</div>
</div>
</form>
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
{% include "pretixpresale/fragment_day_calendar.html" with show_avail=request.organizer.settings.event_list_availability %}
<div class="col-sm-4 visible-xs text-center">
{% if has_before %}

View File

@@ -58,6 +58,7 @@
</div>
</div>
</form>
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
{% include "pretixpresale/fragment_week_calendar.html" with show_avail=request.organizer.settings.event_list_availability %}
<div class="col-sm-12 visible-sm visible-xs text-center">
{% if has_before %}

View File

@@ -33,6 +33,7 @@
</div>
</div>
</div>
{% include "pretixpresale/fragment_event_list_filter.html" with request=request %}
{% if events %}
<div class="event-list">
<div class="row hidden-xs hidden-sm">
@@ -124,7 +125,7 @@
{% endif %}
</div>
<div class="col-md-2 col-xs-6 text-right flip">
<a class="btn btn-primary btn-block" href="{{ url }}">
<a class="btn btn-primary btn-block" href="{{ url }}{% if e.has_subevents and e.match_by_subevents %}{{ filterquery }}{% endif %}">
{% if e.has_subevents %}<span class="fa fa-ticket" aria-hidden="true"></span> {% trans "Tickets" %}
{% elif e.presale_is_running and e.best_availability_state == 100 %}
<span class="fa fa-ticket" aria-hidden="true"></span> {% trans "Tickets" %}