{% extends "repo_master.html" %}
{% from "_formhelper.html" import render_field_in_row %}
{% block title %}Home{% 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' %}
{% if '/fork/' in request.url %}
<form action="{{ url_for('.fork_new_issue',
username=username, repo=repo.name) }}" method="post">
{% else %}
<form action="{{ url_for('.new_issue', repo=repo.name) }}" method="post">
{% endif %}
{% elif type and type == 'edit' %}
{% if '/fork/' in request.url %}
<form action="{{ url_for('.fork_edit_issue', username=username,
repo=repo.name, issueid=issue.id) }}" method="post">
{% else %}
<form action="{{ url_for('.edit_issue',
repo=repo.name, issueid=issue.id) }}" method="post">
{% endif %}
{% endif %}
<table>
{{ render_field_in_row(form.title) }}
{{ render_field_in_row(form.content) }}
</table>
<p class="buttons indent">
<input type="submit" class="submit positive button" value="Create">
<input type="button" value="Cancel" class="button" onclick="history.back();">
{{ form.csrf_token }}
</p>
</form>
</section>
{% endblock %}