{% for post in posts %}

{{ post.content|safe }}

{% if post.image_url %} Post image {% endif %}
{% if post.author %} {% if post.author.profile_picture %} Profile Picture {% else %}
{{ post.author.username[0].upper() }}
{% endif %} {{ post.author.username }} {% else %} {{ post.anonymous_username }} {% 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 %}
{% endfor %}