From 9feb131e986d59f619e27c160826a8b4a93bff51 Mon Sep 17 00:00:00 2001 From: gitadmin Date: Tue, 14 Oct 2025 17:04:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B5=D0=B9=D0=B4=D0=B6=D0=B5?= =?UTF-8?q?=D0=B9=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE=D0=B2=20=D0=B2=20?= =?UTF-8?q?=D0=B4=D0=B5=D1=82=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_edit.py | 22 ++++++++++++++++++++-- templates/index.html | 33 +++++++++++++++++++++++---------- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/db_edit.py b/db_edit.py index 0d14293..7d9201b 100644 --- a/db_edit.py +++ b/db_edit.py @@ -1177,11 +1177,21 @@ def api_get_linked_events(post_id): events = db.get_linked_events(post_id) events_list = [] for event in events: + # Определяем статус события + status = "Не видим" + if event.get('is_posted_tg'): + status = "Опубликован" + elif event.get('marked_to_publication'): + status = "Для публикации" + elif event.get('is_visible'): + status = "Видим" + events_list.append({ 'id': event['id'], 'name': event['name'], 'number': event['number'], - 'unit_name': event['unit_name'] + 'unit_name': event['unit_name'], + 'status': status }) return jsonify(events_list) except Exception as e: @@ -1197,11 +1207,19 @@ def api_get_linked_posts(event_id): posts = db.get_linked_posts(event_id) posts_list = [] for post in posts: + # Определяем статус поста + status = "Не для публикации" + if post.get('published_in_tg'): + status = "Опубликован" + elif post.get('marked_for_publication'): + status = "Для публикации" + posts_list.append({ 'id': post['id'], 'vk_post_id': post['vk_post_id'], 'shortname': post['shortname'], - 'text_preview': post['text'][:50] + '...' if post['text'] else '' + 'text_preview': post['text'][:50] + '...' if post['text'] else '', + 'status': status }) return jsonify(posts_list) except Exception as e: diff --git a/templates/index.html b/templates/index.html index 61ca799..77df338 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1554,11 +1554,17 @@ ${linkedPosts.map(post => ` - ${post.shortname || `Пост ${post.id}`} - +
+
+ ${post.shortname || `Пост ${post.id}`} + ${post.status} +
+ +
`).join('')} @@ -1935,11 +1941,18 @@ ${linkedEvents.map(event => ` - ${event.name || `Событие ${event.id}`} - +
+
+ ${event.name || `Событие ${event.id}`} + ${event.status} +
+ +
`).join('')}