From 6094f277b5ef6478fa98d5403f33e7870f1edb25 Mon Sep 17 00:00:00 2001 From: Simple_Not <44047940+moonbaseDelta@users.noreply.github.com> Date: Thu, 13 Jul 2023 19:50:45 +1000 Subject: [PATCH] check posts --- app.py | 10 ++++++++++ templates/i-posts.html | 7 +++++++ templates/interactive-posts.html | 14 ++++++++++++++ templates/main-page.html | 4 ++-- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 templates/i-posts.html create mode 100644 templates/interactive-posts.html diff --git a/app.py b/app.py index 1e13dc0..a2e21a8 100644 --- a/app.py +++ b/app.py @@ -56,6 +56,16 @@ def page_board(board_id): return render_template("board.html", board_id=board_id, boards=board_list, board_threads=b_threads) + +@app.route("/db_posts") +def page_posts_from_db(): + + posts = db.collection('posts') + postos = [ p for p in postos] + + return render_template("interactive-posts.html", postos=postos) + + # @app.route('/post_my_post', method=['POST']) # def post_a_post(): # pass diff --git a/templates/i-posts.html b/templates/i-posts.html new file mode 100644 index 0000000..fcfd693 --- /dev/null +++ b/templates/i-posts.html @@ -0,0 +1,7 @@ +{% if posts | length > 0 %} + {% for post in posts %} +
+ {{ post.texto }} +
+ {% endfor %} +{% endif %} \ No newline at end of file diff --git a/templates/interactive-posts.html b/templates/interactive-posts.html new file mode 100644 index 0000000..ac12c1b --- /dev/null +++ b/templates/interactive-posts.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} + + + + + +{% include 'i-posts.html' %} + +{% endblock content %} \ No newline at end of file diff --git a/templates/main-page.html b/templates/main-page.html index eeb2798..0aa0c79 100644 --- a/templates/main-page.html +++ b/templates/main-page.html @@ -9,9 +9,9 @@