]> git.gir.st - subscriptionfeed.git/blob - app/templates/watch.html.j2
move non-web related subroutines out of frontend
[subscriptionfeed.git] / app / templates / watch.html.j2
1 <!DOCTYPE html>
2 <title>{{ title }} &mdash; {{ author }}</title>
3 <link rel="shortcut icon" href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" fill="%23fff"><circle r="150" cx="150" cy="150" fill="%23f00"/><path d="m120 97v106l93-53"/></svg>'>
4 <link rel="stylesheet" href="/static/style.css">
5
6 {% import 'macros.imp.j2' as macros %}
7
8 <!--b style=font-size:large></b><hr-->
9
10 <div id=main style="margin:auto">
11 <video controls poster="{{ poster }}" style="width:100%;height:calc(100% / {{ aspectr }});">
12 <source src="{{ video_url }}">
13 {% for cc in subtitles %}
14 <track label="{{ cc.name }}" kind="subtitles" srclang="{{ cc.code }}" src="{{ cc.url }}" {{ 'default' if not loop.counter }}>
15 {% endfor %}
16 </video>
17
18 <h1>{{ title }}<br>
19 <small><a href="/channel/{{ channel_id }}">{{ author }}</a></small></h1>
20 <details><summary>Description</summary>
21 <p style="white-space:pre-wrap">{{ description }}
22 <hr></details>
23
24 <details><summary>Metadata</summary>
25 <dl>
26 <dt>Duration
27 <dd>{{ length // 60 }}:{{ length % 60 }}
28 <dt>Views
29 <dd>{{ views }}
30 <dt>Published
31 <dd>{{ published }}
32 <dt>Rating
33 <dd>{{ rating | round(1) }}/5
34 <dt>Visibility
35 <dd>{{ 'unlisted' if unlisted else 'public' }}
36 </dl>
37 <hr>
38 Available in {{ countries | length }} countries: {{ countries | join(', ') }}
39 <hr></details>
40
41 <!-- not implemented warning:--><div style="background:red">{%for x in (infocards+endcards)|selectattr('content.error')%}{{x.content.error}}{%endfor%}</div>
42 <details><summary>Info- and Endcards</summary>
43 <!--TODO: don't show duplicates (e.g. same video/playlist in infocard and endscreen; G1m7goLCJDY, 5TkIe60y2GI). We want videos+playlists from infocards, channels+websites from endcards (wherever more info is available). -->
44 {% for card in infocards+endcards %}{#
45 #}{% set c = card.content %}{#
46 #}{% if card.type == 'VIDEO' %}{#
47 #}{% call macros.card(c.video_id, c.title) %}
48 <span class=channel>{{ c.author }}&nbsp;</span>
49 <span class=advanced>{{ c.length }}</span>
50 {% endcall %}{#
51 #}{% elif card.type == 'CHANNEL' and c.channel_id != channel_id %}{#
52 #}{% call macros.card_generic("/channel/"~c.channel_id, c.icons[250] if 'icons' in c else '', c.title) %}
53 <span class=channel>Channel</span>
54 <span class=advanced></span>
55 {% endcall %}{#
56 #}{% elif card.type == 'PLAYLIST' %}{#
57 #}{% call macros.card_generic("/playlist?list="~c.playlist_id, "https://i.ytimg.com/vi/"~c.video_id~"/mqdefault.jpg", c.title) %}
58 <span class=channel>{{ c.author }}</span>
59 <span class=advanced>{{ c.n_videos }} videos</span>
60 {% endcall %}{#
61 #}{% elif card.type == 'WEBSITE' %}{#
62 #}{% call macros.card_generic(c.url, c.icons[250] if 'icons' in c else '', c.title) %}
63 <span class=channel>{{ c.domain }}</span>
64 {% endcall %}{#
65 #}{% endif %}{#
66 #}{% endfor %}
67 <hr></details>
68 </div>
Imprint / Impressum