Simplified a for loop for last songs list.
This commit is contained in:
parent
9b959eb7ab
commit
293e1a3126
@ -97,19 +97,17 @@ templ Index(curSong *radio.Song, sl []radio.Song, slLen int64, lstnrs *radio.Lis
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
if sl != nil && len(sl) != 0 {
|
||||
for i := 0; i < len(sl); i++ {
|
||||
for _, song := range sl {
|
||||
<tr>
|
||||
<td>{ utils.ToClientTimezone(sl[i].StartAt, r).Format("15:04") }</td>
|
||||
if sl[i].PeakListeners != 0 {
|
||||
<td>{ strconv.FormatInt(sl[i].Listeners, 10) }/{ strconv.FormatInt(sl[i].PeakListeners, 10) }</td>
|
||||
<td>{ utils.ToClientTimezone(song.StartAt, r).Format("15:04") }</td>
|
||||
if song.PeakListeners != 0 {
|
||||
<td>{ strconv.FormatInt(song.Listeners, 10) }/{ strconv.FormatInt(song.PeakListeners, 10) }</td>
|
||||
} else {
|
||||
<td></td>
|
||||
}
|
||||
<td>{ sl[i].Artist } - { sl[i].Title }</td>
|
||||
<td>{ song.Artist } - { song.Title }</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
Loading…
Reference in New Issue
Block a user