{% extends '_layout.html' %}

{% block title %}
	Edition du backlog
{% endblock %}


{% block breadcrumb %}
	<li><a href="{% url 'index' %}">Accueil</a></li>
	<li><a>Edition du backlog</a></li>
{% endblock %}


{% block main %}
	<header>
		<div class="flex-row">
			<h2 class="flex-extend">Backlog : Edition</h2>
			<span>
				<a href="{% url 'epic_create' %}"><i class="fa fa-plus"></i> Ajouter une Epic</a>
			</span>
		</div>
	</header>


	<table id="backlog-editor">
		
		<thead>
			<th>Epic</th>
			<th>Valeur</th>
			<th>Options</th>
		</thead>
		
		<tbody>
			{% for epic in epics %}
			<tr>
				<td class="backlog-editor-col1">
					<i class="fa fa-circle" style="margin-right: 0.5em; color:{{ epic.project.color }};" title="{{ epic.project.name }}"></i> 
					<a href="{% url 'epic_details' epic_id=epic.id %}">{{ epic.name }}</a>
				</td>
				<td class="backlog-editor-col2">
					<form action="{% url 'epic_value_update' epic_id=epic.id %}" method="post" accept-charset="utf-8">
						{% csrf_token %}
				    	<input class="raw-input" name="value" type="text" value="{{ epic.value }}">
				    </form>
				</td>
				<td class="backlog-editor-col3">
					<a href="{% url 'epic_edit' epic_id=epic.id from_='backlog_editor' %}"><i class="fa fa-pencil" title="Editer"></i></a>
					<a href="{% url 'epic_close' epic_id=epic.id %}"><i class="fa fa-archive" title="Clôre l'Epic"></i></a>
				</td>
			</tr>
			{% endfor %}
			
			{% for epic in closed %}
			<tr>
				<td class="backlog-editor-col1">
					<i class="fa fa-circle" style="margin-right: 0.5em; color:{{ epic.project.color }};" title="{{ epic.project.name }}"></i> 
					<a href="{% url 'epic_details' epic_id=epic.id %}" class="story-closed">[Fermée] {{ epic.name }}</a>
				</td>
				<td class="backlog-editor-col2">
					<form action="{% url 'epic_value_update' epic_id=epic.id %}" method="post" accept-charset="utf-8">
						{% csrf_token %}
				    	<input class="raw-input" name="value" type="text" value="{{ epic.value }}">
				    </form>
				</td>
				<td class="backlog-editor-col3">
					<a href="{% url 'epic_edit' epic_id=epic.id from_='backlog_editor' %}"><i class="fa fa-pencil" title="Editer"></i></a>
					<a href="{% url 'epic_reopen' epic_id=epic.id %}"><i class="fa fa-folder-open" title="Réouvrir l'Epic"></i></a>
				</td>
			</tr>
			{% endfor %}
		</tbody>
	
	</table>

{% endblock %}