Add waiting list

This commit is contained in:
Raphael Michel
2016-03-31 19:00:41 +02:00
parent 8f5849a90c
commit c83f539bba
29 changed files with 1216 additions and 26 deletions

View File

@@ -1,13 +1,28 @@
{% load i18n %}
{% load eventurl %}
{% if avail == 0 %}
<div class="col-md-2 col-xs-6 availability-box gone">
<strong>{% trans "SOLD OUT" %}</strong>
{% if event.settings.waiting_list_enabled %}
<br/>
<a href="{% eventurl event "presale:event.waitinglist" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}">
<span class="fa fa-plus-circle"></span>
{% trans "Waiting list" %}
</a>
{% endif %}
</div>
{% elif avail < 100 %}
<div class="col-md-2 col-xs-6 availability-box unavailable">
<strong>{% trans "Reserved" %}</strong><br />
<small>
{% trans "All remaining products are reserved but might become available again." %}
</small>
<strong>{% trans "Reserved" %}
<span class="fa fa-info-circle" data-toggle="tooltip"
title="{% trans "All remaining products are reserved but might become available again." %}"></span>
</strong>
{% if event.settings.waiting_list_enabled %}
<br/>
<a href="{% eventurl event "presale:event.waitinglist" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}">
<span class="fa fa-plus-circle"></span>
{% trans "Waiting list" %}
</a>
{% endif %}
</div>
{% endif %}

View File

@@ -156,7 +156,7 @@
name="variation_{{ item.id }}_{{ var.id }}">
</div>
{% else %}
{% include "pretixpresale/event/fragment_availability.html" with avail=var.cached_availability.0 %}
{% include "pretixpresale/event/fragment_availability.html" with avail=var.cached_availability.0 event=event item=item var=var %}
{% endif %}
<div class="clearfix"></div>
</div>
@@ -211,7 +211,7 @@
max="{{ item.order_max }}" name="item_{{ item.id }}">
</div>
{% else %}
{% include "pretixpresale/event/fragment_availability.html" with avail=item.cached_availability.0 %}
{% include "pretixpresale/event/fragment_availability.html" with avail=item.cached_availability.0 event=event item=item var=0 %}
{% endif %}
<div class="clearfix"></div>
</div>

View File

@@ -0,0 +1,31 @@
{% extends "pretixpresale/event/base.html" %}
{% load i18n eventurl thumbnail bootstrap3 %}
{% block title %}{% trans "Waiting list" %}{% endblock %}
{% block content %}
<h2>{% trans "Add me to the waiting list" %}</h2>
<form action="" method="post">
{% csrf_token %}
<div class="form-horizontal">
<div class="form-group">
<label class="col-md-3 control-label" for="id_email">{% trans "Product" %}</label>
<div class="col-md-9">
<input class="form-control" readonly="readonly"
value="{{ item.name }}{% if variation %} {{ variation.value }}{% endif %}">
</div>
</div>
{% bootstrap_form form layout='horizontal' %}
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<div class="help-block">
{% blocktrans trimmed %}
If tickets become available again, we will inform the first persons on the waiting list. If we notify you, you'll have 48 hours time to buy a ticket until we assign it to the next person on the list.
{% endblocktrans %}
</div>
<button type="submit" class="btn btn-primary">
{% trans "Add me to the list" %}
</button>
</div>
</div>
</div>
</form>
{% endblock %}