33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
HTML
|
|
{% extends "projects/base.html" %}
|
||
|
|
|
||
|
|
{% block page_title %}{% if feature %}Edit {{ feature.key }}{% else %}New feature{% endif %}{% endblock %}
|
||
|
|
|
||
|
|
{% block project_content %}
|
||
|
|
{% if feature %}
|
||
|
|
<h1>Edit <span class="muted">{{ feature.key }}</span> {{ feature.title }}</h1>
|
||
|
|
<p>Saving creates revision {{ feature.current_revision|add:1 }}.</p>
|
||
|
|
{% else %}
|
||
|
|
<h1>New feature</h1>
|
||
|
|
{% endif %}
|
||
|
|
|
||
|
|
{% if preview %}
|
||
|
|
<section aria-labelledby="preview-heading">
|
||
|
|
<h2 id="preview-heading">Preview</h2>
|
||
|
|
<div class="prose preview">{{ preview }}</div>
|
||
|
|
<p class="muted">Not saved yet.</p>
|
||
|
|
</section>
|
||
|
|
{% elif preview is not None %}
|
||
|
|
<p class="muted">Nothing to preview: the description is empty.</p>
|
||
|
|
{% endif %}
|
||
|
|
|
||
|
|
<form method="post">
|
||
|
|
{% csrf_token %}
|
||
|
|
{{ form }}
|
||
|
|
<p>
|
||
|
|
{# Save comes first so pressing Enter in a text field saves rather than previews. #}
|
||
|
|
<button type="submit">{% if feature %}Save revision{% else %}Create feature{% endif %}</button>
|
||
|
|
<button type="submit" name="preview" value="1">Preview description</button>
|
||
|
|
</p>
|
||
|
|
</form>
|
||
|
|
{% endblock %}
|