all repos — grimoire @ cf3715068c81e9a3a8b6ebd4a6a3dc298f819011

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
{{ $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='oops'/>
    <meta name='viewport' content='width=device-width,initial-scale=1'>
    <link rel='stylesheet' type='text/css' href='/static/style.css'>
    <title>{{ $title }}</title>
  </head>
  <body>
  <header><h1>{{$title}}</h1></header>
  <main>
    <ul>
    {{range $name, $stationUrl := $stations}}
    {{ if gt (($sentry).GetStatus $stationUrl) 400 }}
    <li class="offline"><a href="#">{{$name}}</a></li>
    {{else}}
    <li class="online"><a href="{{$stationUrl}}" target="_blank">{{$name}}</a></li>
    {{end}}
    {{end}}
    </ul>
  </main>
  </body>
  </head>
</html>