]> git.gir.st - subscriptionfeed.git/blob - app/reddit/templates/reddit.html.j2
awful hack to align last row of cards
[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 {% set alt = row.n_karma~' karma, '~row.n_comments~' comments' %}
21 {{ '<span class=bad>' if 1 >= row.n_karma|int(10) }}
22 {% call macros.card(row.video_id, row.title, karma, row.pinned, alt, row.url) %}
23
24 <a href="{{ url_for('reddit.reddit', subreddit=row.subreddit) }}">
25 /r/{{ row.subreddit | lower | e }}
26 </a>
27 {% endcall %}{{ '</span>' if 1>=row.n_karma|int(10) }}
28 {% if row.pinned and not rows[loop.index].pinned %}
29 {{ macros.dummycard() }}
30 <hr>
31 {% endif %}
32 {% endfor %}
33 {{ macros.dummycard() }}
34 </div>
35 </article>
36
37 {% if before %}
38 <a href="?count={{ count-25 }}&before={{ before }}">prev</a> |
39 {% endif %}
40 {% if after %}
41 <a href="?count={{ count+25 }}&after={{ after }}">next</a>
42 {% endif %}
43
44 <hr>
45 <a href="/manage/subreddits">Manage Subreddits</a>
46 {% for subreddit in subreddits %}
47 {{ "||" if loop.first else "|"}}
48 <a href="/r/{{ subreddit }}">/r/{{ subreddit }}</a>
49 {% endfor %}
Imprint / Impressum