{% extends '_layout.html' %}

{% block breadcrumb %}
	<li><a>Accueil</a></li>
{% endblock %}

{% block main %}
<section id="backlog">

	<header>
		<div class="flex-row">
		
			<h2 class="flex-extend">Backlog <sup><a href="{% url 'backlog_editor' %}" style="margin-left: 5px;"><i class="fa fa-pencil"></i></a></sup></h2>
			<span>
				{% if current_sprint %}
				<b>En cours:</b> <a href="{% url 'story_index' %}?sprint={{ current_sprint.id }}">{{ current_sprint }}</a>
				{% else %}
				<i>Sprint en cours: (non défini)</i>
				{% endif %}
			</span>
			
		</div>
	</header>
	
	<table class="alt">
		
		<thead>
			<th width="70%">Epic</th>
			<th>Dim.</th>
			<th>Contributeurs</th>
			<th>Stories</th>
		</thead>
		
		<tbody>
			{% for epic in epics %}
			
			<tr data-url="{% url 'epic_details' epic_id=epic.id %}">
				<td>
					<i class="fa fa-sticky-note" style="margin-right: 0.5em; color:{{ epic.project.color }};" title="Projet: {{ epic.project.name }}"></i> 
					<a href="{% url 'epic_details' epic_id=epic.id %}">
						{% if epic.value > 0 %}
							<b>{{ epic.name }}</b>
						{% else %}
							<i style="color: grey;">{{ epic.name }}</i>
						{% endif %}
					</a>
				</td>
				<td{% if 'L' in epic.size %} style="font-weight:700;"{% endif %}>{{ epic.size }}</td>
				<td style="font-size: 0.8em;">{{ epic.contributors_str }}</td>
				<td>{{ epic.nb_stories }}</td>
			</tr>
			
			{% endfor %}
		
		</tbody>
	
	</table>
	
</section>
	
{% endblock %}