{# Shared create + edit form for posts. Context: - user : app.models.entities.User - post : app.models.entities.Post | None (None on create) - form : dict {title, body_md, status} - errors : dict {field_name: message} - csrf_token : str Status dropdown policy: - On create: draft is default, admin may pick published. - On edit: status is read-only here — use the toggle-publish button on the dashboard. Keeps the write path explicit. #} {% extends "admin/base.html" %} {% block title %} {% if post %}Edit post{% else %}New post{% endif %} — Admin {% endblock %} {% block content %}

{% if post %}Edit post{% else %}New post{% endif %}

{% if post %}

Slug: {{ post.slug }} {% if post.status.value == "published" %} · slug is locked because this post is published. {% endif %}

{% endif %}
{% if errors %} {% endif %}
{% if not post %}
{% endif %}
Drop an image here to upload & insert. Accepted: JPG, PNG, WebP up to 8 MB.
Preview
{% if post %}{{ post.body_html_cached|safe }}{% endif %}
Cancel
{% endblock %} {% block scripts %} {% endblock %}