first
This commit is contained in:
13
keyboards/AdminAnswerToBooking.py
Normal file
13
keyboards/AdminAnswerToBooking.py
Normal 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))
|
||||
],
|
||||
]
|
25
keyboards/DateToBookingKeyboard.py
Normal file
25
keyboards/DateToBookingKeyboard.py
Normal 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
|
18
keyboards/FirstStepDeveloper.py
Normal file
18
keyboards/FirstStepDeveloper.py
Normal 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')
|
||||
# ],
|
||||
]
|
18
keyboards/FirstStepKeyboard.py
Normal file
18
keyboards/FirstStepKeyboard.py
Normal 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')
|
||||
# ],
|
||||
]
|
18
keyboards/FirstStepPartner.py
Normal file
18
keyboards/FirstStepPartner.py
Normal 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')
|
||||
# ],
|
||||
]
|
23
keyboards/GetTableListKeyboard.py
Normal file
23
keyboards/GetTableListKeyboard.py
Normal 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
|
34
keyboards/VacancyNotificationToAdminKeyboard.py
Normal file
34
keyboards/VacancyNotificationToAdminKeyboard.py
Normal 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
|
Reference in New Issue
Block a user