mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Voucher redemption: Display event title in some cases (#3519)
* Voucher redemption: Display event title in some cases (Z#23127871) * Remove unnecessary "with" statement * fix indentation --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% load eventurl %}
|
||||||
|
{% if ev.location and show_location %}
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="fa fa-map-marker fa-fw" aria-hidden="true" title="{% trans "Where does the event happen?" %}"></span>
|
||||||
|
<p><span class="sr-only">{% trans "Where does the event happen?" %}</span>
|
||||||
|
{{ ev.location|linebreaksbr }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if ev.settings.show_dates_on_frontpage %}
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="fa fa-clock-o fa-fw" aria-hidden="true" title="{% trans "When does the event happen?" %}"></span>
|
||||||
|
<p><span class="sr-only">{% trans "When does the event happen?" %}</span>
|
||||||
|
{{ ev.get_date_range_display_as_html }}
|
||||||
|
{% if event.settings.show_times %}
|
||||||
|
<br>
|
||||||
|
<span data-time="{{ ev.date_from.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
||||||
|
{% with time_human=ev.date_from|date:"TIME_FORMAT" time_24=ev.date_from|time:"H:i" %}
|
||||||
|
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
||||||
|
Begin: {{ time }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endwith %}
|
||||||
|
</span>
|
||||||
|
{% if event.settings.show_date_to and ev.date_to %}
|
||||||
|
<br>
|
||||||
|
<span data-time="{{ ev.date_to.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
||||||
|
{% with time_human=ev.date_to|date:"TIME_FORMAT" time_24=ev.date_to|time:"H:i" %}
|
||||||
|
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
||||||
|
End: {{ time }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endwith %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if ev.date_admission %}
|
||||||
|
<br>
|
||||||
|
{% if ev.date_admission|date:"SHORT_DATE_FORMAT" == ev.date_from|date:"SHORT_DATE_FORMAT" %}
|
||||||
|
<span data-time="{{ ev.date_admission.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
||||||
|
{% with time_human=ev.date_admission|date:"TIME_FORMAT" time_24=ev.date_admission|time:"H:i" %}
|
||||||
|
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
||||||
|
Admission: {{ time }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endwith %}
|
||||||
|
</span>
|
||||||
|
{% else %}
|
||||||
|
<span data-time="{{ ev.date_admission.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
||||||
|
{% with datetime_human=ev.date_admission|date:"SHORT_DATETIME_FORMAT" datetime_iso=ev.date_admission|time:"Y-m-d H:i" %}
|
||||||
|
{% blocktrans trimmed with datetime='<time datetime="'|add:datetime_iso|add:'">'|add:datetime_human|add:"</time>"|safe %}
|
||||||
|
Admission: {{ datetime }}
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endwith %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
<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>
|
||||||
|
{% endif %}
|
||||||
@@ -162,73 +162,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not cart_namespace or subevent %}
|
{% if not cart_namespace or subevent %}
|
||||||
<div>
|
<div>
|
||||||
{% if ev.location %}
|
{% include "pretixpresale/event/fragment_event_info.html" with event=request.event subevent=subevent ev=ev show_location=True %}
|
||||||
<div class="info-row">
|
|
||||||
<span class="fa fa-map-marker fa-fw" aria-hidden="true" title="{% trans "Where does the event happen?" %}"></span>
|
|
||||||
<p><span class="sr-only">{% trans "Where does the event happen?" %}</span>
|
|
||||||
{{ ev.location|linebreaksbr }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% if ev.settings.show_dates_on_frontpage %}
|
|
||||||
<div class="info-row">
|
|
||||||
<span class="fa fa-clock-o fa-fw" aria-hidden="true" title="{% trans "When does the event happen?" %}"></span>
|
|
||||||
<p><span class="sr-only">{% trans "When does the event happen?" %}</span>
|
|
||||||
{{ ev.get_date_range_display_as_html }}
|
|
||||||
{% if event.settings.show_times %}
|
|
||||||
<br>
|
|
||||||
<span data-time="{{ ev.date_from.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
|
||||||
{% with time_human=ev.date_from|date:"TIME_FORMAT" time_24=ev.date_from|time:"H:i" %}
|
|
||||||
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
|
||||||
Begin: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
</span>
|
|
||||||
{% if event.settings.show_date_to and ev.date_to %}
|
|
||||||
<br>
|
|
||||||
<span data-time="{{ ev.date_to.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
|
||||||
{% with time_human=ev.date_to|date:"TIME_FORMAT" time_24=ev.date_to|time:"H:i" %}
|
|
||||||
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
|
||||||
End: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if ev.date_admission %}
|
|
||||||
<br>
|
|
||||||
{% if ev.date_admission|date:"SHORT_DATE_FORMAT" == ev.date_from|date:"SHORT_DATE_FORMAT" %}
|
|
||||||
<span data-time="{{ ev.date_admission.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
|
||||||
{% with time_human=ev.date_admission|date:"TIME_FORMAT" time_24=ev.date_admission|time:"H:i" %}
|
|
||||||
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
|
||||||
Admission: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
</span>
|
|
||||||
{% else %}
|
|
||||||
<span data-time="{{ ev.date_admission.isoformat }}" data-timezone="{{ request.event.timezone }}">
|
|
||||||
{% with datetime_human=ev.date_admission|date:"SHORT_DATETIME_FORMAT" datetime_iso=ev.date_admission|time:"Y-m-d H:i" %}
|
|
||||||
{% blocktrans trimmed with datetime='<time datetime="'|add:datetime_iso|add:'">'|add:datetime_human|add:"</time>"|safe %}
|
|
||||||
Admission: {{ datetime }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
<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>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% eventsignal event "pretix.presale.signals.front_page_top" request=request subevent=subevent %}
|
{% eventsignal event "pretix.presale.signals.front_page_top" request=request subevent=subevent %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -13,63 +13,28 @@
|
|||||||
{% include "pretixpresale/event/fragment_cart_box.html" with open=request.GET.show_cart %}
|
{% include "pretixpresale/event/fragment_cart_box.html" with open=request.GET.show_cart %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h2>{% trans "Voucher redemption" %}</h2>
|
|
||||||
|
|
||||||
{% if subevent %}
|
{% if subevent %}
|
||||||
|
<h2>{% trans "Voucher redemption" %}</h2>
|
||||||
{% if request.GET.subevent and subevent.pk|stringformat:"i" != request.GET.subevent %}
|
{% if request.GET.subevent and subevent.pk|stringformat:"i" != request.GET.subevent %}
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "This voucher is valid only for the following specific date and time." %}
|
{% trans "This voucher is valid only for the following specific date and time." %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<h3>{{ subevent.name }}</h3>
|
<h3>{{ subevent.name }}</h3>
|
||||||
{% with ev=subevent %}
|
{% include "pretixpresale/event/fragment_event_info.html" with event=request.event subevent=subevent ev=subevent show_location=True %}
|
||||||
<div class="info-row">
|
{% else %}
|
||||||
<span class="fa fa-clock-o fa-fw" aria-hidden="true"></span>
|
{% if event_logo and event_logo_show_title %}
|
||||||
<p>
|
<h2 class="content-header">
|
||||||
{{ ev.get_date_range_display_as_html }}
|
{{ event.name }}
|
||||||
{% if event.settings.show_times %}
|
{% if request.event.settings.show_dates_on_frontpage %}
|
||||||
<br>
|
<small>{{ event.get_date_range_display_as_html }}</small>
|
||||||
{% with time_human=ev.date_from|date:"TIME_FORMAT" time_24=ev.date_from|time:"H:i" %}
|
{% endif %}
|
||||||
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
</h2>
|
||||||
Begin: {{ time }}
|
{% include "pretixpresale/event/fragment_event_info.html" with event=request.event subevent=None ev=request.event show_location=True %}
|
||||||
{% endblocktrans %}
|
<h3>{% trans "Voucher redemption" %}</h3>
|
||||||
{% endwith %}
|
{% else %}
|
||||||
{% if event.settings.show_date_to and ev.date_to %}
|
<h2>{% trans "Voucher redemption" %}</h2>
|
||||||
<br>
|
{% endif %}
|
||||||
{% with time_human=ev.date_to|date:"TIME_FORMAT" time_24=ev.date_to|time:"H:i" %}
|
|
||||||
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
|
||||||
End: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if ev.date_admission %}
|
|
||||||
<br>
|
|
||||||
{% if ev.date_admission|date:"SHORT_DATE_FORMAT" == ev.date_from|date:"SHORT_DATE_FORMAT" %}
|
|
||||||
{% with time_human=ev.date_admission|date:"TIME_FORMAT" time_24=ev.date_admission|time:"H:i" %}
|
|
||||||
{% blocktrans trimmed with time='<time datetime="'|add:time_24|add:'">'|add:time_human|add:"</time>"|safe %}
|
|
||||||
Admission: {{ time }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
{% else %}
|
|
||||||
{% with datetime_human=ev.date_admission|date:"SHORT_DATETIME_FORMAT" datetime_iso=ev.date_admission|time:"Y-m-d H:i" %}
|
|
||||||
{% blocktrans trimmed with datetime='<time datetime="'|add:datetime_iso|add:'">'|add:datetime_human|add:"</time>"|safe %}
|
|
||||||
Admission: {{ datetime }}
|
|
||||||
{% endblocktrans %}
|
|
||||||
{% endwith %}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
<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>
|
|
||||||
{% endwith %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user