1 {% macro card_generic(link, thumbnail, title='') -%}
3 <div class="card-main">
4 <img class="thumb" src="{{ thumbnail or "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' fill='%23fff'><circle r='30' cx='80' cy='150' fill='%23fff' stroke='%23000'/><circle r='30' cx='150' cy='150' fill='%23fff' stroke='%23000'/><circle r='30' cx='220' cy='150' fill='%23fff' stroke='%23000'/></svg>"}}">
5 <div class="title">{{ title | e }}</div>
6 <a class="link-main" href="{{ link }}" title="{{ title | e }}"></a>
14 {% macro card(video_id, title='', advanced_text='', pinned="undefined", advanced_title='', post_url=None) -%}
15 {% set caller_ = caller %}
16 {% call card_generic("/watch?v="~video_id, "https://i.ytimg.com/vi/"~video_id~"/mqdefault.jpg", title) %}
18 <details class="advanced"><summary title="{{advanced_title}}">{{ advanced_text }}</summary>
21 {{ emoji_link("comments", post_url, False) }}
23 {{ emoji_link("audio", video_id, False) }}
24 {% if pinned != "undefined" %}
25 {{ emoji_button("pin", video_id, pinned, False) }}
26 {{ emoji_button("hide", video_id, False, False) }}
28 {{ emoji_link("raw", video_id, False) }}
29 {{ emoji_link("json", video_id, False) }}
34 {% macro dummycard() -%}
35 {% for _ in range(4) %}
36 <div class="dummy card"></div>
40 {% macro infobar_subscriptions(video_id, channel_id, author) -%}
41 <a class="info-main" href="/channel/{{ channel_id }}">{{ author | e }}</a>
44 {% macro emoji_button(action, subject, reverse=False, text=False) -%}
46 'pin': ['📌️', '📌️⃠'],
47 'hide': ['💨️', ''],
48 'subscribe': ['📝️', '🗑️'],
51 'pin': ['pin to <!--top of subscription--> feed', 'unpin'],
52 'hide': ['hide video', ''],
53 'subscribe': ['subscribe', 'unsubscribe'],
56 'pin': 'youtube.feed_post',
57 'hide': 'youtube.feed_post',
58 'subscribe': 'youtube.manage_subscriptions',
60 <form method=post action="{{ url_for(actions[action]) }}" class="emoji-form">
61 <input type="hidden" name="{{ 'un' if reverse }}{{ action }}" value="{{ subject }}">
62 <label title="{{ texts[action][reverse] }}">
63 <input type="submit" hidden>
64 <span class="emoji">{{ icons[action][reverse] }}</span>{#
65 #}<span class="notemoji">{{ texts[action][reverse] if text }}</span>
69 {% macro emoji_link(action, subject, text=False) -%}
71 'raw': '🎞️',
74 'comments': '💬',
77 'raw': 'show raw video',
78 'json': 'view json metadata',
79 'audio': 'listen to audio only',
80 'comments': 'view comments',
83 'raw': '/watch?v='~subject~'&show=raw',
84 'json': '/watch?v='~subject~'&show=json',
85 'audio': '/watch?v='~subject~'&show=audio',
86 'comments': 'https://old.reddit.com'~subject,
88 <a href="{{ actions[action] }}" title="{{ texts[action] }}">{#
89 #}<span class="emoji">{{ icons[action] }}</span>{#
90 #}<span class="notemoji">{{ texts[action] if text }}</span>