all repos — grimoire @ 24591be57a83750906dd02999cf4c3416ca32fed

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'>
    <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) 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>