улучшение ui
This commit is contained in:
@@ -365,17 +365,17 @@ func (e *CreativeEditorFields) ShowManagementPanel(b *bot.Bot, confirmButtonText
|
||||
var buttons [][]echotron.InlineKeyboardButton
|
||||
|
||||
// Блок редактирования контента
|
||||
buttons = append(buttons, bot.Row(
|
||||
bot.Button("✎ Текст", "edit_text"),
|
||||
bot.Button("+ Медиа", "add_media"),
|
||||
buttons = append(buttons, Row(
|
||||
Button("✎ Текст", "edit_text"),
|
||||
Button("+ Медиа", "add_media"),
|
||||
))
|
||||
// Добавление кнопки сразу под основным блоком
|
||||
buttons = append(buttons, bot.Row(bot.Button("+ Добавить кнопку", "add_button")))
|
||||
buttons = append(buttons, Row(Button("+ Добавить кнопку", "add_button")))
|
||||
|
||||
// Кнопка удаления медиа (если медиа добавлено)
|
||||
if e.MediaFileID != "" {
|
||||
buttons = append(buttons, bot.Row(
|
||||
bot.Button("⌫ Убрать медиа", "delete_media"),
|
||||
buttons = append(buttons, Row(
|
||||
Button("⌫ Убрать медиа", "delete_media"),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ func (e *CreativeEditorFields) ShowManagementPanel(b *bot.Bot, confirmButtonText
|
||||
if len(e.Buttons) > 0 {
|
||||
var row []echotron.InlineKeyboardButton
|
||||
for i, btn := range e.Buttons {
|
||||
row = append(row, bot.Button(
|
||||
row = append(row, Button(
|
||||
fmt.Sprintf(`⌫ Убрать «%s»`, btn.Text),
|
||||
fmt.Sprintf("delete_button:%d", i),
|
||||
))
|
||||
@@ -406,13 +406,13 @@ func (e *CreativeEditorFields) ShowManagementPanel(b *bot.Bot, confirmButtonText
|
||||
|
||||
// Финальные кнопки
|
||||
if e.Text != nil {
|
||||
buttons = append(buttons, bot.Row(
|
||||
bot.Button("← Назад", cancelCallback),
|
||||
bot.Button(confirmButtonText, confirmCallback),
|
||||
buttons = append(buttons, Row(
|
||||
Button("← Назад", cancelCallback),
|
||||
Button(confirmButtonText, confirmCallback),
|
||||
))
|
||||
} else {
|
||||
buttons = append(buttons, bot.Row(
|
||||
bot.Button("← Назад", cancelCallback),
|
||||
buttons = append(buttons, Row(
|
||||
Button("← Назад", cancelCallback),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ func (e *CreativeEditorFields) ShowManagementPanel(b *bot.Bot, confirmButtonText
|
||||
func (e *CreativeEditorFields) ShowControlPanel(b *bot.Bot, text string, buttons [][]echotron.InlineKeyboardButton) {
|
||||
if e.ControlPanelMessageID == nil {
|
||||
// Отправляем новую панель
|
||||
keyboard := bot.Keyboard(buttons...)
|
||||
keyboard := Keyboard(buttons...)
|
||||
b.SendNew(text, keyboard)
|
||||
// ВАЖНО: Сохраняем копию значения, а не указатель на переменную!
|
||||
controlPanelMsgID := b.LastMessageID
|
||||
@@ -437,7 +437,7 @@ func (e *CreativeEditorFields) ShowControlPanel(b *bot.Bot, text string, buttons
|
||||
oldLastMessageID := b.LastMessageID
|
||||
b.LastMessageID = *e.ControlPanelMessageID
|
||||
|
||||
keyboard := bot.Keyboard(buttons...)
|
||||
keyboard := Keyboard(buttons...)
|
||||
b.Edit(text, keyboard)
|
||||
|
||||
// Восстанавливаем оригинальный LastMessageID
|
||||
|
||||
Reference in New Issue
Block a user