mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Multi-line location field, new field for admission time
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<form method="post" data-asynctask action="{% eventurl request.event "presale:event.cart.clear" %}">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-block btn-default btn-lg" type="submit"><i class="fa fa-close"></i> {% trans "Empty cart" %}</button>
|
||||
<button class="btn btn-block btn-default btn-lg" type="submit">
|
||||
<i class="fa fa-close"></i> {% trans "Empty cart" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-4 col-md-offset-4 col-xs-12">
|
||||
@@ -66,15 +67,57 @@
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if frontpage_text %}
|
||||
<div>
|
||||
{{ frontpage_text|rich_text }}
|
||||
</div>
|
||||
<div>
|
||||
{{ frontpage_text|rich_text }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p class="text-right">
|
||||
<a href="{% eventurl event "presale:event.ical.download" %}" class="btn btn-link btn-xs">
|
||||
<i class="fa fa-calendar"></i> {% trans "Add to Calendar" %}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
{% if event.location %}
|
||||
<div class="info-row">
|
||||
<span class="fa fa-map-marker fa-fw"></span>
|
||||
<p>
|
||||
{{ event.location|linebreaksbr }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if event.settings.show_times or event.date_admission %}
|
||||
<div class="info-row">
|
||||
<span class="fa fa-clock-o fa-fw"></span>
|
||||
<p>
|
||||
{% if event.settings.show_times %}
|
||||
{% blocktrans trimmed with time=event.date_from|date:"TIME_FORMAT" %}
|
||||
Begin: {{ time }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% if event.date_admission and event.settings.show_times %}
|
||||
<br>
|
||||
{% endif %}
|
||||
{% if event.date_admission %}
|
||||
{% 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 }}
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<br>
|
||||
<a href="{% eventurl event "presale:event.ical.download" %}">
|
||||
<i class="fa fa-calendar"></i> {% trans "Add to Calendar" %}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-right">
|
||||
<a href="{% eventurl event "presale:event.ical.download" %}" class="btn-xs">
|
||||
<i class="fa fa-calendar"></i> {% trans "Add to Calendar" %}
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% eventsignal event "pretix.presale.signals.front_page_top" %}
|
||||
@@ -112,11 +155,13 @@
|
||||
</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>
|
||||
<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">
|
||||
@@ -222,11 +267,13 @@
|
||||
{% include "pretixpresale/event/fragment_quota_left.html" with avail=item.cached_availability %}
|
||||
{% endif %}
|
||||
{% if item.min_per_order %}
|
||||
<p><small>
|
||||
{% blocktrans trimmed with num=item.min_per_order %}
|
||||
minimum amount to order: {{ num }}
|
||||
{% endblocktrans %}
|
||||
</small></p>
|
||||
<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">
|
||||
|
||||
@@ -10,6 +10,7 @@ from django.db.models import Count, Prefetch, Q
|
||||
from django.http import Http404, HttpResponse
|
||||
from django.shortcuts import redirect
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.formats import date_format
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
@@ -149,6 +150,11 @@ class EventIcalDownload(EventViewMixin, View):
|
||||
else:
|
||||
vevent.add('dtend').value = event.date_to.astimezone(self.event_timezone).date()
|
||||
|
||||
if event.date_admission:
|
||||
vevent.add('description').value = str(_('Admission: {datetime}')).format(
|
||||
datetime=date_format(event.date_admission.astimezone(self.event_timezone), 'SHORT_DATETIME_FORMAT')
|
||||
)
|
||||
|
||||
resp = HttpResponse(cal.serialize(), content_type='text/calendar')
|
||||
resp['Content-Disposition'] = 'attachment; filename="{}-{}.ics"'.format(
|
||||
event.organizer.slug, event.slug
|
||||
|
||||
Reference in New Issue
Block a user