tube/templates/index.html

41 lines
1.3 KiB
HTML
Raw Normal View History

2019-06-26 22:02:31 +03:00
{{ $playing := .Playing }}
<html>
<head>
<title>Tube</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="stylesheet" type="text/css" href="/static/css/index.css">
</head>
<body>
<nav><a href="/">Tube</a></nav>
<main>
<div id="player">
2019-06-29 01:51:38 +03:00
{{ if $playing.ID }}
2019-06-26 22:02:31 +03:00
<video id="video" controls poster="/t/{{ $playing.ID}}" src="/v/{{ $playing.ID }}.mp4"></video>
<h1>{{ $playing.Title }}</h1>
<h2>{{ $playing.Modified }}</h2>
<p>{{ $playing.Description }}</p>
2019-06-29 01:51:38 +03:00
{{ else }}
<video id="video" controls></video>
{{ end }}
2019-06-26 22:02:31 +03:00
</div>
<div id="sidebar">
{{ range $m := .Playlist }}
{{ if eq $m.ID $playing.ID }}
2019-06-29 04:44:56 +03:00
<a href="/v/{{ $m.ID }}" class="playing">
2019-06-26 22:02:31 +03:00
{{ else }}
2019-06-29 04:44:56 +03:00
<a href="/v/{{ $m.ID }}">
2019-06-26 22:02:31 +03:00
{{ end }}
<img src="/t/{{ $m.ID }}">
<div>
<h1>{{ $m.Title }}</h1>
<h2>{{ $m.Modified }}</h2>
</div>
</a>
{{ end }}
</div>
</main>
</body>
</html>