{% extends "base_template.html" %} {% block title %}{{ _('Edit post') if post else _('New post') }}{% endblock %} {% block head %} {% endblock %} {% block content %}

{{ _('Edit post') if post else _('New post') }}

{{ _('← Back to posts') }}
{% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endwith %}
{# Progressive enhancement. The textarea is the real field and works on its own; splent-editor.js (vendored, offline) hides it, reveals the toolbar shell and writes clean semantic HTML back into it on submit. #}
{% from "media/_picker.html" import media_picker %} {{ media_picker("featured_image", post.featured_image if post else None, media, value_attr="url") }}
{{ _('Leave empty to publish now. A published post with a future date stays hidden until that time.') }}
{% for c in categories %}
{% endfor %}
{% if not categories %}
{{ _('No categories yet.') }}
{% endif %}
{# Insert image dialog for the editor. Outside the
on purpose, so the picker radios are never submitted with the post. Reuses the one shared media picker, the same control the featured image uses. #}

{{ _('Insert image') }}

{{ media_picker("editor_image", None, media, value_attr="url", allow_none=false) }}
{% endblock %} {% block scripts %} {% endblock %}