]> git.gir.st - subscriptionfeed.git/blob - app/templates/macros.imp.j2
switch to html watch page by default, fix csrf bugs
[subscriptionfeed.git] / app / templates / macros.imp.j2
1 {% macro card_generic(link, thumbnail, title='') -%}{#
2 #}<div class=card>
3 <a class=thumb href="{{ link }}">
4 <img src="{{ thumbnail }}">
5 </a>
6 <div class="title">
7 <a href="{{ link }}" title="{{ title | e }}">{{ title | e }}</a>
8 </div>
9 <div class="infobar">
10 {{ caller() }}
11 </div>
12 </div>{#
13 #}{%- endmacro %}
14
15 {% macro card(video_id, title='') -%}{#
16 #}{% set caller_ = caller %}{#
17 #}{% call card_generic("/watch?v="~video_id, "https://i.ytimg.com/vi/"~video_id~"/mqdefault.jpg", title) %}
18 {{ caller_() }}
19 {% endcall %}{#
20 #}{%- endmacro %}
21
22 {% macro infobar_subscriptions(video_id, channel_id, author, published, pinned="undefined") -%}
23 <a href="/channel/{{ channel_id }}">{{ author | e }}</a>
24 <details class=advanced><summary>{{ published }}</summary>
25 {% if pinned != "undefined" %}
26 <form method=post>
27 <input type="hidden" name="{{ 'un' if pinned }}pin" value="{{ video_id }}">
28 <input class="emoji" type=submit value="&#x1f4cc;&#xFE0F;{{ '&#8416;' if pinned }}" title="{{ 'unpin' if pinned else 'pin to top' }}">
29 </form>
30 <form method=post>
31 <input type="hidden" name="hide" value="{{ video_id }}">
32 <input class="emoji" type=submit value="&#x1f4a8;&#xFE0F;" title="hide video">
33 </form>
34 {%endif%}
35 <a href="/watch?v={{ video_id }}&show=raw" class="emoji" title="raw video">&#x1F39E;&#xFE0F;</a>
36 </details>
37 {%- endmacro %}
38 {% macro infobar_reddit(comments, karma) -%}
39 {%- endmacro %}
Imprint / Impressum