From 7f94bade46781268b45951ef10507a72f998dd78 Mon Sep 17 00:00:00 2001 From: Simple_Not <44047940+moonbaseDelta@users.noreply.github.com> Date: Wed, 19 Jul 2023 00:28:45 +1000 Subject: [PATCH] we can chat now? --- app.py | 16 +++++++++++++++ templates/answer-post.html | 30 +++++++++++++++++++++++++++ templates/i-posts.html | 3 ++- templates/interactive-posts.html | 35 ++------------------------------ 4 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 templates/answer-post.html diff --git a/app.py b/app.py index 73bacda..6a9b4f4 100644 --- a/app.py +++ b/app.py @@ -63,6 +63,22 @@ def page_posts_from_db(target_post_id=None): return render_template("interactive-posts.html", host_id=docker_short_id, postos=postos, target_post_id=target_post_id) + +@app.route("/answer_post/") +def page_posts_from_db(target_post_id): + + postos = db.collection('posts') + postos = [ p for p in postos] + postos = sorted(postos, key=lambda posto: posto['_key'], reverse=False) + + if not target_post_id: + target_post_id = postos[0]['_key'] + + return render_template("answer-post.html", target_post_id=target_post_id) + + + + @app.route('/post_my_post/', methods=['POST']) def post_a_post(post_key): diff --git a/templates/answer-post.html b/templates/answer-post.html new file mode 100644 index 0000000..d9d31af --- /dev/null +++ b/templates/answer-post.html @@ -0,0 +1,30 @@ +
+
+
+ Создай то, о чем будут говорить многие. + >> +
+ + +
+
+
+
+ +
+ +
\ No newline at end of file diff --git a/templates/i-posts.html b/templates/i-posts.html index 474ac04..20594c9 100644 --- a/templates/i-posts.html +++ b/templates/i-posts.html @@ -33,7 +33,8 @@ diff --git a/templates/interactive-posts.html b/templates/interactive-posts.html index 1a21115..3eca4a2 100644 --- a/templates/interactive-posts.html +++ b/templates/interactive-posts.html @@ -6,39 +6,8 @@ {% include 'navbar.html' %}
-
-
-
-
- Создай то, о чем будут говорить многие. - >> -
- - -
-
-
-
- -
- - -
-
+
+ {% include 'answer-post.html' %}