1 {% extends "base.html.j2" %}
2 {% import 'macros.imp.j2' as macros %}
3 {% block title %}{{ title | e }}{% endblock %}
7 <img height=200 align=left src="{{ channel_img[channel_img.largest] }}" style="margin:.5em">
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">
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 <form method=get style="display:inline" action="{{ url_for('dangerous.channel', channel_id=channel_id, subpage='search')}}">
17 <input style="background:0;color:#eee;border:0" type=text name=q value="{{ request.args.get('q', '')}}" placeholder="search channel">
18 <!-- <input type="submit" value=">"> -->
21 <form method=get style="flex:1;text-align:right">
23 <input type="hidden" name="list" value="{{playlist_id}}">
26 <option value="">sort by...</option>
27 <option value="newest" {{ 'selected' if sort == 'newest' }}>newest first</option>
28 <option value="oldest" {{ 'selected' if sort == 'oldest' }}>oldest first</option>
29 {% if subpage == "videos" %}
30 <option value="popular" {{ 'selected' if sort == 'popular' }}>most popular</option>
31 {% elif subpage == "playlists" %}
32 <option value="modified" {{ 'selected' if sort == 'modified' }}>last modified</option>
35 <input type="submit" value=">">
39 {# TODO: copy pasted from dangerous/search.j2 #}
40 {% for card in rows %}
41 {% set c = card.content %}
42 {% if card.type == 'VIDEO' %}
43 {% call macros.card(c.video_id, c.title, c.length) %}
44 {{ macros.infobar_subscriptions(c.video_id, c.channel_id, c.author) }}
45 <small>{{ c.published if c.published }} </small>
47 {% elif card.type == 'CHANNEL' and c.channel_id != channel_id %}
48 {% call macros.card_generic("/channel/"~c.channel_id, c.icons[c.icons.largest] if 'icons' in c else '', c.title) %}
49 <span class=channel>Channel</span>
50 <span class=advanced>{{ c.subscribers }}</span>
52 {% elif card.type == 'PLAYLIST' %}
53 {% call macros.card_generic("/playlist?list="~c.playlist_id, "https://i.ytimg.com/vi/"~c.video_id~"/mqdefault.jpg", c.title) %}
54 <span class=channel>{{ c.author }}</span>
55 <span class=advanced>{{ c.n_videos }} videos</span>
57 {% elif card.type == 'WEBSITE' %}
58 {% call macros.card_generic(c.url, c.icons[250] if 'icons' in c else '', c.title) %}
59 <span class=channel>{{ c.domain }}</span>
64 {{ macros.dummycard() }}
68 {% if not rows|length %}no more results{% endif %}
70 <div class="pagination-container">
71 {% if page is not none %}
72 {{ macros.pagination("previous", {'page':(-1,1)}, -1) if page > 1 }}
73 {{ macros.pagination("next", {'page':(+1,1)}, +1) if has_more}}