Files
ad/molodetz/templates/admin/post_form.html
T

32 lines
1.8 KiB
HTML

<!-- retoor <retoor@molodetz.nl> -->
{% extends "admin/base_admin.html" %}
{% block admin_content %}
<h1>{{ 'Edit post' if post else 'New post' }}</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">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' %}
{% include "_topic_selector.html" %}
<div class="editor">
<div class="field">
<label for="body">Text (markdown)</label>
<textarea id="body" name="body" required minlength="10" data-preview-source>{{ post.body if post else '' }}</textarea>
<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>
</div>
<div class="field">
<label>Preview</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 %}>Draft</option>
<option value="published" {% if post and post.status == 'published' %}selected{% endif %}>Published</option>
</select>
</div>
<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>
</form>
{% endblock %}
{% block extra_js %}<script type="module" src="{{ static_url('/static/js/utils/EditorPreview.js') }}"></script>{% endblock %}