diff --git a/src/pretix/base/models/event.py b/src/pretix/base/models/event.py index 289fc37787..85e5d99e61 100644 --- a/src/pretix/base/models/event.py +++ b/src/pretix/base/models/event.py @@ -15,6 +15,7 @@ from django.db import models from django.db.models import Exists, F, OuterRef, Prefetch, Q, Subquery from django.template.defaultfilters import date as _date from django.utils.crypto import get_random_string +from django.utils.formats import date_format from django.utils.functional import cached_property from django.utils.timezone import make_aware, now from django.utils.translation import gettext_lazy as _ @@ -1032,7 +1033,11 @@ class SubEvent(EventMixin, LoggedModel): ordering = ("date_from", "name") def __str__(self): - return '{} - {}'.format(self.name, self.get_date_range_display()) + return '{} - {} {}'.format( + self.name, + self.get_date_range_display(), + date_format(self.date_from.astimezone(self.timezone), "TIME_FORMAT") if self.settings.show_times else "" + ).strip() def free_seats(self, ignore_voucher=None, sales_channel='web', include_blocked=False): from .orders import CartPosition, Order, OrderPosition diff --git a/src/pretix/control/templates/pretixcontrol/vouchers/index.html b/src/pretix/control/templates/pretixcontrol/vouchers/index.html index 280afef1f5..5ef613e4a4 100644 --- a/src/pretix/control/templates/pretixcontrol/vouchers/index.html +++ b/src/pretix/control/templates/pretixcontrol/vouchers/index.html @@ -171,7 +171,12 @@ {% if v.seat %}
{{ v.seat }}{% endif %} {% if request.event.has_subevents %} - {{ v.subevent.name }} – {{ v.subevent.get_date_range_display }} + + {{ v.subevent.name }} – {{ v.subevent.get_date_range_display }} + {% if request.event.settings.show_times %} + {{ v.subevent.date_from|date:"TIME_FORMAT" }} + {% endif %} + {% endif %} {% trans "Voucher redemption" %} {% if subevent %}

{{ subevent.name }}

+ {% with ev=subevent %} +
+ +

+ {{ ev.get_date_range_display }} + {% if event.settings.show_times %} +
+ {% blocktrans trimmed with time=ev.date_from|date:"TIME_FORMAT" %} + Begin: {{ time }} + {% endblocktrans %} + {% if event.settings.show_date_to and ev.date_to %} +
+ {% blocktrans trimmed with time=ev.date_to|date:"TIME_FORMAT" %} + End: {{ time }} + {% endblocktrans %} + {% endif %} + {% endif %} + {% if ev.date_admission %} +
+ {% 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 %} +
+ {% if subevent %} +
+ {% else %} + + {% endif %} + {% trans "Add to Calendar" %} + +

+
+ {% endwith %} {% endif %} +

{% blocktrans trimmed %} You entered a voucher code that allows you to buy one of the following products at the specified price: