1 {% macro headerbar(search_query="") -%}
8 <span style=float:left>
10 <b style=font-size:large><!--span style=font-family:serif>Δ</span-->delta</b>
13 {% if current_user.is_anonymous %}
14 <a href="/login?next={{ request.url | urlencode }}" style=float:right>log in or sign up</a>
16 <span style=float:right>{{ current_user.name }} (<a href="/login">log out</a>)</span>
18 <form method=get action=/search>
19 <input name=q style="margin:auto;display:block;width:30em;box-sizing:border-box;border:0;background:#666;color:#eee;padding:.2em"
20 placeholder="Search (through invidio.us)" value="{{ search_query | e }}">
21 <input type=hidden name=provider value="invidio.us:443">
22 <!--input type=submit value="?"-->
27 {% macro card_generic(link, thumbnail, title='') -%}
29 <div class="card-main">
30 <img class="thumb" src="{{ thumbnail }}">
31 <div class="title">{{ title | e }}</div>
32 <a class="link-main" href="{{ link }}" title="{{ title | e }}"></a>
40 {% macro card(video_id, title='', advanced_text='', pinned="undefined", post_id=None) -%}
41 {% set caller_ = caller %}
42 {% call card_generic("/watch?v="~video_id, "https://i.ytimg.com/vi/"~video_id~"/mqdefault.jpg", title) %}
44 <details class="advanced"><summary>{{ advanced_text }}</summary><div class="details">
45 {% if pinned != "undefined" %}
46 {{ emoji_button("pin", video_id, pinned, False) }}
47 {{ emoji_button("hide", channel_id, False, False) }}
49 {{ emoji_link("raw", video_id, False) }}
50 {{ emoji_link("json", video_id, False) }}
55 {% macro infobar_subscriptions(video_id, channel_id, author) -%}
56 <a class="info-main" href="/channel/{{ channel_id }}">{{ author | e }}</a>
59 {% macro emoji_button(action, subject, reverse=False, text=False) -%}
61 'pin': ['📌️', '📌️⃠'],
62 'hide': ['💨️', ''],
63 'subscribe': ['📝️', '🗑️'],
66 'pin': ['pin to <!--top of subscription--> feed', 'unpin'],
67 'hide': ['hide video', ''],
68 'subscribe': ['subscribe', 'unsubscribe'],
71 'pin': 'youtube.feed_post',
72 'hide': 'youtube.feed_post',
73 'subscribe': 'youtube.manage_subscriptions',
75 <form method=post action="{{ url_for(actions[action]) }}">
76 <input type="hidden" name="{{ 'un' if reverse }}{{ action }}" value="{{ subject }}">
78 <input class="emoji" type=submit value="{{ icons[action][reverse] }}" title="{{ texts[action][reverse] }}">
79 {{ texts[action][reverse] if text }}
83 {% macro emoji_link(action, subject, text=False) -%}
85 'raw': '🎞️',
89 'raw': 'show raw video',
90 'json': 'view json metadata',
93 'raw': '/watch?v='~subject~'&show=raw',
94 'json': '/watch?v='~subject~'&show=json',
96 <a href="{{ actions[action] }}" title="{{ texts[action] }}"><span class="emoji">{{ icons[action] }}</span>{{ ' '~texts[action] if text }}</a>