размещения ручки

This commit is contained in:
Artem Tsyrulnikov
2026-01-20 20:15:18 +03:00
parent 33c9121571
commit e8ff317566
35 changed files with 949 additions and 290 deletions

View File

@@ -28,10 +28,7 @@ func (s *PlacementDetails) renderDetails(b *bot.Bot, mode bot.RenderMode) {
return
}
var placementPost *backend.PlacementPostOutput
if len(placement.PlacementPosts) > 0 {
placementPost = &placement.PlacementPosts[0]
}
placementPost := placement.PlacementPost
text := "<b>Детали размещения</b>\n\n"
@@ -69,12 +66,11 @@ func (s *PlacementDetails) renderDetails(b *bot.Bot, mode bot.RenderMode) {
if placementPost != nil {
text += "\n<b>Пост</b>\n"
if placementPost.AdPostURL != nil && *placementPost.AdPostURL != "" {
text += fmt.Sprintf("• <b>Ссылка на пост:</b> %s\n", *placementPost.AdPostURL)
if placementPost.Post.URL != nil && *placementPost.Post.URL != "" {
text += fmt.Sprintf("• <b>Ссылка на пост:</b> %s\n", *placementPost.Post.URL)
} else {
text += "• <b>Ссылка на пост:</b> не найдена\n"
}
text += fmt.Sprintf("• <b>Статус поста:</b> %s\n", formatPlacementPostStatus(placementPost.Status))
}
keyboard := Keyboard(Row(Button("← Назад", "back")))
@@ -128,18 +124,6 @@ func formatPlacementType(value string) string {
}
}
func formatPlacementPostStatus(status string) string {
normalized := strings.TrimSpace(strings.ToLower(status))
switch normalized {
case "active":
return "Активен"
case "archived":
return "Архивирован"
default:
return status
}
}
func formatCostType(value string) string {
switch strings.TrimSpace(strings.ToLower(value)) {
case "cpm":