byceps/blueprints/site/shop/orders/templates/site/shop/orders/view.html
{% extends 'layout/base.html' %}
{% from 'macros/icons.html' import render_icon %}
{% from 'macros/misc.html' import render_notification %}
{% from 'macros/shop/orders.html' import render_order_payment_state, render_order_overdue_tag %}
{% set current_page = 'shop_orders' %}
{% set page_title = ['Bestellung', order.order_number] %}
{% block body %}
<nav class="breadcrumbs">
<ol>
<li>{{ _('Shop') }}</li>
<li><a href="{{ url_for('.index') }}">{{ _('Your orders') }}</a></li>
</ol>
</nav>
<h1 class="title">{{ order.order_number }}</h1>
{%- if cancellation_request and cancellation_request.state.name != 'accepted' %}
{{ render_notification('Zu dieser Bestellung wurde am %s, %s Uhr eine Stornierung angefordert.'|format(cancellation_request.created_at|dateformat, cancellation_request.created_at|timeformat('short')), category='info') }}
{%- endif %}
<div class="main-body-box">
<div class="row row--space-between">
<div>
<div class="mb">
<div class="data-label">{{ _('Date') }}</div>
<div class="data-value">{{ order.created_at|dateformat }}, {{ order.created_at|timeformat('short') }}</div>
</div>
<div class="row mb">
<div>
<div class="data-label">{{ _('Payment state') }}</div>
<div class="data-value">{{ render_order_payment_state(order.payment_state) }} {{ render_order_overdue_tag(order) }}</div>
</div>
<div>
{%- if order.payment_method %}
<div class="data-label">{{ _('Payment method') }}</div>
<div class="data-value">{{ render_order_payment_method(order.payment_method) }}</div>
{%- endif %}
</div>
</div>
{%- if order.is_canceled %}
<div class="data-label">{{ _('Reason for cancellation') }}</div>
<div class="data-value">{{ order.cancellation_reason|fallback }}</div>
{%- endif %}
</div>
<div>
{%- if order.is_open %}
<div class="button-row is-compact is-right-aligned">
<a class="button" href="{{ url_for('.cancel_form', order_id=order.id) }}">{{ render_icon('remove') }} <span>{{ _('Cancel order') }}</span></a>
</div>
{%- endif %}
</div>
</div>
</div>
{%- if order.is_open %}
<h2>{{ _('Payment notes') }}</h2>
{%- if payment_instructions %}
<div class="main-body-box">
{{ payment_instructions|safe }}
</div>
{%- else %}
{{ render_notification(_('Payment instructions not found.'), category='danger', icon='warning') }}
{%- endif %}
{%- endif %}
<h2>{{ _('Billing and shipping address') }}</h2>
<div class="main-body-box">
{%- if order.company %}
<div class="data-label">{{ _('Company') }}</div>
<div class="data-value">{{ order.company }}</div>
{%- endif %}
<div class="data-label">{{ _('Full name') }}</div>
<div class="data-value">{{ order.first_name }} {{ order.last_name }}</div>
<div class="data-label">{{ _('Address') }}</div>
<div class="data-value">
{{ order.address.street }}<br>
{{ order.address.zip_code }} {{ order.address.city }}<br>
{{ order.address.country }}
</div>
</div>
<h2>{{ _('Articles') }}</h2>
{% include 'site/shop/orders/_articles.html' %}
{%- if order.is_paid and not cancellation_request %}
<h2>{{ _('Cancellation') }}</h2>
<div><a class="button" href="{{ url_for('.request_cancellation_choices', order_id=order.id) }}"><span>Tickets zurückgeben</span> {{ render_icon('chevron-right') }}</a></div>
{%- endif %}
{%- endblock %}