2026-10-05 09:36:20 +02:00
<!-- retoor <retoor@molodetz.nl> -->
{% extends "admin/base_admin.html" %}
{% block admin_content %}
2026-10-05 11:25:41 +02:00
< h1 > {{ 'Edit post' if post else 'New post' }}</ h1 >
2026-10-05 09:36:20 +02:00
< form class = "form wide" method = "post" action = "{{ '/admin/posts/' ~ post.uid if post else '/admin/posts' }}" data-form >
2026-10-05 11:25:41 +02:00
< div class = "field" >< label for = "title" > Title</ label >< input id = "title" type = "text" name = "title" required minlength = "3" maxlength = "200" value = "{{ post.title if post else '' }}" ></ div >
{% set _selected = post.topic if post else 'roll' %}
2026-10-05 09:36:20 +02:00
{% include "_topic_selector.html" %}
< div class = "editor" >
< div class = "field" >
2026-10-05 11:25:41 +02:00
< label for = "body" > Text (markdown)</ label >
2026-10-05 09:36:20 +02:00
< textarea id = "body" name = "body" required minlength = "10" data-preview-source > {{ post.body if post else '' }}</ textarea >
2026-10-05 11:25:41 +02:00
< span class = "help" > Markdown with GFM. Emoji via :shortcode:. The preview on the right is live; the published version is rendered on the server.</ span >
2026-10-05 09:36:20 +02:00
</ div >
< div class = "field" >
2026-10-05 11:25:41 +02:00
< label > Preview</ label >
2026-10-05 09:36:20 +02:00
< dp-content class = "preview prose" data-preview-target ></ dp-content >
</ div >
</ div >
< div class = "field" >
< label for = "status" > Status</ label >
< select id = "status" name = "status" >
2026-10-05 11:25:41 +02:00
< option value = "draft" {% if not post or post . status = = ' draft ' %} selected {% endif %} > Draft</ option >
< option value = "published" {% if post and post . status = = ' published ' %} selected {% endif %} > Published</ option >
2026-10-05 09:36:20 +02:00
</ select >
</ div >
2026-10-05 11:25:41 +02:00
< label class = "check" >< input type = "checkbox" name = "is_placeholder" value = "true" {% if post and post . is_placeholder %} checked {% endif %} > Mark as placeholder</ label >
< div class = "actions" >< button class = "button" type = "submit" data-loading > Save</ button >< a class = "button ghost" href = "/admin/posts" > Cancel</ a ></ div >
2026-10-05 09:36:20 +02:00
</ form >
{% endblock %}
{% block extra_js %}< script type = "module" src = "{{ static_url('/static/js/utils/EditorPreview.js') }}" ></ script > {% endblock %}