From bdb2dcf263cf59feb9d71cc49d76013c2fc5bb87cddca4cbc736304f4bd6bd53 Mon Sep 17 00:00:00 2001 From: vladislav Date: Thu, 3 Sep 2026 21:04:32 -0400 Subject: [PATCH] refactor --- templates/components/contacts.html | 52 ++++ templates/exhibitions.html | 211 +++++-------- templates/profile/delivery_history.html | 330 ++++---------------- templates/profile/delivery_old.html | 360 +++++----------------- templates/profile/exhibition.html | 71 +---- templates/profile/invitation.html | 51 +-- templates/profile/invitations.html | 47 +-- templates/profile/partner/exhibition.html | 52 +--- 8 files changed, 280 insertions(+), 894 deletions(-) create mode 100644 templates/components/contacts.html diff --git a/templates/components/contacts.html b/templates/components/contacts.html new file mode 100644 index 0000000..2c91a83 --- /dev/null +++ b/templates/components/contacts.html @@ -0,0 +1,52 @@ +{% macro details(user) -%} +
+ Показать контакты + +
+{%- endmacro %} + +{% macro style() -%} + +{%- endmacro %} \ No newline at end of file diff --git a/templates/exhibitions.html b/templates/exhibitions.html index 1d7e02b..747d0cd 100644 --- a/templates/exhibitions.html +++ b/templates/exhibitions.html @@ -1,11 +1,11 @@ {% extends "base.html" %} {% import "/components/header.html" as header %} {% import "/components/footer.html" as footer %} +{% import "/components/contacts.html" as contacts %} {% import "components/share.html" as share %} {% block title %}Выставки{% endblock %} - {% block content %} {{ header.section(user) }}
@@ -16,121 +16,70 @@
{% for exhibition in exhibitions %} - {% set link="/exhibition/{}".format(exhibition._id) %} -
- {% if link %} - - {% endif %} -
- - {{ exhibition.title }} - -
- {% if link %} -
- {% endif %} -
- {% if link %} - - {% endif %} -
- {% if now > exhibition.date_finish %} - Закончилась - {% elif now > exhibition.datetime_start %} - Началась - {% else %} - Формируется - {% endif %} -
-
-

{{ exhibition.title }}

-
-

{{ exhibition.topic }}

- {% if link %} -
- {% endif %} - {% set creator = exhibition.get('user') %} - {% if creator %} -
- {{ creator.username | e }} -
-

{{ creator.username | e }}

+ {% set link="/exhibition/{}".format(exhibition._id) %} +
+ {% if link %}{% endif %} +
+ + {{ exhibition.title }} + +
+ {% if link %}
{% endif %} +
+ {% if link %}{% endif %} +
+ {% if now > exhibition.date_finish %} + Закончилась + {% elif now > exhibition.datetime_start %} + Началась + {% else %} + Формируется + {% endif %} +
+
+

{{ exhibition.title }}

+
+

{{ exhibition.topic }}

+ {% if link %}
{% endif %} + {% set creator = exhibition.get('user') %} + {% if creator %} +
+ {{ creator.username | e }} +
+

{{ creator.username | e }}

+
+
+ {{ contacts.details(creator) }} + {% endif %} + {% if exhibition.get('tizer_file_id') or exhibition.get('tizer_link') %} + + Релиз выставки + + {%endif%} + + Список картин + +

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

+
+ С {{ ( exhibition.datetime_start.strftime('%d.%m.%Y')) if + exhibition.datetime_start else ''}} + По {{ ( exhibition.date_finish.strftime('%d.%m.%Y')) if + exhibition.date_finish else ''}} +
+
+ + {{ share.share('/exhibition/{}'.format(exhibition._id), exhibition.title, + '/b/exhibition/{}'.format(exhibition.poster_file_id), "Приглашаем на выставку") }} + +
+

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

-
-
- Показать контакты - -
-{% endif %} - {% if exhibition.get('tizer_file_id') or exhibition.get('tizer_link') %} - - Релиз выставки - - {%endif%} - - Список картин - -

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

-
- С {{ ( exhibition.datetime_start.strftime('%d.%m.%Y')) if exhibition.datetime_start else ''}} - По {{ ( exhibition.date_finish.strftime('%d.%m.%Y')) if exhibition.date_finish else ''}} -
- -
- - {{ share.share('/exhibition/{}'.format(exhibition._id), exhibition.title, '/b/exhibition/{}'.format(exhibition.poster_file_id), "Приглашаем на выставку") }} - -
- -

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

-
-
+ {% endfor %}
@@ -139,27 +88,10 @@ {% block head %} {{ header.style() }} - - {{ footer.style() }} {% endblock %} \ No newline at end of file diff --git a/templates/profile/invitation.html b/templates/profile/invitation.html index 94197d9..9fa2898 100644 --- a/templates/profile/invitation.html +++ b/templates/profile/invitation.html @@ -3,6 +3,7 @@ {% import "/components/footer.html" as footer %} {% import "components/profile_card.html" as profile_card %} {% import "components/profile_nav.html" as profile_nav %} +{% import "/components/contacts.html" as contacts %} {% block title %}Приглашения{% endblock %} @@ -742,45 +743,7 @@ document.getElementById('delivery_type')?.addEventListener('change', toggleTrack {% endif %} -
- Показать контакты - -
+{{ contacts.details(user) }} {% endmacro %} {% macro render_links(doc) %} {% if doc.get('exhibition')%} @@ -793,6 +756,7 @@ document.getElementById('delivery_type')?.addEventListener('change', toggleTrack {% block head %} {{ header.style() }} {{ profile_nav.style() }} +{{ contacts.style() }}