This commit is contained in:
2024-12-06 14:20:29 +03:00
commit ae115cfbcb
38 changed files with 1178 additions and 0 deletions

View File

@ -0,0 +1,13 @@
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
class AdminAnswerToBooking(Keyboard):
def get_keyboard(self):
book_id = self.get_option("book_id")
return [
[
InlineKeyboardButton("Принять", callback_data="accept={book_id}".format(book_id=book_id)),
# InlineKeyboardButton("Ответить", callback_data="answer={book_id}".format(book_id=book_id))
],
]

View File

@ -0,0 +1,25 @@
from datetime import datetime, timedelta
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
class DateToBookingKeyboard(Keyboard):
def get_keyboard(self):
current_day = datetime.now()
keyboard = []
for i in range(1, 8):
keyboard.append(
[
InlineKeyboardButton(current_day.strftime("%d.%m.%Y"),
callback_data="set_date={date}".format(date=current_day.strftime("%d.%m.%Y")))
]
)
current_day = current_day + timedelta(days=1)
keyboard.append(
[
InlineKeyboardButton("Назад", callback_data="set_date=back")
]
)
return keyboard

View File

@ -0,0 +1,18 @@
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
class FirstStepDeveloper(Keyboard):
def get_keyboard(self):
return [
[
InlineKeyboardButton("Последние проекты", callback_data='get_last_projects')
],
# [
# InlineKeyboardButton("Стать разработчиком", callback_data='set_developer')
# ],
# [
# InlineKeyboardButton("Меню заведения", callback_data='get_menu')
# ],
]

View File

@ -0,0 +1,18 @@
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
class FirstStepKeyboard(Keyboard):
def get_keyboard(self):
return [
[
InlineKeyboardButton("Авторизация", callback_data='request_code')
],
# [
# InlineKeyboardButton("Стать разработчиком", callback_data='set_developer')
# ],
# [
# InlineKeyboardButton("Меню заведения", callback_data='get_menu')
# ],
]

View File

@ -0,0 +1,18 @@
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
class FirstStepPartner(Keyboard):
def get_keyboard(self):
return [
[
InlineKeyboardButton("Запросить кандидатов", callback_data='get_developers')
],
# [
# InlineKeyboardButton("Стать разработчиком", callback_data='set_developer')
# ],
# [
# InlineKeyboardButton("Меню заведения", callback_data='get_menu')
# ],
]

View File

@ -0,0 +1,23 @@
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
class GetTableListKeyboard(Keyboard):
def get_keyboard(self):
keyboard = []
for i in range(1, 8):
keyboard.append(
[
InlineKeyboardButton("Стол {t}".format(t=i),
callback_data="set_table={t}".format(t=i))
]
)
keyboard.append(
[
InlineKeyboardButton("Назад", callback_data="set_table=back")
]
)
return keyboard

View File

@ -0,0 +1,34 @@
from bot.Keyboard import Keyboard
from telegram import InlineKeyboardButton
class VacancyNotificationToAdminKeyboard(Keyboard):
def get_keyboard(self):
keyboard = []
recipient = self.get_option("recipient")
post = self.get_option("post")
channel_link = post['channel_link'][1:]
channel_link = "https://t.me/{cl}".format(cl=channel_link)
post_link = "{channel_link}/{post_id}".format(channel_link=channel_link, post_id=post['post_id'])
recipient_role = recipient['status']
if recipient_role != 2:
keyboard.append([InlineKeyboardButton("Откликнуться",
callback_data='admin_respond_to_vacancy?ig_post_id={post_id}&dialog_id={dialog_id}'.format(
post_id=post['id'], dialog_id=recipient['dialog_id'])
)
])
if recipient_role == 2:
keyboard.append([InlineKeyboardButton("Открыть канал", url=channel_link)])
keyboard.append([InlineKeyboardButton("Открыть пост", url=post_link)])
if post['status'] != 5:
keyboard.append([InlineKeyboardButton("Запрос отправлен",
callback_data='request_sent?ig_post_id={post_id}'.format(
post_id=post['id'])
)
])
return keyboard