29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
"""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 = []
|
|
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=None):
|
|
if already_selected is None:
|
|
already_selected = []
|
|
buttons = []
|
|
for key, svc in SERVICES.items():
|
|
if svc["name"] in already_selected:
|
|
label = "\u2705 " + svc["emoji"] + " " + svc["name"]
|
|
else:
|
|
label = svc["emoji"] + " " + svc["name"]
|
|
buttons.append([InlineKeyboardButton(text=label, callback_data="extra_" + key)])
|
|
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)
|