]> git.gir.st - subscriptionfeed.git/blob - app/dangerous/templates/playlist.html.j2
implement channel and playlist endpoints using innertube
[subscriptionfeed.git] / app / dangerous / templates / playlist.html.j2
1 {% extends "base.html.j2" %}
2 {% import 'macros.imp.j2' as macros %}
3 {% block title %}{{ title | e }}{% endblock %}
4
5 {% block content %}
6 {{ super() }}
7 <div class="cards">
8 {# TODO: copy pasted from dangerous/search.j2 #}
9 {% for card in rows %}
10 {% set c = card.content %}
11 {% if card.type == 'VIDEO' %}
12 {% call macros.card(c.video_id, c.title, c.length) %}
13 {{ macros.infobar_subscriptions(c.video_id, c.channel_id, c.author) }}
14 <small>{{ c.published if c.published }}&nbsp;</small>
15 {% endcall %}
16 {% elif card.type == 'CHANNEL' and c.channel_id != channel_id %}
17 {% call macros.card_generic("/channel/"~c.channel_id, c.icons[c.icons.largest] if 'icons' in c else '', c.title) %}
18 <span class=channel>Channel</span>
19 <span class=advanced>{{ c.subscribers }}</span>
20 {% endcall %}
21 {% elif card.type == 'PLAYLIST' %}
22 {% call macros.card_generic("/playlist?list="~c.playlist_id, "https://i.ytimg.com/vi/"~c.video_id~"/mqdefault.jpg", c.title) %}
23 <span class=channel>{{ c.author }}</span>
24 <span class=advanced>{{ c.n_videos }} videos</span>
25 {% endcall %}
26 {% elif card.type == 'WEBSITE' %}
27 {% call macros.card_generic(c.url, c.icons[250] if 'icons' in c else '', c.title) %}
28 <span class=channel>{{ c.domain }}</span>
29 {% endcall %}
30 {% endif %}
31 {% endfor %}
32
33 {{ macros.dummycard() }}
34 </div>
35 </article>
36
37 {% if not rows|length %}no more results{% endif %}
38
39 <div class="pagination-container">
40 {% if page is not none %}
41 {% if page > 1 %}
42 {{ macros.pagination("previous", {'page':(-1,1)}, -1) }}
43 {% endif %}
44 {{ macros.pagination("next", {'page':(+1,1)}, +1) }}
45 {% endif %}
46 </div>
47 {% endblock %}
Imprint / Impressum