package web import "net/http" import "strconv" import "github.com/invopop/ctxi18n/i18n" import "dwelling-radio/internal/radio" import "dwelling-radio/pkg/utils" templ Index(prgVer string, curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.ListenerCounter, r *http.Request) {
{ strconv.FormatInt(lstnrs.Current(), 10) } if curSong != nil && curSong.Artist != "" { { curSong.DurationString() } } else { 0:00 }
if curSong != nil && curSong.Artist != "" { { curSong.Artist } - { curSong.Title } }
{ i18n.T(ctx, "last-songs.tab-start") } | { i18n.T(ctx, "last-songs.tab-stat") } | { i18n.T(ctx, "last-songs.tab-song") } |
{ 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 } |