Добавлена ветка prod_prep
This commit is contained in:
@@ -15,7 +15,7 @@ def get_dates_keyboard():
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text=day.strftime("%d.%m"),
|
||||
callback_data=f"date_{day.strftime('%d.%m')}"
|
||||
callback_data=f"date_{day.strftime('%d.%m.%Y')}"
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -23,4 +23,4 @@ def get_dates_keyboard():
|
||||
buttons.append(get_back_button())
|
||||
return InlineKeyboardMarkup(
|
||||
inline_keyboard=buttons
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
"""Masters keyboard with specialty filtering."""
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from app.config import MASTERS
|
||||
|
||||
|
||||
from app.keyboards.back import get_back_button
|
||||
|
||||
|
||||
def get_masters_keyboard():
|
||||
buttons = [
|
||||
[InlineKeyboardButton(text=name, callback_data=key)]
|
||||
for key, name in MASTERS.items()
|
||||
]
|
||||
def get_masters_keyboard(service_key=None):
|
||||
buttons = []
|
||||
svc_cats = {
|
||||
"service_massage": "massage",
|
||||
"service_spa": "spa",
|
||||
"service_cosmetology": "cosmetology",
|
||||
}
|
||||
for key, master in MASTERS.items():
|
||||
if service_key and "specialty" in master:
|
||||
needed = svc_cats.get(service_key, "")
|
||||
if needed and needed not in master["specialty"]:
|
||||
continue
|
||||
buttons.append([InlineKeyboardButton(text=master["name"], callback_data=key)])
|
||||
buttons.append(get_back_button())
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
"""Main menu keyboard."""
|
||||
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
|
||||
|
||||
menu = ReplyKeyboardMarkup(
|
||||
keyboard=[
|
||||
[KeyboardButton(text="📋 Услуги"),
|
||||
KeyboardButton(text="📅 Записаться")],
|
||||
[KeyboardButton(text="👤 Профиль"),
|
||||
KeyboardButton(text="📄 Мои записи")],
|
||||
[KeyboardButton(text="📞 Контакты"),
|
||||
KeyboardButton(text="ℹ️ О нас")],
|
||||
[KeyboardButton(text="\U0001f4cb \u0423\u0441\u043b\u0443\u0433\u0438"),
|
||||
KeyboardButton(text="\U0001f4c5 \u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f")],
|
||||
[KeyboardButton(text="\U0001f464 \u041f\u0440\u043e\u0444\u0438\u043b\u044c"),
|
||||
KeyboardButton(text="\U0001f4c4 \u041c\u043e\u0438 \u0437\u0430\u043f\u0438\u0441\u0438")],
|
||||
[KeyboardButton(text="\U0001f4de \u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b"),
|
||||
KeyboardButton(text="\u2139\ufe0f \u041e \u043d\u0430\u0441")],
|
||||
],
|
||||
resize_keyboard=True,
|
||||
input_field_placeholder="Выберите действие..."
|
||||
input_field_placeholder="\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435..."
|
||||
)
|
||||
|
||||
cancel_menu = ReplyKeyboardMarkup(
|
||||
keyboard=[
|
||||
[KeyboardButton(text="❌ Отмена")]
|
||||
[KeyboardButton(text="\u274c \u041e\u0442\u043c\u0435\u043d\u0430")]
|
||||
],
|
||||
resize_keyboard=True
|
||||
)
|
||||
|
||||
+10
-15
@@ -1,33 +1,28 @@
|
||||
"""Services keyboard with price & duration."""
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from app.config import SERVICES
|
||||
|
||||
|
||||
from app.keyboards.back import get_back_button
|
||||
|
||||
|
||||
def get_services_keyboard():
|
||||
buttons = [
|
||||
[InlineKeyboardButton(text=name, callback_data=key)]
|
||||
for key, name in SERVICES.items()
|
||||
]
|
||||
buttons = []
|
||||
for key, svc in SERVICES.items():
|
||||
label = svc["emoji"] + " " + svc["name"] + " - " + str(svc["price"]) + "\u20bd / " + str(svc["duration"]) + "\u043c\u0438\u043d"
|
||||
buttons.append([InlineKeyboardButton(text=label, callback_data=key)])
|
||||
buttons.append(get_back_button())
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
|
||||
def get_extra_services_keyboard(already_selected: list[str] | None = None):
|
||||
"""Keyboard for selecting extra services. Shows ticked/unticked."""
|
||||
def get_extra_services_keyboard(already_selected=None):
|
||||
if already_selected is None:
|
||||
already_selected = []
|
||||
|
||||
buttons = []
|
||||
for key, name in SERVICES.items():
|
||||
if name in already_selected:
|
||||
label = "\u2705 " + name
|
||||
for key, svc in SERVICES.items():
|
||||
if svc["name"] in already_selected:
|
||||
label = "\u2705 " + svc["emoji"] + " " + svc["name"]
|
||||
else:
|
||||
label = name
|
||||
label = svc["emoji"] + " " + svc["name"]
|
||||
buttons.append([InlineKeyboardButton(text=label, callback_data="extra_" + key)])
|
||||
|
||||
# Done button
|
||||
buttons.append([InlineKeyboardButton(text="\u2705 \u0413\u043e\u0442\u043e\u0432\u043e", callback_data="extra_done")])
|
||||
buttons.append(get_back_button())
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
Reference in New Issue
Block a user