From 008ecbd3ed13257ab9d92374b06c6a2ffb162d2f Mon Sep 17 00:00:00 2001 From: gitadmin Date: Thu, 25 Dec 2025 23:20:23 +0300 Subject: [PATCH] =?UTF-8?q?[=D0=92=D0=9E=D0=9B=D0=9A]=20=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D1=83=D0=B5=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=BA=D1=82=D0=B0=20=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=B0=D1=82=D1=8B=20=D0=BF=D1=83=D0=B1=D0=BB=D0=B8=D0=BA=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BB=D0=BE=D1=89=D0=B0=D0=B4=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_edit.py | 13 ++++++++---- templates/edit_category.html | 39 +++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/db_edit.py b/db_edit.py index b4ba391..6bf67e0 100644 --- a/db_edit.py +++ b/db_edit.py @@ -1306,15 +1306,17 @@ def api_create_category(): data = request.json with db.conn.cursor() as cursor: cursor.execute(""" - INSERT INTO categories (ID, TITLE, description, image_url, tg_id, marked_for_publication) - VALUES (%s, %s, %s, %s, %s, %s) + INSERT INTO categories (ID, TITLE, description, image_url, tg_id, marked_for_publication, is_tg_published, tg_published_date) + VALUES (%s, %s, %s, %s, %s, %s, %s, %s) """, ( data.get('id'), data.get('title', ''), data.get('description', ''), data.get('image_url', ''), data.get('tg_id'), - bool(data.get('marked_for_publication', False)) + bool(data.get('marked_for_publication', False)), + bool(data.get('is_tg_published', False)), + data.get('tg_published_date') or None )) db.conn.commit() client_ip = get_client_ip() @@ -1356,7 +1358,8 @@ def api_update_category(category_id): # Обновляем категорию, включая ID если он изменился cursor.execute(""" UPDATE categories - SET ID = %s, TITLE = %s, description = %s, image_url = %s, tg_id = %s, marked_for_publication = %s + SET ID = %s, TITLE = %s, description = %s, image_url = %s, tg_id = %s, + marked_for_publication = %s, is_tg_published = %s, tg_published_date = %s WHERE AUTO_ID = %s """, ( new_id, @@ -1365,6 +1368,8 @@ def api_update_category(category_id): data.get('image_url', ''), data.get('tg_id'), bool(data.get('marked_for_publication', False)), + bool(data.get('is_tg_published', False)), + data.get('tg_published_date') or None, auto_id )) db.conn.commit() diff --git a/templates/edit_category.html b/templates/edit_category.html index dd9d190..9a91f29 100644 --- a/templates/edit_category.html +++ b/templates/edit_category.html @@ -122,6 +122,22 @@ + +
+ + +
+ + +
+
+ +
+
+ +
+
+