From a1c0d373257e861c591eca8f498478465583acad Mon Sep 17 00:00:00 2001 From: Socks Date: Thu, 22 Feb 2018 19:12:34 +0000 Subject: [PATCH] Added view thread page, currently the same as replies without the ability to reply --- Tweeder.py | 9 +++++++++ templates/view.html | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 templates/view.html diff --git a/Tweeder.py b/Tweeder.py index a9c64cb..a919833 100644 --- a/Tweeder.py +++ b/Tweeder.py @@ -166,5 +166,14 @@ def unfollow(user): pass +@app.route("/view/", methods=["GET"]) +def view_thread(post_id): + logged_in = session['username'] if ('username' in session.keys()) else False + posts = timeline.get_full_replies(post_id) + return render_template('view.html', + logged_in=logged_in, + posts=posts) + + if __name__ == '__main__': app.run(debug=True) diff --git a/templates/view.html b/templates/view.html new file mode 100644 index 0000000..25167b7 --- /dev/null +++ b/templates/view.html @@ -0,0 +1,17 @@ +{% extends 'layout.html' %} +{% block content %} +
+
+ {% for post in posts %} +
+
{{ post.poster }} at {{ post.timePosted.strftime('%Y-%m-%d %-H:%M') }} {% if logged_in == post.poster %} {% endif %}
+
+ {{ post.content }} +
+
+ + {% endfor %} +
+
+ +{% endblock %}