all repos — grimoire @ c65fe9a554aa66f9ecd018af9aa6baae8daff5ef

dead simple icecast frontend

templates/radio.html (raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{{ $title := (.Context).Value "title" }}
{{ $stations := (.Context).Value "streams" }}
{{ $sentry := (.Context).Value "sentry" }}

<!DOCTYPE html>
<html lang='en'>
  <head>
    <meta charset='utf-8'>
    <meta name='description' content='internet radio'/>
    <meta name='viewport' content='width=device-width,initial-scale=1'>
    <link rel='stylesheet' type='text/css' href='/static/style.css?v=20241030.00'>
    <link rel='shortcut icon' href='/static/favicon.png'>
    <title>{{ $title }}</title>
  </head>
  <body>
  <header><h1>{{$title}}</h1></header>
  <main>
    <ul>
    {{range $name, $stationUrl := $stations}}
    {{ if gt (($sentry).GetStatus $stationUrl) 399 }}
    <li class="offline"><span class="station">{{$name}} (offline)</span><a class="stationurl" href="{{$stationUrl}}">{{$stationUrl}}</a></li>
    {{else}}
    <li class="online"><a class="station" href="{{$stationUrl}}" target="_blank">{{$name}}</a><a class="stationurl" href="{{$stationUrl}}" target="_blank">{{$stationUrl}}</a></li>
    {{end}}
    {{end}}
    </ul>
  </main>
  </body>
  </head>
</html>