intent/templates/features/form.html

40 lines
1.4 KiB
HTML
Raw Permalink Normal View History

{% 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 issue %}
<p role="note">
For issue <a href="{% url 'issues:detail' org_slug=project.org.slug project_slug=project.slug number=issue.number %}">{{ issue.key }} {{ issue.title }}</a>.
The new revision will be linked to it.
</p>
{% 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 %}