forked from CGM_Public/pretix_original
Add sub-events and relative date settings (#503)
* Data model * little crud * SubEventItemForm etc * Drop SubEventItem.active, quota editor * Fix failing tests * First frontend stuff * Addons form stuff * Quota calculation * net price display on EventIndex * Add tests, solve some bugs * Correct quota selection in more places, consolidate pricing logic * Fix failing quota tests * Fix TypeError * Add tests for checkout * Fixed a bug in QuotaForm * Prevent immutable cart if a quota was removed from an item * Add tests for pricing * Handle waiting list * Filter in check-in list * Fixed import lost in rebase * Fix waiting list widget * Voucher management * Voucher redemption * Fix broken tests * Add subevents to OrderChangeManager * Create a subevent during event creation * Fix bulk voucher creation * Introduce subevent.active * Copy from for subevents * Show active in list * ICal download for subevents * Check start and end of presale * Failing tests / show cart logic * Test * Rebase migrations * REST API integration of sub-events * Integrate quota calculation into the traditional quota form * Make subevent argument to add_position optional * Log-display foo * pretixdroid and subevents * Filter by subevent * Add more tests * Some mor tests * Rebase fixes * More tests * Relative dates * Restrict selection in relative datetime widgets * Filter subevent list * Re-label has_subevents * Rebase fixes, subevents in calendar view * Performance and caching issues * Refactor calendar templates * Permission tests * Calendar fixes and month selection * subevent selection * Rename subevents to dates * Add tests for calendar views
This commit is contained in:
@@ -30,7 +30,9 @@
|
||||
{% else %}
|
||||
<h1>
|
||||
<a href="{% eventurl event "presale:event.index" %}">{{ event.name }}</a>
|
||||
<small>{{ event.get_date_range_display }}</small>
|
||||
{% if not event.has_subevents %}
|
||||
<small>{{ event.get_date_range_display }}</small>
|
||||
{% endif %}
|
||||
</h1>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<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 %}">
|
||||
<a href="{% eventurl event "presale:event.waitinglist" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}{% if subevent %}&subevent={{ subevent.pk }}{% endif %}">
|
||||
<span class="fa fa-plus-circle"></span>
|
||||
{% trans "Waiting list" %}
|
||||
</a>
|
||||
@@ -19,7 +19,7 @@
|
||||
</strong>
|
||||
{% if event.settings.waiting_list_enabled %}
|
||||
<br/>
|
||||
<a href="{% eventurl event "presale:event.waitinglist" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}">
|
||||
<a href="{% eventurl event "presale:event.waitinglist" %}?item={{ item.pk }}{% if var %}&var={{ var.pk }}{% endif %}{% if subevent %}&subevent={{ subevent.pk }}{% endif %}">
|
||||
<span class="fa fa-plus-circle"></span>
|
||||
{% trans "Waiting list" %}
|
||||
</a>
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
{% if line.voucher %}
|
||||
<br /><span class="fa fa-tags"></span> {% trans "Voucher code used:" %} {{ line.voucher.code }}
|
||||
{% endif %}
|
||||
{% if line.subevent %}
|
||||
<br /><span class="fa fa-calendar"></span> {{ line.subevent.name }} · {{ line.subevent.get_date_range_display }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if line.has_questions %}
|
||||
@@ -83,6 +86,7 @@
|
||||
{% if editable %}
|
||||
<form action="{% eventurl event "presale:event.cart.add" %}"
|
||||
method="post" data-asynctask>
|
||||
<input type="hidden" name="subevent" value="{{ line.subevent_id|default_if_none:"" }}" />
|
||||
{% csrf_token %}
|
||||
{% if line.variation %}
|
||||
<input type="hidden" name="variation_{{ line.item.id }}_{{ line.variation.id }}"
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{% load i18n %}
|
||||
{% load eventurl %}
|
||||
<form class="form-inline" method="get" id="monthselform" action="{% eventurl event "presale:event.index" %}">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 hidden-xs">
|
||||
<a href="{% eventurl event "presale:event.index" %}?year={{ before.year }}&month={{ before.month }}" class="btn btn-default">
|
||||
<span class="fa fa-arrow-left"></span>
|
||||
{{ before|date:"F Y" }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-4 col-xs-12 text-center">
|
||||
<select name="month" class="form-control">
|
||||
{% for m in months %}
|
||||
<option value="{{ m|date:"m" }}" {% if m == date %}selected{% endif %}>{{ m|date:"F" }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select name="year" class="form-control">
|
||||
{% for y in years %}
|
||||
<option value="{{ y }}" {% if y == date.year %}selected{% endif %}>{{ y }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="submit" class="js-hidden btn btn-default">
|
||||
{% trans "Go" %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-sm-4 hidden-xs text-right">
|
||||
<a href="{% eventurl event "presale:event.index" %}?year={{ after.year }}&month={{ after.month }}" class="btn btn-default">
|
||||
<span class="fa fa-arrow-right"></span>
|
||||
{{ after|date:"F Y" }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% include "pretixpresale/fragment_calendar.html" %}
|
||||
@@ -0,0 +1,34 @@
|
||||
{% load i18n %}
|
||||
{% load eventurl %}
|
||||
{% for subev in event.active_future_subevents %}
|
||||
<a href="{% eventurl event "presale:event.index" subevent=subev.id %}" class="subevent-row">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<strong>{{ subev.name }}</strong>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span class="fa fa-calendar"></span>
|
||||
{{ subev.get_date_range_display }}
|
||||
{% if event.settings.show_times %}
|
||||
<span class="fa fa-clock-o"></span>
|
||||
{{ subev.date_from|date:"TIME_FORMAT" }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 text-right">
|
||||
{% if subev.presale_is_running %}
|
||||
<span class="label label-success">{% trans "Tickets on sale" %}</span>
|
||||
{% elif subev.presale_has_ended %}
|
||||
<span class="label label-danger">{% trans "Sale over" %}</span>
|
||||
{% elif event.settings.presale_start_show_date %}
|
||||
<span class="label label-warning">
|
||||
{% blocktrans trimmed with date=subev.presale_start|date:"SHORT_DATE_FORMAT" %}
|
||||
Sale starts {{ date }}
|
||||
{% endblocktrans %}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="label label-warning">{% trans "Not yet on sale" %}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
@@ -8,7 +8,7 @@
|
||||
{% block title %}{% trans "Presale" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if cart.positions and event.presale_is_running %}
|
||||
{% if show_cart %}
|
||||
<div class="panel panel-primary cart">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{% trans "Your cart" %}</h3>
|
||||
@@ -48,87 +48,224 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not event.presale_is_running %}
|
||||
<div class="alert alert-info">
|
||||
{% if event.presale_has_ended %}
|
||||
{% blocktrans trimmed %}
|
||||
The presale period for this event is over.
|
||||
{% endblocktrans %}
|
||||
{% elif event.settings.presale_start_show_date %}
|
||||
{% blocktrans trimmed with date=event.presale_start|date:"SHORT_DATE_FORMAT" time=event.presale_start|time:"TIME_FORMAT" %}
|
||||
The presale for this event will start on {{ date }} at {{ time }}.
|
||||
{% endblocktrans %}
|
||||
|
||||
{% if event.has_subevents %}
|
||||
{% if subevent %}
|
||||
<a class="subevent-toggle">
|
||||
{% trans "View other date" %}
|
||||
</a>
|
||||
{% else %}
|
||||
<h3>{% trans "Choose date to buy a ticket" %}</h3>
|
||||
{% endif %}
|
||||
<div class="subevent-list">
|
||||
{% if event.settings.event_list_type == "calendar" %}
|
||||
{% include "pretixpresale/event/fragment_subevent_calendar.html" %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
The presale for this event has not yet started.
|
||||
{% endblocktrans %}
|
||||
{% include "pretixpresale/event/fragment_subevent_list.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if subevent %}
|
||||
<h2 class="subevent-head">{{ subevent.name }}</h2>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if frontpage_text %}
|
||||
<div>
|
||||
{{ frontpage_text|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if frontpage_text %}
|
||||
<div>
|
||||
{{ frontpage_text|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if event.location %}
|
||||
<div class="info-row">
|
||||
<span class="fa fa-map-marker fa-fw"></span>
|
||||
<p>
|
||||
{{ event.location|linebreaksbr }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="info-row">
|
||||
<span class="fa fa-clock-o fa-fw"></span>
|
||||
<p>
|
||||
{{ event.get_date_range_display }}
|
||||
{% if event.settings.show_times %}
|
||||
<br>
|
||||
{% blocktrans trimmed with time=event.date_from|date:"TIME_FORMAT" %}
|
||||
Begin: {{ time }}
|
||||
{% if subevent or not event.has_subevents %}
|
||||
{% if not ev.presale_is_running %}
|
||||
<div class="alert alert-info">
|
||||
{% if ev.presale_has_ended %}
|
||||
{% blocktrans trimmed %}
|
||||
The presale period for this event is over.
|
||||
{% endblocktrans %}
|
||||
{% elif event.settings.presale_start_show_date %}
|
||||
{% blocktrans trimmed with date=ev.presale_start|date:"SHORT_DATE_FORMAT" time=ev.presale_start|time:"TIME_FORMAT" %}
|
||||
The presale for this event will start on {{ date }} at {{ time }}.
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
The presale for this event has not yet started.
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% if event.date_admission %}
|
||||
<br>
|
||||
{% if event.date_admission|date:"SHORT_DATE_FORMAT" == event.date_from|date:"SHORT_DATE_FORMAT" %}
|
||||
{% blocktrans trimmed with time=event.date_admission|date:"TIME_FORMAT" %}
|
||||
Admission: {{ time }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with datetime=event.date_admission|date:"SHORT_DATETIME_FORMAT" %}
|
||||
Admission: {{ datetime }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if ev.location %}
|
||||
<div class="info-row">
|
||||
<span class="fa fa-map-marker fa-fw"></span>
|
||||
<p>
|
||||
{{ ev.location|linebreaksbr }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="info-row">
|
||||
<span class="fa fa-clock-o fa-fw"></span>
|
||||
<p>
|
||||
{{ ev.get_date_range_display }}
|
||||
{% if event.settings.show_times %}
|
||||
<br>
|
||||
{% blocktrans trimmed with time=ev.date_from|date:"TIME_FORMAT" %}
|
||||
Begin: {{ time }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<br>
|
||||
<a href="{% eventurl event "presale:event.ical.download" %}">
|
||||
{% trans "Add to Calendar" %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% eventsignal event "pretix.presale.signals.front_page_top" %}
|
||||
{% if event.presale_is_running or event.settings.show_items_outside_presale_period %}
|
||||
<form method="post" data-asynctask
|
||||
action="{% eventurl request.event "presale:event.cart.add" %}?next={{ request.path|urlencode }}">
|
||||
{% csrf_token %}
|
||||
{% for tup in items_by_category %}
|
||||
<section>
|
||||
{% if tup.0 %}
|
||||
<h3>{{ tup.0.name }}</h3>
|
||||
{% if tup.0.description %}
|
||||
<p>{{ tup.0.description|localize|rich_text }}</p>
|
||||
{% if ev.date_admission %}
|
||||
<br>
|
||||
{% if ev.date_admission|date:"SHORT_DATE_FORMAT" == ev.date_from|date:"SHORT_DATE_FORMAT" %}
|
||||
{% blocktrans trimmed with time=ev.date_admission|date:"TIME_FORMAT" %}
|
||||
Admission: {{ time }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with datetime=ev.date_admission|date:"SHORT_DATETIME_FORMAT" %}
|
||||
Admission: {{ datetime }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for item in tup.1 %}
|
||||
{% if item.has_variations %}
|
||||
<div class="item-with-variations">
|
||||
<div class="row-fluid product-row headline">
|
||||
<br>
|
||||
{% if subevent %}
|
||||
<a href="{% eventurl event "presale:event.ical.download" subevent=subevent.pk %}">
|
||||
{% else %}
|
||||
<a href="{% eventurl event "presale:event.ical.download" %}">
|
||||
{% endif %}
|
||||
{% trans "Add to Calendar" %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% eventsignal event "pretix.presale.signals.front_page_top" %}
|
||||
{% if ev.presale_is_running or event.settings.show_items_outside_presale_period %}
|
||||
<form method="post" data-asynctask
|
||||
action="{% eventurl request.event "presale:event.cart.add" %}?next={{ request.path|urlencode }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
|
||||
{% for tup in items_by_category %}
|
||||
<section>
|
||||
{% if tup.0 %}
|
||||
<h3>{{ tup.0.name }}</h3>
|
||||
{% if tup.0.description %}
|
||||
<p>{{ tup.0.description|localize|rich_text }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% for item in tup.1 %}
|
||||
{% if item.has_variations %}
|
||||
<div class="item-with-variations">
|
||||
<div class="row-fluid product-row headline">
|
||||
<div class="col-md-8 col-xs-12">
|
||||
{% if item.picture %}
|
||||
<a href="{{ item.picture.url }}" class="productpicture"
|
||||
data-title="{{ item.name }}"
|
||||
data-lightbox="{{ item.id }}">
|
||||
<img src="{{ item.picture|thumbnail_url:'productlist' }}"
|
||||
alt="{{ item.name }}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="#" data-toggle="variations">
|
||||
<strong>{{ item.name }}</strong>
|
||||
</a>
|
||||
{% if item.description %}
|
||||
<div class="product-description">
|
||||
{{ item.description|localize|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if item.min_per_order %}
|
||||
<p>
|
||||
<small>
|
||||
{% blocktrans trimmed with num=item.min_per_order %}
|
||||
minimum amount to order: {{ num }}
|
||||
{% endblocktrans %}
|
||||
</small>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 price">
|
||||
{% if item.min_price != item.max_price or item.free_price %}
|
||||
{% blocktrans trimmed with minprice=item.min_price|floatformat:2 currency=event.currency %}
|
||||
from {{ currency }} {{ minprice }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{{ event.currency }} {{ item.min_price|floatformat:2 }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 availability-box">
|
||||
{% if not event.settings.show_variations_expanded %}
|
||||
<a href="#" data-toggle="variations" class="js-only">
|
||||
{% trans "Show variants" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="variations {% if not event.settings.show_variations_expanded %}variations-collapsed{% endif %}">
|
||||
{% for var in item.available_variations %}
|
||||
<div class="row-fluid product-row variation">
|
||||
<div class="col-md-8 col-xs-12">
|
||||
{{ var }}
|
||||
{% if var.description %}
|
||||
<div class="variation-description">
|
||||
{{ var.description|localize|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.settings.show_quota_left %}
|
||||
{% include "pretixpresale/event/fragment_quota_left.html" with avail=var.cached_availability %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 price">
|
||||
{% if item.free_price %}
|
||||
<div class="input-group input-group-price">
|
||||
<span class="input-group-addon">{{ event.currency }}</span>
|
||||
<input type="number" class="form-control input-item-price"
|
||||
placeholder="0"
|
||||
min="{{ var.display_price|stringformat:"0.2f" }}"
|
||||
name="price_{{ item.id }}_{{ var.id }}"
|
||||
step="any" value="{{ var.display_price|stringformat:"0.2f" }}">
|
||||
</div>
|
||||
{% else %}
|
||||
{{ event.currency }} {{ var.display_price|floatformat:2 }}
|
||||
{% endif %}
|
||||
{% if item.tax_rate and event.settings.display_net_prices %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
<strong>plus</strong> {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% elif item.tax_rate %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
incl. {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if item.require_voucher %}
|
||||
<div class="col-md-2 col-xs-6 availability-box unavailable">
|
||||
<small>
|
||||
{% trans "Enter a voucher code below to buy this ticket." %}
|
||||
</small>
|
||||
</div>
|
||||
{% elif var.cached_availability.0 == 100 %}
|
||||
<div class="col-md-2 col-xs-6 availability-box available">
|
||||
{% if item.max_per_order == 1 %}
|
||||
<label class="item-checkbox-label">
|
||||
<input type="checkbox" value="1"
|
||||
name="variation_{{ item.id }}_{{ var.id }}">
|
||||
</label>
|
||||
{% else %}
|
||||
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
|
||||
max="{{ var.order_max }}"
|
||||
name="variation_{{ item.id }}_{{ var.id }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include "pretixpresale/event/fragment_availability.html" with avail=var.cached_availability.0 event=event item=item var=var %}
|
||||
{% endif %}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row-fluid product-row simple">
|
||||
<div class="col-md-8 col-xs-12">
|
||||
{% if item.picture %}
|
||||
<a href="{{ item.picture.url }}" class="productpicture"
|
||||
@@ -138,14 +275,15 @@
|
||||
alt="{{ item.name }}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="#" data-toggle="variations">
|
||||
<strong>{{ item.name }}</strong>
|
||||
</a>
|
||||
<strong>{{ item.name }}</strong>
|
||||
{% if item.description %}
|
||||
<div class="product-description">
|
||||
{{ item.description|localize|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.settings.show_quota_left %}
|
||||
{% include "pretixpresale/event/fragment_quota_left.html" with avail=item.cached_availability %}
|
||||
{% endif %}
|
||||
{% if item.min_per_order %}
|
||||
<p>
|
||||
<small>
|
||||
@@ -157,179 +295,68 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 price">
|
||||
{% if item.min_price != item.max_price or item.free_price %}
|
||||
{% blocktrans trimmed with minprice=item.min_price|floatformat:2 currency=event.currency %}
|
||||
from {{ currency }} {{ minprice }}
|
||||
{% endblocktrans %}
|
||||
{% if item.free_price %}
|
||||
<div class="input-group input-group-price">
|
||||
<span class="input-group-addon">{{ event.currency }}</span>
|
||||
<input type="number" class="form-control input-item-price" placeholder="0"
|
||||
min="{{ item.display_price|stringformat:"0.2f" }}"
|
||||
name="price_{{ item.id }}"
|
||||
step="any" value="{{ item.display_price|stringformat:"0.2f" }}">
|
||||
</div>
|
||||
{% else %}
|
||||
{{ event.currency }} {{ item.min_price|floatformat:2 }}
|
||||
{{ event.currency }} {{ item.display_price|floatformat:2 }}
|
||||
{% endif %}
|
||||
{% if item.tax_rate and event.settings.display_net_prices %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
<strong>plus</strong> {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% elif item.tax_rate %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
incl. {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 availability-box">
|
||||
{% if not event.settings.show_variations_expanded %}
|
||||
<a href="#" data-toggle="variations" class="js-only">
|
||||
{% trans "Show variants" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="variations {% if not event.settings.show_variations_expanded %}variations-collapsed{% endif %}">
|
||||
{% for var in item.available_variations %}
|
||||
<div class="row-fluid product-row variation">
|
||||
<div class="col-md-8 col-xs-12">
|
||||
{{ var }}
|
||||
{% if var.description %}
|
||||
<div class="variation-description">
|
||||
{{ var.description|localize|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.settings.show_quota_left %}
|
||||
{% include "pretixpresale/event/fragment_quota_left.html" with avail=var.cached_availability %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 price">
|
||||
{% if item.free_price %}
|
||||
<div class="input-group input-group-price">
|
||||
<span class="input-group-addon">{{ event.currency }}</span>
|
||||
<input type="number" class="form-control input-item-price"
|
||||
placeholder="0"
|
||||
min="{{ var.display_price|stringformat:"0.2f" }}"
|
||||
name="price_{{ item.id }}_{{ var.id }}"
|
||||
step="any" value="{{ var.display_price|stringformat:"0.2f" }}">
|
||||
</div>
|
||||
{% else %}
|
||||
{{ event.currency }} {{ var.display_price|floatformat:2 }}
|
||||
{% endif %}
|
||||
{% if item.tax_rate and event.settings.display_net_prices %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
<strong>plus</strong> {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% elif item.tax_rate %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
incl. {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if item.require_voucher %}
|
||||
<div class="col-md-2 col-xs-6 availability-box unavailable">
|
||||
<small>
|
||||
{% trans "Enter a voucher code below to buy this ticket." %}
|
||||
</small>
|
||||
</div>
|
||||
{% elif var.cached_availability.0 == 100 %}
|
||||
<div class="col-md-2 col-xs-6 availability-box available">
|
||||
{% if item.max_per_order == 1 %}
|
||||
<label class="item-checkbox-label">
|
||||
<input type="checkbox" value="1"
|
||||
name="variation_{{ item.id }}_{{ var.id }}">
|
||||
</label>
|
||||
{% else %}
|
||||
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
|
||||
max="{{ var.order_max }}"
|
||||
name="variation_{{ item.id }}_{{ var.id }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include "pretixpresale/event/fragment_availability.html" with avail=var.cached_availability.0 event=event item=item var=var %}
|
||||
{% endif %}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="row-fluid product-row simple">
|
||||
<div class="col-md-8 col-xs-12">
|
||||
{% if item.picture %}
|
||||
<a href="{{ item.picture.url }}" class="productpicture"
|
||||
data-title="{{ item.name }}"
|
||||
data-lightbox="{{ item.id }}">
|
||||
<img src="{{ item.picture|thumbnail_url:'productlist' }}"
|
||||
alt="{{ item.name }}"/>
|
||||
</a>
|
||||
{% endif %}
|
||||
<strong>{{ item.name }}</strong>
|
||||
{% if item.description %}
|
||||
<div class="product-description">
|
||||
{{ item.description|localize|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.settings.show_quota_left %}
|
||||
{% include "pretixpresale/event/fragment_quota_left.html" with avail=item.cached_availability %}
|
||||
{% endif %}
|
||||
{% if item.min_per_order %}
|
||||
<p>
|
||||
{% if item.require_voucher %}
|
||||
<div class="col-md-2 col-xs-6 availability-box unavailable">
|
||||
<small>
|
||||
{% blocktrans trimmed with num=item.min_per_order %}
|
||||
minimum amount to order: {{ num }}
|
||||
{% endblocktrans %}
|
||||
{% trans "Enter a voucher code below to buy this ticket." %}
|
||||
</small>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6 price">
|
||||
{% if item.free_price %}
|
||||
<div class="input-group input-group-price">
|
||||
<span class="input-group-addon">{{ event.currency }}</span>
|
||||
<input type="number" class="form-control input-item-price" placeholder="0"
|
||||
min="{{ item.display_price|stringformat:"0.2f" }}"
|
||||
name="price_{{ item.id }}"
|
||||
step="any" value="{{ item.display_price|stringformat:"0.2f" }}">
|
||||
</div>
|
||||
{% elif item.cached_availability.0 == 100 %}
|
||||
<div class="col-md-2 col-xs-6 availability-box available">
|
||||
{% if item.max_per_order == 1 %}
|
||||
<label class="item-checkbox-label">
|
||||
<input type="checkbox" value="1"
|
||||
name="item_{{ item.id }}">
|
||||
</label>
|
||||
{% else %}
|
||||
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
|
||||
max="{{ item.order_max }}" name="item_{{ item.id }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ event.currency }} {{ item.display_price|floatformat:2 }}
|
||||
{% endif %}
|
||||
{% if item.tax_rate and event.settings.display_net_prices %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
<strong>plus</strong> {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% elif item.tax_rate %}
|
||||
<small>{% blocktrans trimmed with rate=item.tax_rate %}
|
||||
incl. {{ rate }}% taxes
|
||||
{% endblocktrans %}</small>
|
||||
{% include "pretixpresale/event/fragment_availability.html" with avail=item.cached_availability.0 event=event item=item var=0 %}
|
||||
{% endif %}
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{% if item.require_voucher %}
|
||||
<div class="col-md-2 col-xs-6 availability-box unavailable">
|
||||
<small>
|
||||
{% trans "Enter a voucher code below to buy this ticket." %}
|
||||
</small>
|
||||
</div>
|
||||
{% elif item.cached_availability.0 == 100 %}
|
||||
<div class="col-md-2 col-xs-6 availability-box available">
|
||||
{% if item.max_per_order == 1 %}
|
||||
<label class="item-checkbox-label">
|
||||
<input type="checkbox" value="1"
|
||||
name="item_{{ item.id }}">
|
||||
</label>
|
||||
{% else %}
|
||||
<input type="number" class="form-control input-item-count" placeholder="0" min="0"
|
||||
max="{{ item.order_max }}" name="item_{{ item.id }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include "pretixpresale/event/fragment_availability.html" with avail=item.cached_availability.0 event=event item=item var=0 %}
|
||||
{% endif %}
|
||||
<div class="clearfix"></div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
{% if ev.presale_is_running and display_add_to_cart %}
|
||||
<section class="front-page">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-4 col-md-offset-8 col-xs-12">
|
||||
<button class="btn btn-block btn-primary btn-lg" type="submit" id="btn-add-to-cart">
|
||||
<i class="fa fa-shopping-cart"></i> {% trans "Add to cart" %}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
{% if event.presale_is_running and display_add_to_cart %}
|
||||
<section class="front-page">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-4 col-md-offset-8 col-xs-12">
|
||||
<button class="btn btn-block btn-primary btn-lg" type="submit" id="btn-add-to-cart">
|
||||
<i class="fa fa-shopping-cart"></i> {% trans "Add to cart" %}
|
||||
</button>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
</form>
|
||||
</section>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if vouchers_exist %}
|
||||
<section class="front-page">
|
||||
@@ -343,6 +370,7 @@
|
||||
placeholder="{% trans "Voucher code" %}">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<button class="btn btn-block btn-primary" type="submit">
|
||||
{% trans "Redeem voucher" %}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
{% endif %}
|
||||
{% elif not download_buttons %}
|
||||
<div class="alert alert-info">
|
||||
{% blocktrans trimmed with date=event.settings.ticket_download_date|date:"SHORT_DATE_FORMAT" %}
|
||||
{% blocktrans trimmed with date=ticket_download_date|date:"SHORT_DATE_FORMAT" %}
|
||||
You will be able to download your tickets here starting on {{ date }}.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
{% block content %}
|
||||
<h2>{% trans "Voucher redemption" %}</h2>
|
||||
{% if subevent %}
|
||||
<h3>{{ subevent.name }}</h3>
|
||||
{% endif %}
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
You entered a voucher code that allows you to buy one of the following products at the specified price:
|
||||
@@ -18,6 +21,7 @@
|
||||
<form method="post" data-asynctask
|
||||
action="{% eventurl request.event "presale:event.cart.add" %}?next={{ request.path|urlencode }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
|
||||
<input type="hidden" name="_voucher_code" value="{{ voucher.code }}">
|
||||
{% for tup in items_by_category %}
|
||||
<section>
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
value="{{ item.name }}{% if variation %} – {{ variation.value }}{% endif %}">
|
||||
</div>
|
||||
</div>
|
||||
{% if subevent %}
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label" for="id_email">{% trans "Event" %}</label>
|
||||
<div class="col-md-9">
|
||||
<input class="form-control" readonly="readonly"
|
||||
value="{{ subevent.name }} – {{ subevent.get_date_range_display }}">
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% bootstrap_form form layout='horizontal' %}
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
{% load i18n %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-calendar">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ weeks.1.0.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.1.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.2.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.3.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.4.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.5.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.6.date|date:"D" }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for week in weeks %}
|
||||
<tr>
|
||||
{% for day in week %}
|
||||
{% if day %}
|
||||
<td class="day {% if day.events %}has-events{% else %}no-events{% endif %}"
|
||||
data-date="{{ day.date|date:"SHORT_DATE_FORMAT" }}">
|
||||
<h3>{{ day.day }}</h3>
|
||||
<div class="events">
|
||||
{% for event in day.events %}
|
||||
<a class="event {% if event.continued %}continued{% endif %}"
|
||||
href="{{ event.url }}">
|
||||
<span class="event-name">
|
||||
{{ event.event.name }}
|
||||
</span>
|
||||
{% if not event.continued %}
|
||||
{% if event.time %}
|
||||
<span class="event-time">
|
||||
<span class="fa fa-clock-o"></span>
|
||||
{{ event.time|date:"TIME_FORMAT" }}
|
||||
{% if multiple_timezones %}
|
||||
{{ event.timezone }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="event-status">
|
||||
{% if event.event.presale_is_running %}
|
||||
<span class="fa fa-ticket"></span> {% trans "Tickets on sale" %}
|
||||
{% elif event.event.presale_has_ended %}
|
||||
<span class="fa fa-ticket"></span> {% trans "Sale over" %}
|
||||
{% elif event.event.settings.presale_start_show_date and event.event.presale_start %}
|
||||
<span class="fa fa-ticket"></span>
|
||||
{% blocktrans with start_date=event.event.presale_start|date:"SHORT_DATE_FORMAT" %}
|
||||
from {{ start_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
<span class="fa fa-ticket"></span> {% trans "Soon" %}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="no-day"></td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="selected-day">
|
||||
<td colspan="7"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -10,83 +10,41 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
<h3 class="text-center">{{ date|date:"F Y" }}</h3>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<a href="{% eventurl request.organizer "presale:organizer.calendar" year=before.year month=before.month %}"
|
||||
class="btn btn-default">
|
||||
<span class="fa fa-arrow-left"></span>
|
||||
{{ before|date:"F Y" }}
|
||||
</a>
|
||||
<form class="form-inline" method="get" id="monthselform" action="{% eventurl request.organizer "presale:organizer.calendar" %}">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 hidden-xs">
|
||||
<a href="{% eventurl request.organizer "presale:organizer.calendar" year=before.year month=before.month %}"
|
||||
class="btn btn-default">
|
||||
<span class="fa fa-arrow-left"></span>
|
||||
{{ before|date:"F Y" }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-4 col-xs-12 text-center">
|
||||
<select name="month" class="form-control">
|
||||
{% for m in months %}
|
||||
<option value="{{ m|date:"m" }}" {% if m == date %}selected{% endif %}>{{ m|date:"F" }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select name="year" class="form-control">
|
||||
{% for y in years %}
|
||||
<option value="{{ y }}" {% if y == date.year %}selected{% endif %}>{{ y }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="submit" class="js-hidden btn btn-default">
|
||||
{% trans "Go" %}
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-sm-4 hidden-xs text-right">
|
||||
<a href="{% eventurl request.organizer "presale:organizer.calendar" year=after.year month=after.month %}"
|
||||
class="btn btn-default">
|
||||
<span class="fa fa-arrow-right"></span>
|
||||
{{ after|date:"F Y" }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<a href="{% eventurl request.organizer "presale:organizer.calendar" year=after.year month=after.month %}"
|
||||
class="btn btn-default">
|
||||
<span class="fa fa-arrow-right"></span>
|
||||
{{ after|date:"F Y" }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-calendar">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ weeks.1.0.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.1.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.2.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.3.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.4.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.5.date|date:"D" }}</th>
|
||||
<th>{{ weeks.1.6.date|date:"D" }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for week in weeks %}
|
||||
<tr>
|
||||
{% for day in week %}
|
||||
{% if day %}
|
||||
<td class="day">
|
||||
<h3>{{ day.day }}</h3>
|
||||
{% for event in day.events %}
|
||||
<a class="event {% if event.continued %}continued{% endif %}" href="{{ event.url }}">
|
||||
<span class="event-name">
|
||||
{{ event.event.name }}
|
||||
</span>
|
||||
{% if not event.continued %}
|
||||
{% if event.time %}
|
||||
<span class="event-time">
|
||||
<span class="fa fa-clock-o"></span>
|
||||
{{ event.time|date:"TIME_FORMAT" }}
|
||||
{% if multiple_timezones %}
|
||||
{{ event.timezone }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="event-status">
|
||||
{% if event.event.presale_is_running %}
|
||||
<span class="fa fa-ticket"></span> {% trans "Tickets on sale" %}
|
||||
{% elif event.event.presale_has_ended %}
|
||||
<span class="fa fa-ticket"></span> {% trans "Sale over" %}
|
||||
{% elif event.event.settings.presale_start_show_date and event.event.presale_start %}
|
||||
<span class="fa fa-ticket"></span>
|
||||
{% blocktrans with start_date=event.event.presale_start|date:"SHORT_DATE_FORMAT" %}
|
||||
from {{ start_date }}
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
<span class="fa fa-ticket"></span> {% trans "Soon" %}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="no-day"></td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
{% include "pretixpresale/fragment_calendar.html" %}
|
||||
{% if multiple_timezones %}
|
||||
<div class="alert alert-info">
|
||||
{% blocktrans trimmed %}
|
||||
|
||||
Reference in New Issue
Block a user