mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Allow to set a custom error message when presale is ended
This commit is contained in:
@@ -110,9 +110,13 @@
|
||||
{% 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 %}
|
||||
{% if event.settings.presale_has_ended_text %}
|
||||
{{ event.settings.presale_has_ended_text|rich_text }}
|
||||
{% else %}
|
||||
{% blocktrans trimmed %}
|
||||
The presale period for this event is over.
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% 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 }}.
|
||||
|
||||
@@ -437,7 +437,10 @@ class WidgetAPIProductList(EventListMixin, View):
|
||||
|
||||
if not ev.presale_is_running:
|
||||
if ev.presale_has_ended:
|
||||
data['error'] = ugettext('The presale period for this event is over.')
|
||||
if request.event.settings.presale_has_ended_text:
|
||||
data['error'] = str(request.event.settings.presale_has_ended_text)
|
||||
else:
|
||||
data['error'] = ugettext('The presale period for this event is over.')
|
||||
elif request.event.settings.presale_start_show_date:
|
||||
data['error'] = ugettext('The presale for this event will start on %(date)s at %(time)s.') % {
|
||||
'date': date_format(ev.presale_start.astimezone(request.event.timezone), "SHORT_DATE_FORMAT"),
|
||||
|
||||
Reference in New Issue
Block a user