]> git.gir.st - subscriptionfeed.git/blob - app/reddit/templates/reddit.html.j2
use flexbox for card component
[subscriptionfeed.git] / app / reddit / templates / reddit.html.j2
1 <!DOCTYPE html>
2 <title>{{ title | e }}</title>
3 <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>'>
4 <link rel="stylesheet" href="/static/style.css">
5 <style>
6 .bad { opacity: 50% }
7 .bad img { filter: grayscale(100%) }
8 </style>
9
10 {% import 'macros.imp.j2' as macros with context %}
11 {{ macros.headerbar() }}
12
13 {% include 'messages.inc.j2' %}
14
15 <article>
16 <h1>{{ title | e }}</h1>
17 <div class="cards">
18 {% for row in rows %}
19 {% set karma = '&#x2191;' ~ row.n_karma|trim3 %}
20 {{ '<span class=bad>' if 1 >= row.n_karma|int(10) }}
21 {% call macros.card(row.video_id, row.title, karma, row.pinned, row.post_id) %}
22
23 <a href="https://old.reddit.com{{ row.url }}" title="{{ row.n_karma }} karma, {{ row.n_comments }} comments">
24 /r/{{ row.subreddit | lower | e }}
25 </a>
26 {% endcall %}{{ '</span>' if 1>=row.n_karma|int(10) }}
27 {% if row.pinned and not rows[loop.index].pinned %}
28 <hr>
29 {% endif %}
30 {% endfor %}
31 </div>
32 </article>
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
41 <hr>
42 <a href="/manage/subreddits">Manage Subreddits</a>
43 {% for subreddit in subreddits %}
44 {{ "||" if loop.first else "|"}}
45 <a href="/r/{{ subreddit }}">/r/{{ subreddit }}</a>
46 {% endfor %}
Imprint / Impressum