2018-05-09 17:53:12 +00:00
|
|
|
{% extends "base" %}
|
2018-07-07 20:51:48 +00:00
|
|
|
{% import "macros" as macros %}
|
2018-04-23 14:25:39 +00:00
|
|
|
|
2018-05-09 17:53:12 +00:00
|
|
|
{% block title %}
|
2018-09-07 17:51:53 +00:00
|
|
|
{% if editing %}
|
|
|
|
{{ "Edit {{ post }}" | _(post=form.title) }}
|
|
|
|
{% else %}
|
|
|
|
{{ "New post" | _ }}
|
|
|
|
{% endif %}
|
2018-05-09 17:53:12 +00:00
|
|
|
{% endblock title %}
|
2018-04-23 14:25:39 +00:00
|
|
|
|
2018-05-09 17:53:12 +00:00
|
|
|
{% block content %}
|
2018-09-07 17:51:53 +00:00
|
|
|
<h1>
|
|
|
|
{% if editing %}
|
|
|
|
{{ "Edit {{ post }}" | _(post=form.title) }}
|
|
|
|
{% else %}
|
|
|
|
{{ "Create a post" | _ }}
|
|
|
|
{% endif %}
|
|
|
|
</h1>
|
2018-05-19 14:26:56 +00:00
|
|
|
<form class="new-post" method="post">
|
2018-07-18 13:34:18 +00:00
|
|
|
{{ macros::input(name="title", label="Title", errors=errors, form=form, props="required") }}
|
2018-09-04 11:26:13 +00:00
|
|
|
{{ macros::input(name="subtitle", label="Subtitle", errors=errors, form=form, optional=true) }}
|
2018-05-09 17:53:12 +00:00
|
|
|
|
2018-07-06 17:29:36 +00:00
|
|
|
{% if errors is defined and errors.content %}
|
|
|
|
{% for err in errors.content %}
|
2018-07-07 20:51:48 +00:00
|
|
|
<p class="error">{{ err.message | default(value="Unknown error") | _ }}</p>
|
2018-07-06 17:29:36 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
|
2018-10-30 20:04:59 +00:00
|
|
|
<label for="plume-editor">{{ "Content" | _ }}<small>{{ "Markdown is supported" | _ }}</small></label>
|
2018-10-30 17:16:24 +00:00
|
|
|
<textarea id="plume-editor" name="content" rows="20">{{ form.content | default(value="") }}</textarea>
|
2018-07-06 17:29:36 +00:00
|
|
|
|
2018-09-05 20:18:27 +00:00
|
|
|
{{ macros::input(name="tags", label="Tags, separated by commas", errors=errors, form=form, optional=true) }}
|
|
|
|
|
2018-07-27 18:31:47 +00:00
|
|
|
{% set license_infos = "Default license will be {{ instance.default_license }}" | _(instance=instance) %}
|
|
|
|
{{ macros::input(name="license", label="License", errors=errors, form=form, optional=true, details=license_infos) }}
|
2018-05-09 17:53:12 +00:00
|
|
|
|
2018-10-31 10:48:15 +00:00
|
|
|
<label for="cover">{{ "Illustration" | _ }}<small>{{ "Optional" | _ }}</small></label>
|
2018-10-30 20:04:59 +00:00
|
|
|
<select id="cover" name="cover">
|
2018-10-31 13:28:26 +00:00
|
|
|
<option value="none" {% if form is undefined or form.cover is undefined %}selected{% endif %}>{{ "None" | _ }}</option>
|
2018-10-30 20:04:59 +00:00
|
|
|
{% for media in medias %}
|
2018-10-31 13:40:31 +00:00
|
|
|
{% if media.category == "image" %}
|
|
|
|
<option value="{{ media.id }}" {% if form is defined and form.cover is defined and form.cover == media.id %}selected{% endif %}>
|
|
|
|
{{ media.alt_text | default(value=media.content_warning) }}
|
|
|
|
</option>
|
|
|
|
{% endif %}
|
2018-10-30 20:04:59 +00:00
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
|
2018-09-10 18:38:19 +00:00
|
|
|
{% if is_draft %}
|
|
|
|
<label for="draft">
|
|
|
|
<input type="checkbox" name="draft" id="draft" checked>
|
|
|
|
{{ "This is a draft, don't publish it yet." | _ }}
|
|
|
|
</label>
|
|
|
|
{% endif %}
|
|
|
|
|
2018-09-07 17:51:53 +00:00
|
|
|
{% if editing %}
|
|
|
|
<input type="submit" value="{{ "Update" | _ }}" />
|
|
|
|
{% else %}
|
2018-09-10 18:38:19 +00:00
|
|
|
{% if is_draft %}
|
|
|
|
<input type="submit" value="{{ "Update or publish" | _ }}" />
|
|
|
|
{% else %}
|
|
|
|
<input type="submit" value="{{ "Publish" | _ }}" />
|
|
|
|
{% endif %}
|
2018-09-07 17:51:53 +00:00
|
|
|
{% endif %}
|
2018-05-09 17:53:12 +00:00
|
|
|
</form>
|
2018-08-30 20:47:25 +00:00
|
|
|
<script src="/static/js/autoExpand.js"></script>
|
2018-05-09 17:53:12 +00:00
|
|
|
{% endblock content %}
|