]> git.gir.st - subscriptionfeed.git/blob - app/templates/macros.imp.j2
add search bar (no impl yet)
[subscriptionfeed.git] / app / templates / macros.imp.j2
1 {% macro headerbar(search_query="") -%}
2 <span style=float:left>
3 <b style=font-size:large><!--span style=font-family:serif>&Delta;</span-->delta</b>
4 </span>
5 {% if current_user.is_anonymous %}
6 <a href="/login" style=float:right>log in or sign up</a>
7 {% else %}
8 <span style=float:right>{{ current_user.name }} (<a href="/login">log out</a>)</span>
9 {% endif %}
10 <form method=get action=/search>
11 <input name=q style="margin:auto;display:block;width:30em;box-sizing:border-box;border:0;background:#666;color:#eee;padding:.2em"
12 placeholder="Search (through invidio.us)" value="{{ search_query | e }}">
13 <input type=hidden name=provider value="invidio.us:443">
14 <!--input type=submit value="?"-->
15 </form>
16 <hr>
17 {%- endmacro %}
18
19 {% macro card_generic(link, thumbnail, title='') -%}{#
20 #}<div class=card>
21 <a class=thumb href="{{ link }}">
22 <img src="{{ thumbnail }}">
23 </a>
24 <div class="title">
25 <a href="{{ link }}" title="{{ title | e }}">{{ title | e }}</a>
26 </div>
27 <div class="infobar">
28 {{ caller() }}
29 </div>
30 </div>{#
31 #}{%- endmacro %}
32
33 {% macro card(video_id, title='', advanced_text='', pinned="undefined") -%}{#
34 #}{% set caller_ = caller %}{#
35 #}{% call card_generic("/watch?v="~video_id, "https://i.ytimg.com/vi/"~video_id~"/mqdefault.jpg", title) %}
36 {{ caller_() }}
37 <details class=advanced><summary>{{ advanced_text }}</summary>
38 {% if pinned != "undefined" %}
39 <form method=post>
40 <input type="hidden" name="{{ 'un' if pinned }}pin" value="{{ video_id }}">
41 <input class="emoji" type=submit value="&#x1f4cc;&#xFE0F;{{ '&#8416;' if pinned }}" title="{{ 'unpin' if pinned else 'pin to top' }}">
42 </form>
43 <form method=post>
44 <input type="hidden" name="hide" value="{{ video_id }}">
45 <input class="emoji" type=submit value="&#x1f4a8;&#xFE0F;" title="hide video">
46 </form>
47 {%endif%}
48 <a href="/watch?v={{ video_id }}&show=raw" class="emoji" title="raw video">&#x1F39E;&#xFE0F;</a>{#
49 #}<a href="/watch?v={{ video_id }}&show=json" class="emoji" title="json metadata">&#x1f4a1;</a>
50 </details>
51 {% endcall %}{#
52 #}{%- endmacro %}
53
54 {% macro infobar_subscriptions(video_id, channel_id, author) -%}
55 <a href="/channel/{{ channel_id }}">{{ author | e }}</a>
56 {%- endmacro %}
Imprint / Impressum