{% 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 %}