From f7d8a5678fb1ee5280bfc8c48567d438e9553ff7 Mon Sep 17 00:00:00 2001 From: girst Date: Thu, 11 Jun 2020 20:28:07 +0200 Subject: [PATCH] de-hardcode subreddit footer --- app/reddit/__init__.py | 3 ++- app/reddit/templates/reddit.html.j2 | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/reddit/__init__.py b/app/reddit/__init__.py index 4310b50..13a6695 100644 --- a/app/reddit/__init__.py +++ b/app/reddit/__init__.py @@ -31,7 +31,8 @@ def reddit(subreddit=None): # TODO: for /feed/reddit: pin/hide videos title = f"/r/{subreddit}" if subreddit else "my subreddits" - return render_template('reddit.html.j2', subreddit=title, rows=videos, before=before, after=after, count=count) + return render_template('reddit.html.j2', title=title, rows=videos, + subreddits=subreddits, before=before, after=after, count=count) @frontend.route('/manage/subreddits') # disabled for guest user: @login_required diff --git a/app/reddit/templates/reddit.html.j2 b/app/reddit/templates/reddit.html.j2 index b313ba0..972ea51 100644 --- a/app/reddit/templates/reddit.html.j2 +++ b/app/reddit/templates/reddit.html.j2 @@ -1,5 +1,5 @@ -{{ subreddit | e }} +{{ title | e }} {% import 'macros.imp.j2' as macros %} +{% include 'messages.inc.j2' %} -{{ subreddit | e }}
+{{ title | e }}
{% for row in rows %}{# @@ -20,11 +21,16 @@ #}{% endfor %}
- {% if before %} prev | {% endif %} +{% if after %} next - - -
/r/videos | /r/mealtimevideos | /r/documentaries | /r/curiousvideos +{% endif %} + +
+Manage Subreddits +{% for subreddit in subreddits %} +{{ "||" if loop.first else "|"}} +/r/{{ subreddit }} +{% endfor %} -- 2.39.3