diff --git a/templates/profile/invitation.html b/templates/profile/invitation.html index 913f1cf..f716bdf 100644 --- a/templates/profile/invitation.html +++ b/templates/profile/invitation.html @@ -7,6 +7,90 @@ {% 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) %}
@@ -50,49 +134,253 @@ {% block content %} {{ header.section(user) }}
-
- {{ profile_card.profile_card(user) }} -
- {{ profile_nav.profile_nav(user, 'invitation') }} -
-
-
-
- {{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 %} +
+{{ 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 %} +
+
+