refactor
This commit is contained in:
@@ -82,7 +82,6 @@ func (s *MyProjects) renderProjects(b *bot.Bot, mode bot.RenderMode, jwt string)
|
||||
|
||||
var text string
|
||||
var buttons [][]echotron.InlineKeyboardButton
|
||||
navTitle := "Главное меню › Мои проекты"
|
||||
headerTitle := "Мои проекты"
|
||||
emptyStateText := `У вас пока нет подключенных каналов.
|
||||
|
||||
@@ -96,24 +95,18 @@ func (s *MyProjects) renderProjects(b *bot.Bot, mode bot.RenderMode, jwt string)
|
||||
Начните с добавления первого проекта`
|
||||
nonEmptyText := "Управление вашими Telegram-каналами.\n\nВыберите канал"
|
||||
if s.OpenPurchases {
|
||||
navTitle = "Главное меню › Закупы"
|
||||
headerTitle = "Закупы"
|
||||
nonEmptyText = "Выберите проект для просмотра закупов"
|
||||
}
|
||||
|
||||
if len(page.Items) == 0 {
|
||||
text = fmt.Sprintf(`<i>%s</i>
|
||||
text = fmt.Sprintf(`<b>%s</b>
|
||||
|
||||
<b>%s</b>
|
||||
|
||||
%s`, navTitle, headerTitle, emptyStateText)
|
||||
%s`, headerTitle, emptyStateText)
|
||||
} else {
|
||||
text = fmt.Sprintf(`<i>%s</i>
|
||||
|
||||
<b>%s</b>%s
|
||||
text = fmt.Sprintf(`<b>%s</b>%s
|
||||
|
||||
%s`,
|
||||
navTitle,
|
||||
headerTitle,
|
||||
ui.FormatPageInfo(s.CurrentPage, page.Pages),
|
||||
nonEmptyText)
|
||||
|
||||
Reference in New Issue
Block a user