From 19aee623b1aac277997e2ffa9a92f88c5bf194bd Mon Sep 17 00:00:00 2001 From: socks Date: Sun, 18 Feb 2018 13:33:49 +0000 Subject: [PATCH] Navigation bar to show global highlighted on global page --- Tweeder.py | 2 +- templates/global.html | 17 +++++++++++++++++ templates/timeline.html | 3 ++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 templates/global.html diff --git a/Tweeder.py b/Tweeder.py index 9e248f5..95aa2e8 100644 --- a/Tweeder.py +++ b/Tweeder.py @@ -95,7 +95,7 @@ def timeline_view(): @app.route('/global', methods=['GET']) def global_timeline(): logged_in = True if 'username' in session.keys() else False - return render_template('timeline.html', logged_in=logged_in, posts=timeline.global_timeline()) + return render_template('global.html', logged_in=logged_in, posts=timeline.global_timeline()) @app.route('/settings', methods=['GET', 'POST']) diff --git a/templates/global.html b/templates/global.html new file mode 100644 index 0000000..c688d2d --- /dev/null +++ b/templates/global.html @@ -0,0 +1,17 @@ +{% extends 'layout.html' %} +{% block nav_global %} active {% endblock %} + +{% block content %} +
+
+ {% for post in posts if not post.hidden %} +
+
{{ post.poster }} at {{ post.timePosted.strftime('%Y-%m-%d %-H:%M') }} {% if logged_in == post.poster %} {% endif %}
+
+ {{ post.content }} +
+
+ {% endfor %} +
+
+{% endblock %} diff --git a/templates/timeline.html b/templates/timeline.html index c2fc050..2ca2884 100644 --- a/templates/timeline.html +++ b/templates/timeline.html @@ -1,5 +1,6 @@ {% extends 'layout.html' %} {% block nav_timeline %} active {% endblock %} + {% block content %}
@@ -13,4 +14,4 @@ {% endfor %}
-{% endblock %} \ No newline at end of file +{% endblock %}