Merge pull request 'Обновление UI: убрать розыгрыши, переименовать счета, добавить кнопку главная' (#7) from v2_functions into master
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #7
This commit is contained in:
@@ -487,7 +487,7 @@ async def confirm_create_lottery(callback: CallbackQuery, state: FSMContext):
|
||||
text,
|
||||
reply_markup=InlineKeyboardMarkup(inline_keyboard=[
|
||||
[InlineKeyboardButton(text="🎰 К управлению розыгрышами", callback_data="admin_lotteries")],
|
||||
[InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")]
|
||||
[InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")]
|
||||
])
|
||||
)
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ async def enter_chat(message: Message, state: FSMContext):
|
||||
|
||||
keyboard = InlineKeyboardMarkup(inline_keyboard=[
|
||||
[InlineKeyboardButton(text="🚪 Выйти из чата", callback_data="exit_chat")],
|
||||
[InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")]
|
||||
[InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")]
|
||||
])
|
||||
|
||||
# Обычная клавиатура для чата
|
||||
@@ -118,7 +118,7 @@ async def exit_chat(message: Message, state: FSMContext):
|
||||
|
||||
keyboard = InlineKeyboardMarkup(inline_keyboard=[
|
||||
[InlineKeyboardButton(text="💬 Войти в чат", callback_data="enter_chat")],
|
||||
[InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")]
|
||||
[InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")]
|
||||
])
|
||||
|
||||
# Обычная клавиатура
|
||||
|
||||
@@ -22,7 +22,7 @@ def get_help_menu_keyboard() -> InlineKeyboardMarkup:
|
||||
[InlineKeyboardButton(text="🎰 Участие в розыгрышах", callback_data="help_lottery")],
|
||||
[InlineKeyboardButton(text="💬 Чат", callback_data="help_chat")],
|
||||
[InlineKeyboardButton(text="⚙️ Команды", callback_data="help_commands")],
|
||||
[InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")]
|
||||
[InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")]
|
||||
]
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
@@ -31,7 +31,7 @@ def get_back_to_help_keyboard() -> InlineKeyboardMarkup:
|
||||
"""Клавиатура возврата к справке"""
|
||||
buttons = [
|
||||
[InlineKeyboardButton(text="◀️ Назад к справке", callback_data="help_main")],
|
||||
[InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")]
|
||||
[InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")]
|
||||
]
|
||||
return InlineKeyboardMarkup(inline_keyboard=buttons)
|
||||
|
||||
|
||||
@@ -143,7 +143,20 @@ async def process_club_card(message: Message, state: FSMContext):
|
||||
@router.message(StateFilter(RegistrationStates.waiting_for_phone))
|
||||
async def process_phone(message: Message, state: FSMContext):
|
||||
"""Обработка номера телефона"""
|
||||
phone = None if message.text.strip() == "-" else message.text.strip()
|
||||
phone_input = message.text.strip()
|
||||
|
||||
# Проверяем, не отправил ли пользователь просто "-"
|
||||
if phone_input == "-":
|
||||
phone = None
|
||||
else:
|
||||
# Валидируем телефон: не должно быть пустых или некорректных значений
|
||||
if not phone_input:
|
||||
await message.answer(
|
||||
"❌ Неверный номер телефона.\n\n"
|
||||
"Пожалуйста, введите корректный номер или отправьте '-' чтобы пропустить."
|
||||
)
|
||||
return
|
||||
phone = phone_input
|
||||
|
||||
data = await state.get_data()
|
||||
club_card_number = data['club_card_number']
|
||||
|
||||
@@ -17,8 +17,8 @@ def get_main_reply_keyboard(is_admin: bool = False, is_registered: bool = False)
|
||||
|
||||
# Первая строка - основные команды
|
||||
row1 = [
|
||||
KeyboardButton(text="🎰 Розыгрыши"),
|
||||
KeyboardButton(text="💬 Чат")
|
||||
KeyboardButton(text="💬 Чат"),
|
||||
KeyboardButton(text="❓ Справка")
|
||||
]
|
||||
keyboard.append(row1)
|
||||
|
||||
@@ -29,13 +29,13 @@ def get_main_reply_keyboard(is_admin: bool = False, is_registered: bool = False)
|
||||
|
||||
if is_registered or is_admin:
|
||||
row2.append(KeyboardButton(text="🔑 Мой код"))
|
||||
row2.append(KeyboardButton(text="💳 Мои счета"))
|
||||
row2.append(KeyboardButton(text="📱 Мои логины"))
|
||||
|
||||
if row2:
|
||||
keyboard.append(row2)
|
||||
|
||||
# Третья строка - справка
|
||||
row3 = [KeyboardButton(text="❓ Справка")]
|
||||
# Третья строка - главная
|
||||
row3 = [KeyboardButton(text="🏠 Главная")]
|
||||
|
||||
# Админские команды
|
||||
if is_admin:
|
||||
@@ -59,7 +59,7 @@ def get_chat_reply_keyboard() -> ReplyKeyboardMarkup:
|
||||
"""
|
||||
keyboard = [
|
||||
[KeyboardButton(text="🚪 Выйти из чата")],
|
||||
[KeyboardButton(text="🏠 Главное меню")]
|
||||
[KeyboardButton(text="🏠 Главная")]
|
||||
]
|
||||
|
||||
return ReplyKeyboardMarkup(
|
||||
|
||||
Reference in New Issue
Block a user