]> git.gir.st - subscriptionfeed.git/blob - app/templates/macros.imp.j2
webhooks: enforce signature checking, use channel_id from url path
[subscriptionfeed.git] / app / templates / macros.imp.j2
1 {% macro headerbar(search_query="") -%}
2 <style>
3 [name=q]::placeholder{
4 color:#eee;
5 opacity: .7;
6 }
7 </style>
8 <span style=float:left>
9 <a href="/">
10 <b style=font-size:large><!--span style=font-family:serif>&Delta;</span-->delta</b>
11 </a>
12 </span>
13 {% if current_user.is_anonymous %}
14 <a href="/login?next={{ request.url | urlencode }}" style=float:right>log in or sign up</a>
15 {% else %}
16 <span style=float:right>{{ current_user.name }} (<a href="/login">log out</a>)</span>
17 {% endif %}
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="?"-->
23 </form>
24 <hr>
25 {%- endmacro %}
26
27 {% macro card_generic(link, thumbnail, title='') -%}
28 <div class="card">
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>
33 </div>
34 <div class="infobar">
35 {{ caller() }}
36 </div>
37 </div>
38 {%- endmacro %}
39
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) %}
43 {{ caller_() }}
44 <details class="advanced"><summary>{{ advanced_text }}</summary>
45 {% if pinned != "undefined" %}
46 <form method=post>
47 <input type="hidden" name="{{ 'un' if pinned }}pin" value="{{ post_id }}">
48 <input class="emoji" type=submit value="&#x1f4cc;&#xFE0F;{{ '&#8416;' if pinned }}" title="{{ 'unpin' if pinned else 'pin to top' }}">
49 </form>
50 <form method=post>
51 <input type="hidden" name="hide" value="{{ post_id }}">
52 <input class="emoji" type=submit value="&#x1f4a8;&#xFE0F;" title="hide video">
53 </form>
54 {%endif%}
55 <a href="/watch?v={{ video_id }}&show=raw" class="emoji" title="raw video">&#x1F39E;&#xFE0F;</a>{#
56 #}<a href="/watch?v={{ video_id }}&show=json" class="emoji" title="json metadata">&#x1f4a1;</a>
57 </details>
58 {% endcall %}
59 {%- endmacro %}
60
61 {% macro infobar_subscriptions(video_id, channel_id, author) -%}
62 <a class="info-main" href="/channel/{{ channel_id }}">{{ author | e }}</a>
63 {%- endmacro %}
Imprint / Impressum