]> git.gir.st - subscriptionfeed.git/blob - app/reddit/templates/reddit.html.j2
let all templates inherit from a base template
[subscriptionfeed.git] / app / reddit / templates / reddit.html.j2
1 {% extends "base.html.j2" %}
2 {% import 'macros.imp.j2' as macros %}
3
4 {% block title %}{{ title | e }}{% endblock %}
5 {% block favicon %}
6 <link rel="shortcut icon" href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" fill="%23fff"><circle r="150" cx="150" cy="150" fill="%23f40"/><path d="m150 80l80 80h-40v40h-80v-40h-40l80-80"/></svg>'>
7 <style>
8 .bad { opacity: 50% }
9 .bad img { filter: grayscale(100%) }
10 </style>
11 {% endblock %}
12
13 {% block content %}
14 {{ super() }}
15 <div class="cards">
16 {% for row in rows %}
17 {% set karma = '&#x2191;' ~ row.n_karma|trim3 %}
18 {% set alt = row.n_karma~' karma, '~row.n_comments~' comments' %}
19 {{ '<span class=bad>' if 1 >= row.n_karma|int(10) }}
20 {% call macros.card(row.video_id, row.title, karma, row.pinned, alt, row.url) %}
21
22 <a href="{{ url_for('reddit.reddit', subreddit=row.subreddit) }}">
23 /r/{{ row.subreddit | lower | e }}
24 </a>
25 {% endcall %}{{ '</span>' if 1>=row.n_karma|int(10) }}
26 {% if row.pinned and not rows[loop.index].pinned %}
27 {{ macros.dummycard() }}
28 <hr>
29 {% endif %}
30 {% endfor %}
31 {{ macros.dummycard() }}
32 </div>
33
34 {% if before %}
35 <a href="?count={{ count-25 }}&before={{ before }}">prev</a> |
36 {% endif %}
37 {% if after %}
38 <a href="?count={{ count+25 }}&after={{ after }}">next</a>
39 {% endif %}
40 {% endblock %}
41
42 {% block footer %}
43 <hr>
44 <a href="/manage/subreddits">Manage Subreddits</a>
45 {% for subreddit in subreddits %}
46 {{ "||" if loop.first else "|"}}
47 <a href="/r/{{ subreddit }}">/r/{{ subreddit }}</a>
48 {% endfor %}
49 {% endblock %}
Imprint / Impressum