diff --git a/template/posts_partial.html b/template/posts_partial.html new file mode 100644 index 0000000..45dfcb3 --- /dev/null +++ b/template/posts_partial.html @@ -0,0 +1,45 @@ +{% for post in posts %} +
{{ post.content|safe }}
+ {% if post.image_url %} + + {% endif %} +{{ post.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
+ + + + Open in new tab + + + {% if (current_user.is_authenticated and post.author and current_user.id == post.author.id) or (not current_user.is_authenticated and post.user_id == session['user_id']) %} + + Edit + + {% endif %} +Bio:
+Posts: {{ post_count }}
+Total Likes: {{ like_count }}
+Total Comments: {{ comment_count }}
+ {% if current_user.is_authenticated and current_user.id == user.id %} + + {% endif %} +{{ post.content|safe }}
+ {% if post.image_url %} + + {% endif %} +{{ post.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
+ + + {% if current_user.is_authenticated and current_user.id == post.author.id %} + + Edit + + {% endif %} +
Comments:
++ {% for comment in post.comments if not comment.parent %} + {% with depth=1 %} + {% include 'comment.html' %} + {% endwith %} + {% endfor %} +
+ +