New features

This commit is contained in:
2022-06-16 00:32:17 +03:00
parent 63afce795e
commit 2b69567cc9
31 changed files with 318 additions and 77 deletions

View File

@@ -15,6 +15,7 @@ def main_menu():
admin_control.append(KeyboardButton(messages.del_admin))
if admin_control:
markup.add(*admin_control)
markup.add(KeyboardButton(messages.add_operator), KeyboardButton(messages.del_operator))
markup.add(KeyboardButton(messages.back))
return markup

View File

@@ -10,9 +10,10 @@ def checkout_btn() -> ReplyKeyboardMarkup:
]], resize_keyboard=True)
def confirm_all_info():
def confirm_all_info(load: bool = False):
markup = ReplyKeyboardMarkup(resize_keyboard=True)
markup.add(KeyboardButton(messages.all_right_message))
markup.row(KeyboardButton(messages.save_and_continue))
if not load:
markup.row(KeyboardButton(messages.save_and_continue))
markup.row(KeyboardButton(messages.cancel_message))
return markup

View File

@@ -9,4 +9,5 @@ def main_menu(active: bool = False) -> ReplyKeyboardMarkup:
markup.add(KeyboardButton(messages.leave_work))
else:
markup.add(KeyboardButton(messages.on_work))
markup.add(messages.back)
return markup

View File

@@ -3,7 +3,7 @@ from aiogram.types.reply_keyboard import ReplyKeyboardMarkup, KeyboardButton
from load import messages
def load_info(data:bool = False):
def load_info(data: bool = False):
markup = ReplyKeyboardMarkup(resize_keyboard=True)
if data:
markup.row(KeyboardButton(messages.load_data))

View File

View File

View File

@@ -0,0 +1,23 @@
from aiogram.types.inline_keyboard import InlineKeyboardButton, InlineKeyboardMarkup
from load import messages
def item_list(item: int = 0, items: int = 1, user_count: int = 1) -> InlineKeyboardMarkup:
markup = InlineKeyboardMarkup()
default = [
InlineKeyboardButton(str(user_count), callback_data='null')
]
back = ['⬅️', f"operator_prev|{item-1}|{user_count-1}"]
next = ['➡️', f"operator_next|{item+1}|{user_count+1}"]
if items < 1 or item >= items:
next = [" ", "null"]
if item == 0:
back = [" ", "null"]
default.append(InlineKeyboardButton(next[0], callback_data=next[1]))
markup.add(InlineKeyboardButton(back[0], callback_data=back[1]), *default)
markup.row(InlineKeyboardButton(messages.del_operator, callback_data=f"delete_operator|{item}"))
return markup