{% extends 'base.html' %} {% from 'bootstrap5/form.html' import render_form %} {% from 'bootstrap5/pagination.html' import render_pagination %} {% from 'macros.html' import render_inline_form %} {% block title %}{{ post.title }}{% endblock %} {% block content %}
{{ post.body|safe }}
Created at {{ post.created_at }}, {% if post.updated_at %}last updated at {{ post.updated_at }},{% endif %} belongs to the {{ post.category.name }} category.

{{ pagination.total }} Comments latest {% if current_user.is_authenticated %}
{{ render_inline_form( action=url_for('admin.set_comment', post_id=post.id, next=request.full_path), button_style='outline-warning' if post.can_comment else 'outline-success', button_text='Disable Comment' if post.can_comment else 'Enable Comment', confirm=None, ) }}
{% endif %}

{% if comments %}
    {% for comment in comments %}
  • {% if comment.from_admin %}{{ admin.name }}{% else %}{{ comment.author }}{% endif %} {% if comment.from_admin %}Author{% endif %}
    {{ comment.created_at }}
    {% if comment.replied %}

    {{ comment.replied.author }}:
    {{ comment.replied.body }}

    {% endif %}

    {{ comment.body }}

    Reply {% if current_user.is_authenticated %} Email {{ render_inline_form( action=url_for('admin.delete_comment', comment_id=comment.id, next=request.full_path), button_style='outline-danger', button_text='Delete', ) }} {% endif %}
  • {% endfor %}
{% else %}
No comments.
{% endif %}
{% if comments %} {{ render_pagination(pagination, fragment='#comments') }} {% endif %} {% if request.args.get('reply') %}
Reply to {{ request.args.get('author') }}: Cancel
{% endif %} {% if post.can_comment %}
{{ render_form(form, action=request.full_path) }}
{% else %}
Comment disabled.
{% endif %}
{% endblock %}