правки

This commit is contained in:
Artem Tsyrulnikov
2026-02-02 11:59:37 +03:00
parent 52cd2ec1a0
commit 31b63e5a39
30 changed files with 710 additions and 126 deletions

View File

@@ -111,12 +111,6 @@ func (s *PurchaseOptionalDetails) Enter(b *bot.Bot, mode bot.RenderMode) {
s.inviteLinkTypeButton(),
))
if row := s.costBeforeDeleteRow(); row != nil {
rows = append(rows, row)
}
if row := s.commentDeleteRow(); row != nil {
rows = append(rows, row)
}
rows = append(rows, Row(Button("Назад", "back"), Button("Далее", "next")))
keyboard := Keyboard(rows...)
@@ -683,10 +677,21 @@ func (s *PurchaseOptionalDetails) renderInputPrompt(b *bot.Bot, mode bot.RenderM
}
typeLabel := s.costBeforeTypeLabelForCurrent()
keyboard := Keyboard(
Row(Button(fmt.Sprintf("Тип: %s", typeLabel), "cost_before_type_toggle")),
Row(Button("← Назад", s.backAction())),
)
var keyboard echotron.InlineKeyboardMarkup
// Показываем кнопку удаления только если есть значение и это не режим per-channel
if s.CurrentChannel == "" && s.CostBeforeBargain != nil && s.CostBeforeBargain.Value != nil {
keyboard = Keyboard(
Row(Button(fmt.Sprintf("Тип: %s", typeLabel), "cost_before_type_toggle")),
Row(Button("⌫ Удалить до торга", "delete_cost_before")),
Row(Button("← Назад", s.backAction())),
)
} else {
keyboard = Keyboard(
Row(Button(fmt.Sprintf("Тип: %s", typeLabel), "cost_before_type_toggle")),
Row(Button("← Назад", s.backAction())),
)
}
if mode == bot.EditMessage {
b.Edit(text, keyboard)
@@ -750,6 +755,19 @@ func (s *PurchaseOptionalDetails) renderInputPrompt(b *bot.Bot, mode bot.RenderM
return
case "comment":
text += "<b>Введите комментарий</b>"
keyboard := Keyboard(Row(Button("← Назад", s.backAction())))
if s.Comment != "" {
keyboard = Keyboard(
Row(Button("⌫ Удалить комментарий", "delete_comment")),
Row(Button("← Назад", s.backAction())),
)
}
if mode == bot.EditMessage {
b.Edit(text, keyboard)
} else {
b.SendNew(text, keyboard)
}
return
default:
s.InputMode = ""
s.Enter(b, mode)