From cafc557c6820e1808b1e4cf71f58ff99b97ca545 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Sat, 28 Oct 2023 11:44:09 -0500 Subject: Add blueprint blog --- flaskr/templates/blog/index.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 flaskr/templates/blog/index.html (limited to 'flaskr/templates/blog/index.html') diff --git a/flaskr/templates/blog/index.html b/flaskr/templates/blog/index.html new file mode 100644 index 0000000..0d3ed17 --- /dev/null +++ b/flaskr/templates/blog/index.html @@ -0,0 +1,30 @@ +{% extends 'base.html' %} + + +{% block header %} +

{% block title %}Posts{% endblock %}

+ {% if g.user %} + New + {% endif %} +{% endblock %} + +{% block content %} + {% for post in posts %} +
+
+
+

{{ post['title'] }}

+
by {{ post['username'] }} on {{ post['created'].strftime('%Y-%m-%d') }}
+
+ {% if g.user['id'] == post['author_id'] %} + Edit + {% endif %} +
+

{{ post['body'] }}

+
+ {% if not loop.last %} + {# Separate posts with a line #} +
+ {% endif %} + {% endfor %} +{% endblock %} \ No newline at end of file -- cgit v1.2.3