{% 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 %} {% 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 %} {% macro render_post(doc) %}
Картина не выбрана

{{doc.title}}

...

{% endmacro %} {% block content %} {{ header.section(user) }}
{{ profile_card.profile_card(user) }}
{{ profile_nav.profile_nav(user, 'invitation') }}
{% if doc.get('exhibition')%}
{{doc.type}}

{{ doc.title }}

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

Место проведения: {{ doc.get('exhibition').get('place') }}

С {{ ( doc.get('exhibition').datetime_start.strftime('%d.%m.%Y')) if doc.get('exhibition').datetime_start else ''}} По {{ ( doc.get('exhibition').date_finish.strftime('%d.%m.%Y')) if doc.get('exhibition').date_finish else ''}}
{{render_links(doc)}}

Картин выбрано: 0

{% set user_contact = doc.get('user') %} {{ render_user_contacts(user_contact) }}

{{ (doc._id.generation_time.strftime('%d.%m.%Y')) if doc._id else ''}}

{% for post in doc.get('posts')%} {{render_post(post)}} {% endfor %} {%endif%} {% if doc.get('type_')=='paint' %} {% 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 %} {% endif %}
{{ footer.section(user) }} {% endblock %} {% macro render_user_contacts(user) %}
{% if user %} {{ user.username | e }}

{{ user.username | e }}

{% endif %}
{% endmacro %} {% macro render_links(doc) %} {% if doc.get('exhibition')%} {% if doc.get('exhibition').get('tizer_file_id') or doc.get('exhibition').get('tizer_link') %} Релиз выставки {%endif%} Условия выставки {%endif%} {% endmacro %} {% block head %} {{ header.style() }} {{ profile_nav.style() }} {{ footer.style() }} {% endblock %}