Plume/templates/posts/new.html.tera
2018-07-27 20:54:34 +02:00

27 lines
1 KiB
Text

{% extends "base" %}
{% import "macros" as macros %}
{% block title %}
{{ "New post" | _ }}
{% endblock title %}
{% block content %}
<h1>{{ "Create a post" | _ }}</h1>
<form class="new-post" method="post">
{{ macros::input(name="title", label="Title", errors=errors, form=form, props="required") }}
{% if errors is defined and errors.content %}
{% for err in errors.content %}
<p class="error">{{ err.message | default(value="Unknown error") | _ }}</p>
{% endfor %}
{% endif %}
<label for="content">{{ "Content" | _ }}<small>{{ "Markdown is supported" | _ }}</small></label>
<textarea id="content" name="content" value="{{ form.content | default(value="") }}"></textarea>
{% 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) }}
<input type="submit" value="{{ "Publish" | _ }}" />
</form>
{% endblock content %}