Files
pretix_cgo/src/pretix/presale/templates/pretixpresale/event/index.html
Richard Schreiber 3dcfa57b70 A11y improvements (#2081)
Co-authored-by: Raphael Michel <michel@rami.io>
Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
2021-10-17 16:56:16 +02:00

353 lines
19 KiB
HTML

{% extends "pretixpresale/event/base.html" %}
{% load i18n %}
{% load l10n %}
{% load eventurl %}
{% load cache_large %}
{% load money %}
{% load thumb %}
{% load eventsignal %}
{% load rich_text %}
{% block title %}
{% if "year" in request.GET %}
{% if list_type == "calendar" %}
{% blocktrans with datetime=date|date:"F Y" %}
Calendar for {{ datetime }}
{% endblocktrans %} ::
{% elif list_type == "week" %}
{% blocktrans with datetime=date|date:week_format %}
Calendar for {{ datetime }}
{% endblocktrans %} ::
{% endif %}
{% elif subevent %}
{{ subevent.get_date_range_display }} ::
{% endif %}
{% endblock %}
{% block custom_header %}
{{ block.super }}
<meta property="og:title" content="{{ ev.name }}" />
<meta property="og:description" content="{{ ev.get_date_range_display }}" />
{% if subevent %}
<meta property="og:url" content="{% abseventurl request.event "presale:event.index" subevent=subevent.pk %}" />
{% else %}
<meta property="og:url" content="{% abseventurl request.event "presale:event.index" %}" />
{% endif %}
{% endblock %}
{% block content %}
{% autoescape off %}
<script type="application/ld+json">
{{ ev.event_microdata }}
</script>
{% endautoescape %}
<main aria-label="{% if show_cart %}{% trans "Your cart, general information, add products to your cart" %}{% else %}{% trans "General information, add products to your cart" %}{% endif %}">
{% if show_cart %}
{% include "pretixpresale/event/fragment_cart_box.html" with open=1 %}
{% endif %}
{% if request.event.has_subevents %}
{% if not subevent %}
{% if event_logo and event_logo_show_title %}
<h2 class="content-header">
{{ event.name }}
</h2>
{% endif %}
{% if frontpage_text %}
<div>
{{ frontpage_text|rich_text }}
</div>
{% endif %}
{% if request.GET.voucher %}
<div class="alert alert-info">
<p>{% trans "Please select a date to redeem your voucher." %}</p>
</div>
{% endif %}
{% endif %}
{% if subevent and "year" not in request.GET %}
<p>
{% if show_cart %}
<button class="subevent-toggle btn btn-primary btn-block btn-lg" aria-expanded="false">
<span class="fa fa-reply" aria-hidden="true"></span>
{% trans "Add tickets for a different date" %}
</button>
{% else %}
<button class="subevent-toggle btn btn-default btn-block" aria-expanded="false">
{% trans "View other date" %}
</button>
{% endif %}
</p>
{% else %}
<h3>{% trans "Choose date to book a ticket" %}</h3>
{% endif %}
<div class="panel panel-default subevent-list" id="subevent-list">
<div class="panel-heading">
{% if subevent %}
{% trans "Other dates" context "subevent" %}
{% else %}
{% trans "Dates" context "subevent" %}
{% endif %}
</div>
<div class="panel-body">
<div>
{% cache_large 15 subevent_list subevent_list_cache_key %}
{% if subevent_list.list_type == "calendar" %}
{% include "pretixpresale/event/fragment_subevent_calendar.html" %}
{% elif subevent_list.list_type == "week" %}
{% include "pretixpresale/event/fragment_subevent_calendar_week.html" %}
{% else %}
{% include "pretixpresale/event/fragment_subevent_list.html" %}
{% endif %}
{% endcache_large %}
</div>
</div>
</div>
{% if subevent %}
<h2 class="subevent-head">{{ subevent.name }}</h2>
{% if frontpage_text %}
<div>
{{ frontpage_text|rich_text }}
</div>
{% endif %}
{% endif %}
{% else %}
{% if event_logo and event_logo_show_title %}
<h2 class="content-header">
{{ event.name }}
{% if request.event.settings.show_dates_on_frontpage %}
<small>{{ event.get_date_range_display_as_html }}</small>
{% endif %}
</h2>
{% endif %}
{% if frontpage_text %}
<div>
{{ frontpage_text|rich_text }}
</div>
{% endif %}
{% endif %}
{% if subevent or not event.has_subevents %}
{% if not ev.presale_is_running %}
<div class="alert alert-info">
{% if ev.presale_has_ended %}
{% 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 %}
{% with date=ev.effective_presale_start|date:"SHORT_DATE_FORMAT" date_normalized=ev.effective_presale_start|date:"Y-m-d" %}
{% with time=ev.effective_presale_start|time:"TIME_FORMAT" time_24h=ev.effective_presale_start|time:"H:i" %}
<span data-time="{{ ev.effective_presale_start.isoformat }}" data-timezone="{{ request.event.timezone }}">
{% blocktrans trimmed with date="<time datetime='"|add:date_normalized|add:"'>"|add:date|add:"</time>"|safe time="<time datetime='"|add:time_24h|add:"'>"|add:time|add:"</time>"|safe %}
The presale for this event will start on {{ date }} at {{ time }}.
{% endblocktrans %}
</span>
{% endwith %}
{% endwith %}
{% else %}
{% blocktrans trimmed %}
The presale for this event has not yet started.
{% endblocktrans %}
{% endif %}
</div>
{% endif %}
{% if not cart_namespace or subevent %}
<div>
{% if ev.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 %}
</div>
{% eventsignal event "pretix.presale.signals.front_page_top" request=request subevent=subevent %}
{% endif %}
{% if ev.presale_is_running or event.settings.show_items_outside_presale_period %}
<form method="post" data-asynctask
data-asynctask-headline="{% trans "We're now trying to reserve this for you!" %}"
data-asynctask-text="{% blocktrans with time=event.settings.reservation_time %}Once the items are in your cart, you will have {{ time }} minutes to complete your purchase.{% endblocktrans %}"
class="{% if event.seating_plan_id %}has-seating{% endif %}"
action="{% eventurl request.event "presale:event.cart.add" cart_namespace=cart_namespace %}?next={{ cart_redirect|urlencode }}&next_error={{ request.path|urlencode }}">
{% csrf_token %}
<input type="hidden" name="subevent" value="{{ subevent.id|default_if_none:"" }}" />
{% if ev.seating_plan_id and event.settings.seating_choice %}
{% if event.has_subevents %}
{% eventsignal event "pretix.presale.signals.render_seating_plan" request=request subevent=subevent %}
{% else %}
{% eventsignal event "pretix.presale.signals.render_seating_plan" request=request %}
{% endif %}
{% endif %}
{% if waitinglist_seated %}
<aside class="front-page" aria-labelledby="waiting-list">
<h3 id="waiting-list">{% trans "Waiting list" %}</h3>
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p>
{% blocktrans trimmed %}
Some of the categories in the seating plan above are currently sold out. If you want, you can add yourself to the
waiting list. We will then notify if seats are available again.
{% endblocktrans %}
</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="{% eventurl event "presale:event.waitinglist" cart_namespace=cart_namespace|default_if_none:"" %}{% if subevent %}?subevent={{ subevent.pk }}{% endif %}" class="btn btn-default btn-block">
<span class="fa fa-plus-circle" aria-hidden="true"></span>
{% trans "Join waiting list" %}
</a>
</div>
<div class="clearfix"></div>
</div>
</aside>
{% endif %}
{% include "pretixpresale/event/fragment_product_list.html" %}
{% if ev.presale_is_running and display_add_to_cart %}
<div class="front-page">
<div class="row">
<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">
{% if request.event.settings.redirect_to_checkout_directly %}
{% if allfree %}
<i class="fa fa-check" aria-hidden="true"></i> {% trans "Register" context "free_tickets" %}
{% else %}
<i class="fa fa-shopping-cart" aria-hidden="true"></i> {% trans "Proceed with checkout" %}
{% endif %}
{% else %}
<i class="fa fa-shopping-cart" aria-hidden="true"></i> {% trans "Add to cart" %}
{% endif %}
</button>
</div>
<div class="clearfix"></div>
</div>
</div>
{% endif %}
</form>
{% endif %}
{% endif %}
</main>
{% if show_vouchers %}
<aside class="front-page" aria-labelledby="redeem-a-voucher">
<h3 id="redeem-a-voucher">{% trans "Redeem a voucher" %}</h3>
{% if event.settings.voucher_explanation_text %}
<div>
{{ event.settings.voucher_explanation_text|rich_text }}
</div>
{% endif %}
<form method="get" action="{% eventurl event "presale:event.redeem" cart_namespace=cart_namespace %}">
<div class="row row-voucher">
<div class="col-md-8 col-sm-6 col-xs-12">
<label for="voucher" class="sr-only">{% trans "Voucher code" %}
{% if "voucher_invalid" in request.GET %}<strong>{% trans "has error" context "form" %},</strong>{% endif %}
<i>{% trans "required" context "form" %}</i></label>
<div class="input-group{% if "voucher_invalid" in request.GET %} has-error{% endif %}">
<span class="input-group-addon"><i class="fa fa-ticket fa-fw" aria-hidden="true"></i></span>
<input type="text" class="form-control{% if "voucher_invalid" in request.GET %} has-error{% endif %}" name="voucher" id="voucher"
{% if "voucher_invalid" in request.GET %} aria-describedby="error-message"{% endif %}
placeholder="{% trans "Voucher code" %}" required="required">
</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" %}
</button>
</div>
<div class="clearfix"></div>
</div>
</form>
</aside>
{% endif %}
{% if not cart_namespace %}
{% eventsignal event "pretix.presale.signals.front_page_bottom" subevent=subevent request=request %}
<aside class="front-page" aria-labelledby="if-you-already-ordered-a-ticket">
<h3 id="if-you-already-ordered-a-ticket">{% trans "If you already ordered a ticket" %}</h3>
<div class="row">
<div class="col-md-8 col-xs-12">
<p>
{% blocktrans trimmed %}
If you want to see or change the status and details of your order, click on the link in one of the
emails we sent you during the order process. If you cannot find the link, click on the
following button to request the link to your order to be sent to you again.
{% endblocktrans %}
</p>
</div>
<div class="col-md-4 col-xs-12">
<a class="btn btn-block btn-default" href="{% eventurl event "presale:event.resend_link" %}">
{% trans "Resend order links" %}
</a>
</div>
<div class="clearfix"></div>
</div>
</aside>
{% else %}
{% eventsignal event "pretix.presale.signals.front_page_bottom_widget" subevent=subevent request=request %}
{% endif %}
{% endblock %}