32 lines
1.9 KiB
HTML
32 lines
1.9 KiB
HTML
<!-- retoor <retoor@molodetz.nl> -->
|
|
{% extends "admin/base_admin.html" %}
|
|
{% block admin_content %}
|
|
<h1>{{ 'Bericht bewerken' if post else 'Nieuw bericht' }}</h1>
|
|
<form class="form wide" method="post" action="{{ '/admin/posts/' ~ post.uid if post else '/admin/posts' }}" data-form>
|
|
<div class="field"><label for="title">Titel</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 'rol' %}
|
|
{% include "_topic_selector.html" %}
|
|
<div class="editor">
|
|
<div class="field">
|
|
<label for="body">Tekst (markdown)</label>
|
|
<textarea id="body" name="body" required minlength="10" data-preview-source>{{ post.body if post else '' }}</textarea>
|
|
<span class="help">Markdown met GFM. Emoji via :shortcode:. Voorbeeld rechts is een live voorbeeld; de gepubliceerde versie wordt op de server gerenderd.</span>
|
|
</div>
|
|
<div class="field">
|
|
<label>Voorbeeld</label>
|
|
<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">
|
|
<option value="draft" {% if not post or post.status == 'draft' %}selected{% endif %}>Concept</option>
|
|
<option value="published" {% if post and post.status == 'published' %}selected{% endif %}>Gepubliceerd</option>
|
|
</select>
|
|
</div>
|
|
<label class="check"><input type="checkbox" name="is_placeholder" value="true" {% if post and post.is_placeholder %}checked{% endif %}> Markeer als placeholder</label>
|
|
<div class="actions"><button class="button" type="submit" data-loading>Opslaan</button><a class="button ghost" href="/admin/posts">Annuleren</a></div>
|
|
</form>
|
|
{% endblock %}
|
|
{% block extra_js %}<script type="module" src="{{ static_url('/static/js/utils/EditorPreview.js') }}"></script>{% endblock %}
|