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", advanced_title='', post_url=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 title="{{advanced_title}}">{{ advanced_text }}</summary>
47 {{ emoji_link("comments", post_url, False) }}
49 {% if pinned != "undefined" %}
50 {{ emoji_button("pin", video_id, pinned, False) }}
51 {{ emoji_button("hide", video_id, False, False) }}
53 {{ emoji_link("raw", video_id, False) }}
54 {{ emoji_link("json", video_id, False) }}
59 {% macro infobar_subscriptions(video_id, channel_id, author) -%}
60 <a class="info-main" href="/channel/{{ channel_id }}">{{ author | e }}</a>
63 {% macro emoji_button(action, subject, reverse=False, text=False) -%}
65 'pin': ['📌️', '📌️⃠'],
66 'hide': ['💨️', ''],
67 'subscribe': ['📝️', '🗑️'],
70 'pin': ['pin to <!--top of subscription--> feed', 'unpin'],
71 'hide': ['hide video', ''],
72 'subscribe': ['subscribe', 'unsubscribe'],
75 'pin': 'youtube.feed_post',
76 'hide': 'youtube.feed_post',
77 'subscribe': 'youtube.manage_subscriptions',
79 <form method=post action="{{ url_for(actions[action]) }}">
80 <input type="hidden" name="{{ 'un' if reverse }}{{ action }}" value="{{ subject }}">
82 <input class="emoji" type=submit value="{{ icons[action][reverse] }}" title="{{ texts[action][reverse] }}">
83 {{ texts[action][reverse] if text }}
87 {% macro emoji_link(action, subject, text=False) -%}
89 'raw': '🎞️',
91 'comments': '💬',
94 'raw': 'show raw video',
95 'json': 'view json metadata',
96 'comments': 'view comments',
99 'raw': '/watch?v='~subject~'&show=raw',
100 'json': '/watch?v='~subject~'&show=json',
101 'comments': 'https://old.reddit.com'~subject,
103 <a href="{{ actions[action] }}" title="{{ texts[action] }}"><span class="emoji">{{ icons[action] }}</span>{{ texts[action] if text }}</a>