размещения ручки
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user