{% extends '_layout.html' %}

{% block title %}
	{% if form.instance.id %}
	[Edition] {{ form.instance.name }}
	{% else %}
	Nouvelle Epic
	{% endif %}
{% endblock %}
{% block breadcrumb %}
	<li><a href="{% url 'index' %}">Accueil</a></li>
	{% if form.instance.id %}
		<li><a href="{% url 'epic_details' epic_id=form.instance.id %}">Epic #{{ form.instance.id }}</a></li>
		<li><a>Edition</a></li>
	{% else %}
		<li><a href="{% url 'backlog_editor'%}">Edition du backlog</a></li>
		<li><a>Nouvelle Epic</a></li>
	{% endif %}
{% endblock %}

{% block main %}
	
	<h2>{% if form.instance.id %}Edition de l'Epic{% else %}Nouvelle Epic{% endif %}</h2>
	<form action="." method="post" enctype="multipart/form-data">
	{% csrf_token %}
	
	{{ form.as_p }}

	<div class="flex-row flex-end" style="margin-top: 10px;">
		<span style="margin-right: 1em;">
		{% if form.instance.id %}
			<a class="button alt" href="{% url 'epic_details' epic_id=form.instance.id %}">Annuler</a>
		{% else %}
			<a class="button alt" href="{% url 'index' %}">Annuler</a>
		{% endif %}
		</span>
		
    	<div class="flex-row flex-end">
    		<input type="submit" value="Enregistrer">
    	</div>
	</div>
	
	</form>
		
{% endblock %}