product management, unification of kb and so on.
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
from typing import Optional
|
||||
from typing import Optional, Callable
|
||||
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from aiogram.utils.keyboard import InlineKeyboardBuilder
|
||||
|
||||
placeholder_kb = InlineKeyboardBuilder(
|
||||
[[InlineKeyboardButton(text="🍃", callback_data="...")]]
|
||||
main_menu: InlineKeyboardMarkup = InlineKeyboardBuilder(
|
||||
[
|
||||
[InlineKeyboardButton(text="📦 Изменить товары", callback_data="cat:root")],
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="📜 Изменить категории", callback_data="edit:categories"
|
||||
)
|
||||
],
|
||||
# [InlineKeyboardButton(text="", callback_data="")],
|
||||
]
|
||||
).as_markup()
|
||||
|
||||
|
||||
def back_to_product_kb(product_id: int, *, cb_factory: Callable[[int], str]):
|
||||
return InlineKeyboardBuilder(
|
||||
[[InlineKeyboardButton(text="⬅️", callback_data=cb_factory(product_id))]]
|
||||
).as_markup()
|
||||
|
||||
|
||||
def customer_contacts(
|
||||
user_id: int, has_mention: bool, mention: Optional[str] = None
|
||||
) -> InlineKeyboardMarkup:
|
||||
@@ -44,3 +58,26 @@ def verify_payment(invoice_id: int):
|
||||
]
|
||||
]
|
||||
).as_markup()
|
||||
|
||||
|
||||
def edit_product(product_id: int, category_id: int):
|
||||
prefix = f"edit_product:{product_id}"
|
||||
return InlineKeyboardBuilder(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="✍️ Название", callback_data=f"{prefix}:name"
|
||||
),
|
||||
InlineKeyboardButton(
|
||||
text="✍️ Описание",
|
||||
callback_data=f"{prefix}:description",
|
||||
),
|
||||
],
|
||||
[InlineKeyboardButton(text="💸 Цена", callback_data=f"{prefix}:price")],
|
||||
[
|
||||
InlineKeyboardButton(text="👁️", callback_data=f"{prefix}:hide"),
|
||||
InlineKeyboardButton(text="❌", callback_data=f"{prefix}:delete"),
|
||||
],
|
||||
[InlineKeyboardButton(text="⬅️", callback_data=f"cat:{category_id}")],
|
||||
]
|
||||
).as_markup()
|
||||
|
||||
Reference in New Issue
Block a user