]> git.gir.st - subscriptionfeed.git/blob - app/dangerous/templates/channel.html.j2
retry browse_ajax twice on error
[subscriptionfeed.git] / app / dangerous / templates / channel.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 <!--
7 <img height=200 align=left src="{{ channel_img[channel_img.largest] }}" style="margin:.5em">
8 -->
9 {{ super() }}
10 <details><summary>About</summary><p style="white-space: pre-wrap">{{ channel_desc }}<hr></details>
11 <div style=clear:both></div>
12 <div id="subpages" style="display:flex;margin:1em">
13 <div style="flex:1">
14 <a href="{{ url_for('dangerous.channel', channel_id=channel_id, subpage='videos') }}">videos</a>
15 <a href="{{ url_for('dangerous.channel', channel_id=channel_id, subpage='playlists') }}">playlists</a>
16 </div>
17 <form method=get style="flex:1;text-align:right">
18 {% if list %}
19 <input type="hidden" name="list" value="{{playlist_id}}">
20 {% endif %}
21 <select name="sort">
22 <option value="">sort by...</option>
23 <option value="newest" {{ 'selected' if sort == 'newest' }}>newest first</option>
24 <option value="oldest" {{ 'selected' if sort == 'oldest' }}>oldest first</option>
25 {% if subpage == "videos" %}
26 <option value="popular" {{ 'selected' if sort == 'popular' }}>most popular</option>
27 {% elif subpage == "playlists" %}
28 <option value="modified" {{ 'selected' if sort == 'modified' }}>last modified</option>
29 {% endif %}
30 </select>
31 <input type="submit" value=">">
32 </form>
33 </div>
34 <div class="cards">
35 {# TODO: copy pasted from dangerous/search.j2 #}
36 {% for card in rows %}
37 {% set c = card.content %}
38 {% if card.type == 'VIDEO' %}
39 {% call macros.card(c.video_id, c.title, c.length) %}
40 {{ macros.infobar_subscriptions(c.video_id, c.channel_id, c.author) }}
41 <small>{{ c.published if c.published }}&nbsp;</small>
42 {% endcall %}
43 {% elif card.type == 'CHANNEL' and c.channel_id != channel_id %}
44 {% call macros.card_generic("/channel/"~c.channel_id, c.icons[c.icons.largest] if 'icons' in c else '', c.title) %}
45 <span class=channel>Channel</span>
46 <span class=advanced>{{ c.subscribers }}</span>
47 {% endcall %}
48 {% elif card.type == 'PLAYLIST' %}
49 {% call macros.card_generic("/playlist?list="~c.playlist_id, "https://i.ytimg.com/vi/"~c.video_id~"/mqdefault.jpg", c.title) %}
50 <span class=channel>{{ c.author }}</span>
51 <span class=advanced>{{ c.n_videos }} videos</span>
52 {% endcall %}
53 {% elif card.type == 'WEBSITE' %}
54 {% call macros.card_generic(c.url, c.icons[250] if 'icons' in c else '', c.title) %}
55 <span class=channel>{{ c.domain }}</span>
56 {% endcall %}
57 {% endif %}
58 {% endfor %}
59
60 {{ macros.dummycard() }}
61 </div>
62 </article>
63
64 {% if not rows|length %}no more results{% endif %}
65
66 <div class="pagination-container">
67 {% if page is not none %}
68 {{ macros.pagination("previous", {'page':(-1,1)}, -1) if page > 1 }}
69 {{ macros.pagination("next", {'page':(+1,1)}, +1) if has_more}}
70 {% endif %}
71 </div>
72 {% endblock %}
Imprint / Impressum