{% extends "base.html" %} {% import "/components/header.html" as header %} {% import "/components/footer.html" as footer %} {% import "components/profile_card.html" as profile_card %} {% import "components/profile_nav.html" as profile_nav %} {% import "competition/list.html" as competition %} {% block title %}Где картины{% endblock %} {% macro render_doc(doc) %}
{% if doc.status == 'Ожидает отправки' %}
{{doc.status}}
{% elif doc.status == 'Получено' %}
{{doc.status}}
{% elif doc.status == 'Ожидает получения' %}
{{doc.status}}
{% else %}
{{doc.status}}
{% endif %} Посмотреть историю

{{doc.title}}

{% if doc.type == 'exhibition' and doc.get('exhibition') %}

{{doc.get('exhibition').title}}

Организатор {{doc.receiver.username}}
{% else %} {% if doc.address %}

Адрес: {{doc.address}}

{% endif %} {% if doc.back_address %}

Адрес для возврата: {{doc.back_address}}

{% endif %} {% if doc.delivery_type %}

Способ доставки: {{doc.delivery_type}}

{% endif %} {% if doc.track %}

Трэк-номер: {{doc.track}}

{% endif %} {% if doc.sender %}
Отправитель {{doc.sender.username}}
{% endif %} {% if doc.receiver %}
Получатель {{doc.receiver.username}} +7 *** *** {{ doc.receiver.phone[-4:] }}
{% endif %} {% if doc.status in ['Ожидает отправки', 'Возврат художнику'] and user._id == doc.sender._id%} {% endif %} {% if doc.status == 'Ожидает получения' and user._id == doc.receiver._id%} {% endif %} {% endif %}

{{ (doc._id.generation_time.strftime('%d.%m.%Y')) if doc._id else ''}} {{ '%02d' % ((doc._id.generation_time.hour + 3) % 24) if doc._id else '' }}:{{ '%02d' % doc._id.generation_time.minute if doc._id else '' }}

{% endmacro %} {% block content %} {{ header.section(user) }}
{{ profile_card.profile_card(user) }}
{{ profile_nav.profile_nav(user, 'delivery') }}
{% set statuses = ['Ожидает отправки', 'Возврат художнику'] %}

Фильтры

{% if data | selectattr('status', 'in', statuses) | list | length > 0 %}

Настройки отправки

Можно менять перед каждой отправкой картины

{% endif %}
{% for doc in data if doc.status in statuses %} {{ render_doc(doc) }} {% endfor %} {% for doc in data if doc.status not in statuses %} {{ render_doc(doc) }} {% endfor %}
{{ footer.section(user) }} {% endblock %} {% block head %} {{ header.style() }} {{ competition.style() }} {{ profile_nav.style() }} {{ footer.style() }} {% endblock %}