{% extends "repo_master.html" %}
{% from "_formhelper.html" import render_field_in_row %}
{% block title %}New issue - {{ repo.name }}{% endblock %}
{%block tag %}new_project{% endblock %}
{% block repo %}
{% if not type or type == 'new' %}
<h2>New issue</h2>
{% elif type and type == 'edit' %}
<h2>Edit issue #{{ issue.id }}</h2>
{% endif %}
<section class="new_issue">
{% if not type or type == 'new' %}
<form action="{{ url_for('.new_issue',
username=username, repo=repo.name) }}" method="post">
{% elif type and type == 'edit' %}
<form action="{{ url_for('.edit_issue', username=username,
repo=repo.name, issueid=issue.id) }}" method="post">
{% endif %}
<table>
{{ render_field_in_row(form.title) }}
{{ render_field_in_row(form.issue_content) }}
{{ render_field_in_row(form.status) }}
</table>
<p class="buttons indent">
{% if not type or type == 'new' %}
<input type="submit" class="submit positive button" value="Create">
{% elif type and type == 'edit' %}
<input type="submit" class="submit positive button" value="Edit">
{% endif %}
<input type="button" value="Cancel" class="button" onclick="history.back();">
{{ form.csrf_token }}
</p>
</form>
</section>
{% endblock %}