Refactor TelegramManager and improve frontend article display
- Simplified inline keyboard button creation in TelegramManager for better readability. - Adjusted the structure of the keyboard arrays to ensure proper formatting. - Enhanced Articles.vue by cleaning up the layout and ensuring consistent spacing and alignment. - Improved the handling of article display properties for better user experience.
This commit is contained in:
@@ -117,8 +117,8 @@ class TelegramManager:
|
||||
|
||||
# Crear botones inline para el primer mensaje del grupo
|
||||
if is_favorite:
|
||||
keyboard = [
|
||||
[
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton("✅ En favoritos", callback_data=f"already_fav_{article.get_platform()}_{article.get_id()}"),
|
||||
InlineKeyboardButton("🗑️ Quitar", callback_data=f"unfav_{article.get_platform()}_{article.get_id()}")
|
||||
],
|
||||
@@ -130,9 +130,9 @@ class TelegramManager:
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton("⭐ Añadir a favoritos", callback_data=f"fav_{article.get_platform()}_{article.get_id()}_{search_name}"),
|
||||
InlineKeyboardButton("Ir al anuncio", url=f"{article.get_url()}")
|
||||
]
|
||||
InlineKeyboardButton("Ir al anuncio", url=f"{article.get_url()}")
|
||||
]
|
||||
]
|
||||
reply_markup = InlineKeyboardMarkup(keyboard)
|
||||
|
||||
# Enviar un mensaje adicional con los botones (reply al primer mensaje del grupo)
|
||||
@@ -231,12 +231,12 @@ class TelegramManager:
|
||||
]
|
||||
]
|
||||
else:
|
||||
new_keyboard = [
|
||||
new_keyboard = [
|
||||
[
|
||||
InlineKeyboardButton("✅ En favoritos", callback_data=f"already_fav_{platform}_{article_id}"),
|
||||
InlineKeyboardButton("🗑️ Quitar", callback_data=f"unfav_{platform}_{article_id}")
|
||||
]
|
||||
]
|
||||
]
|
||||
await query.edit_message_reply_markup(
|
||||
reply_markup=InlineKeyboardMarkup(new_keyboard)
|
||||
)
|
||||
@@ -326,11 +326,11 @@ class TelegramManager:
|
||||
]
|
||||
]
|
||||
else:
|
||||
keyboard = [
|
||||
keyboard = [
|
||||
[
|
||||
InlineKeyboardButton("⭐ Añadir a favoritos", callback_data=f"fav_{platform}_{article_id}_Unknown")
|
||||
]
|
||||
]
|
||||
]
|
||||
await query.edit_message_reply_markup(
|
||||
reply_markup=InlineKeyboardMarkup(keyboard)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user