{% extends 'base.html' %} {% from 'bootstrap5/pagination.html' import render_pagination %} {% from 'macros.html' import render_inline_form %} {% block title %}Manage Posts{% endblock %} {% block content %} {% if posts %} {% for post in posts %} {% endfor %}
Title Category Date Comments Words Actions
{{ post.title }} {{ post.category.name }} Created at {{ post.created_at }}
Updated at {{ post.updated_at }}
{{ post.comments|length }} {{ post.body|striptags|length }} {{ render_inline_form( action=url_for('.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, ) }} Edit {{ render_inline_form( action=url_for('.delete_post', post_id=post.id, next=request.full_path), button_style='outline-danger', button_text='Delete', ) }}
{% else %}
No posts.
{% endif %} {% endblock %}