Compare commits

...

3 Commits

Author SHA1 Message Date
Richard Schreiber
2f8e6a2a4b only auto-submit subevent-select when context var "auto_submit" is True 2021-03-30 08:52:44 +02:00
Richard Schreiber
c084b91ab3 added columns to filter-form 2021-03-24 21:05:45 +01:00
Martin Gross
8baaa0a8c6 Add select2-subevent picker; display subevent start time 2021-03-24 13:50:27 +01:00
6 changed files with 47 additions and 55 deletions

View File

@@ -29,7 +29,7 @@
{% if request.event.has_subevents %}
<form class="form-inline helper-display-inline" action="" method="get">
<form class="form-inline helper-display-inline" action="" method="get">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" with auto_submit=True %}
</form>
</form>
{% endif %}

View File

@@ -1,6 +1,6 @@
{% load i18n %}
<p>
<select name="subevent" class="form-control simple-subevent-choice" data-model-select2="event"
<select name="subevent" class="form-control{% if auto_submit %} simple-subevent-choice{% endif %}" data-model-select2="event"
data-select2-url="{% url "control:event.subevents.select2" organizer=request.event.organizer.slug event=request.event.slug %}"
data-placeholder="{% trans "All dates" context "subevent" %}">
{% for se in selected_subevents %}

View File

@@ -98,7 +98,7 @@
{% if request.event.has_subevents %}
<form class="form-inline helper-display-inline" action="" method="get">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" with auto_submit=True %}
</form>
{% endif %}
{% if not request.event.has_subevents or subevent %}

View File

@@ -15,7 +15,7 @@
</p>
{% if request.event.has_subevents %}
<form class="form-inline helper-display-inline" action="" method="get">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" with auto_submit=True %}
</form>
{% endif %}
{% if quotas|length == 0 %}

View File

@@ -48,15 +48,9 @@
</p>
{% endif %}
{% if request.event.has_subevents %}
<select name="subevent" class="form-control">
<option value="">{% trans "All dates" context "subevent" %}</option>
{% for se in request.event.subevents.all %}
<option value="{{ se.id }}"
{% if request.GET.subevent|add:0 == se.id %}selected="selected"{% endif %}>
{{ se.name }} {{ se.get_date_range_display }}
</option>
{% endfor %}
</select>
<div class="col-md-6">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
</div>
{% endif %}
<button class="btn btn-large btn-primary" type="submit">
{% trans "Send as many vouchers as possible" %}
@@ -80,52 +74,50 @@
</div>
</div>
<p>
<form class="form-inline helper-display-inline" action="" method="get">
<select name="status" class="form-control">
<option value="a"
{% if request.GET.status == "p" %}selected="selected"{% endif %}>{% trans "All entries" %}</option>
<option value="w"
{% if request.GET.status == "w" or not request.GET.status %}selected="selected"{% endif %}>
{% trans "Waiting for a voucher" %}</option>
<option value="s"
{% if request.GET.status == "s" %}selected="selected"{% endif %}>{% trans "Voucher assigned" %}</option>
<option value="v"
{% if request.GET.status == "v" %}selected="selected"{% endif %}>
{% trans "Waiting for redemption" %}</option>
<option value="r"
{% if request.GET.status == "r" %}selected="selected"{% endif %}>
{% trans "Successfully redeemed" %}</option>
<option value="e"
{% if request.GET.status == "e" %}selected="selected"{% endif %}>
{% trans "Voucher expired" %}</option>
</select>
<select name="item" class="form-control">
<option value="">{% trans "All products" %}</option>
{% for item in items %}
<option value="{{ item.id }}"
{% if request.GET.item|add:0 == item.id %}selected="selected"{% endif %}>
{{ item }}
</option>
{% endfor %}
</select>
{% if request.event.has_subevents %}
<select name="subevent" class="form-control">
<option value="">{% trans "All dates" context "subevent" %}</option>
{% for se in request.event.subevents.all %}
<option value="{{ se.id }}"
{% if request.GET.subevent|add:0 == se.id %}selected="selected"{% endif %}>
{{ se.name }} {{ se.get_date_range_display }}
<form class="row filter-form" action="" method="get">
<div class="col-lg-2 col-md-3 col-xs-6">
<select name="status" class="form-control">
<option value="a"
{% if request.GET.status == "p" %}selected="selected"{% endif %}>{% trans "All entries" %}</option>
<option value="w"
{% if request.GET.status == "w" or not request.GET.status %}selected="selected"{% endif %}>
{% trans "Waiting for a voucher" %}</option>
<option value="s"
{% if request.GET.status == "s" %}selected="selected"{% endif %}>{% trans "Voucher assigned" %}</option>
<option value="v"
{% if request.GET.status == "v" %}selected="selected"{% endif %}>
{% trans "Waiting for redemption" %}</option>
<option value="r"
{% if request.GET.status == "r" %}selected="selected"{% endif %}>
{% trans "Successfully redeemed" %}</option>
<option value="e"
{% if request.GET.status == "e" %}selected="selected"{% endif %}>
{% trans "Voucher expired" %}</option>
</select>
</div>
<div class="col-lg-2 col-md-3 col-xs-6">
<select name="item" class="form-control">
<option value="">{% trans "All products" %}</option>
{% for item in items %}
<option value="{{ item.id }}"
{% if request.GET.item|add:0 == item.id %}selected="selected"{% endif %}>
{{ item }}
</option>
{% endfor %}
</select>
</div>
{% if request.event.has_subevents %}
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
</div>
{% endif %}
<button class="btn btn-primary" type="submit">{% trans "Filter" %}</button>
<a href="?{% url_replace request "download" "yes" %}"
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<button class="btn btn-primary" type="submit"><span class="fa fa-filter"></span> {% trans "Filter" %}</button>
<a href="?{% url_replace request "download" "yes" %}"
class="btn btn-default"><i class="fa fa-download"></i>
{% trans "Download list" %}</a>
{% trans "Download list" %}</a>
</div>
</form>
</p>
<form method="post" action="?next={{ request.get_full_path|urlencode }}">
{% csrf_token %}
<div class="table-responsive">
@@ -166,7 +158,7 @@
{% endif %}
</td>
{% if request.event.has_subevents %}
<td>{{ e.subevent.name }} {{ e.subevent.get_date_range_display }}</td>
<td>{{ e.subevent.name }} {{ e.subevent.get_date_range_display }} {{ e.subevent.date_from|date:"TIME_FORMAT" }}</td>
{% endif %}
<td>
{{ e.created|date:"SHORT_DATETIME_FORMAT" }}

View File

@@ -10,7 +10,7 @@
<h1>{% trans "Statistics" %}</h1>
{% if request.event.has_subevents %}
<form class="form-inline helper-display-inline" action="" method="get">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" with auto_submit=True %}
</form>
{% endif %}
{% if has_orders %}