From 398b38561a09f4f6a5aee4a33f1d3f62ec8f1698 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 20 Jun 2024 01:30:15 +0400 Subject: [PATCH] Updated template. --- web/index.templ | 50 ++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/web/index.templ b/web/index.templ index c8216b1..490cb10 100644 --- a/web/index.templ +++ b/web/index.templ @@ -67,23 +67,27 @@ templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.Lis Your browser doesn't support an audio element, it's sad... But you always can take the playlist!
- if curSong != nil && curSong.Artist != "" {

- Listeners { strconv.FormatInt(lstnrs.Current(), 10) } - Duration { curSong.DurationString() } + Listeners + { strconv.FormatInt(lstnrs.Current(), 10) } + Duration + + + if curSong != nil && curSong.Artist != "" { + { curSong.DurationString() } + } else { + 0:00 + } +

- { curSong.Artist } - { curSong.Title } + + + if curSong != nil && curSong.Artist != "" { + { curSong.Artist } - { curSong.Title } + } +

- } else { -

- Listeners { strconv.FormatInt(lstnrs.Current(), 10) } - Duration 0:00 -

-

- Song -

- }
@@ -98,17 +102,17 @@ templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.Lis - for _, song := range sl { - - { utils.ToClientTimezone(song.StartAt, r).Format("15:04") } - if song.PeakListeners != 0 { - { strconv.FormatInt(song.Listeners, 10) }/{ strconv.FormatInt(song.PeakListeners, 10) } - } else { - + for _, song := range sl { + + { utils.ToClientTimezone(song.StartAt, r).Format("15:04") } + + if song.PeakListeners != 0 { + { strconv.FormatInt(song.Listeners, 10) }/{ strconv.FormatInt(song.PeakListeners, 10) } + } + + { song.Artist } - { song.Title } + } - { song.Artist } - { song.Title } - - }