]> git.gir.st - subscriptionfeed.git/blob - app/templates/macros.imp.j2
/search using invidious api (very ugly)
[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" 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 <a class=thumb href="{{ link }}">
30 <img src="{{ thumbnail }}">
31 </a>
32 <div class="title">
33 <a href="{{ link }}" title="{{ title | e }}">{{ title | e }}</a>
34 </div>
35 <div class="infobar">
36 {{ caller() }}
37 </div>
38 </div>{#
39 #}{%- endmacro %}
40
41 {% macro card(video_id, title='', advanced_text='', pinned="undefined") -%}{#
42 #}{% set caller_ = caller %}{#
43 #}{% call card_generic("/watch?v="~video_id, "https://i.ytimg.com/vi/"~video_id~"/mqdefault.jpg", title) %}
44 {{ caller_() }}
45 <details class=advanced><summary>{{ advanced_text }}</summary>
46 {% if pinned != "undefined" %}
47 <form method=post>
48 <input type="hidden" name="{{ 'un' if pinned }}pin" value="{{ video_id }}">
49 <input class="emoji" type=submit value="&#x1f4cc;&#xFE0F;{{ '&#8416;' if pinned }}" title="{{ 'unpin' if pinned else 'pin to top' }}">
50 </form>
51 <form method=post>
52 <input type="hidden" name="hide" value="{{ video_id }}">
53 <input class="emoji" type=submit value="&#x1f4a8;&#xFE0F;" title="hide video">
54 </form>
55 {%endif%}
56 <a href="/watch?v={{ video_id }}&show=raw" class="emoji" title="raw video">&#x1F39E;&#xFE0F;</a>{#
57 #}<a href="/watch?v={{ video_id }}&show=json" class="emoji" title="json metadata">&#x1f4a1;</a>
58 </details>
59 {% endcall %}{#
60 #}{%- endmacro %}
61
62 {% macro infobar_subscriptions(video_id, channel_id, author) -%}
63 <a href="/channel/{{ channel_id }}">{{ author | e }}</a>
64 {%- endmacro %}
Imprint / Impressum