1
0

Updated template.

This commit is contained in:
Alexander Andreev 2024-06-20 01:30:15 +04:00
parent d1bd7982ce
commit 398b38561a
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -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 <a href="/playlist">playlist</a>! Your browser doesn't support an audio element, it's sad... But you always can take the <a href="/playlist">playlist</a>!
</audio> </audio>
<div> <div>
<p>
<img src="/assets/img/listener.svg" alt="Listeners" title="Listeners" />
<span id="radio-listeners">{ strconv.FormatInt(lstnrs.Current(), 10) }</span>
<img src="/assets/img/duration.svg" alt="Duration" title="Duration" />
<span id="radio-duration-estimate"></span>
<span id="radio-duration">
if curSong != nil && curSong.Artist != "" { if curSong != nil && curSong.Artist != "" {
<p> { curSong.DurationString() }
<img src="/assets/img/listener.svg" alt="Listeners" title="Listeners" /> <span id="radio-listeners">{ strconv.FormatInt(lstnrs.Current(), 10) }</span>
<img src="/assets/img/duration.svg" alt="Duration" title="Duration" /> <span id="radio-duration-estimate"></span><span id="radio-duration">{ curSong.DurationString() }</span>
</p>
<p>
<img src="/assets/img/note.svg" /> <span id="radio-song">{ curSong.Artist } - { curSong.Title }</span>
</p>
} else { } else {
<p> 0:00
<img src="/assets/img/listener.svg" alt="Listeners" title="Listeners" /> <span id="radio-listeners">{ strconv.FormatInt(lstnrs.Current(), 10) }</span>
<img src="/assets/img/duration.svg" alt="Duration" title="Duration" /> <span id="radio-duration-estimate"></span><span id="radio-duration">0:00</span>
</p>
<p>
<img src="/assets/img/note.svg" alt="Song" title="Song" /> <span id="radio-song"></span>
</p>
} }
</span>
</p>
<p>
<img src="/assets/img/note.svg" />
<span id="radio-song">
if curSong != nil && curSong.Artist != "" {
{ curSong.Artist } - { curSong.Title }
}
</span>
</p>
</div> </div>
</div> </div>
</section> </section>
@ -101,11 +105,11 @@ templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.Lis
for _, song := range sl { for _, song := range sl {
<tr> <tr>
<td>{ utils.ToClientTimezone(song.StartAt, r).Format("15:04") }</td> <td>{ utils.ToClientTimezone(song.StartAt, r).Format("15:04") }</td>
<td>
if song.PeakListeners != 0 { if song.PeakListeners != 0 {
<td>{ strconv.FormatInt(song.Listeners, 10) }/{ strconv.FormatInt(song.PeakListeners, 10) }</td> { strconv.FormatInt(song.Listeners, 10) }/{ strconv.FormatInt(song.PeakListeners, 10) }
} else {
<td></td>
} }
</td>
<td>{ song.Artist } - { song.Title }</td> <td>{ song.Artist } - { song.Title }</td>
</tr> </tr>
} }