{% extends "base.html" %}

{% block title %}
	&raquo; Site Snags
{% endblock %}

{% block nav %}
	Site Snags [<a href="/e/site_snags/edit">edit</a>]
{% endblock %}

{% block content %}
	<form action="/reports/csv_site_snags">
		<fieldset>
			<legend>Download CSV</legend>	
			<input type="submit" value="Download">
		</fieldset>
	</form>

	<p>
		There are {{snags|length}} snag(s), over {{site_count}} site(s)
	</p>

	<table>
		<caption>Site Snags</caption>	
		<thead>
			<tr>
				<th></th>
				<th>Creation Date</th>
				<th>Site ID</th>
				<th>Site Name</th>
				<th>Snag Description</th>
				<th>Start Date</th>
				<th>Finish Date</th>
			</tr>
		</thead>
		<tbody>
			{% for snag in snags %}
				<tr>
					<td>
						<a href="/e/site_snags/{{snag.id}}">view</a>
						[<a href="/e/site_snags/{{snag.id}}/edit">edit</a>]
					</td>
					<td>{{snag.date_created|hh_format}}</td>
					<td><a href="/e/sites/{{snag.site.id}}">{{snag.site.code}}</a></td>
					<td>{{snag.site.name}}</td>
					<td>{{snag.description}}</td>
					<td>{{snag.start_date|hh_format}}</td>
					<td>{{snag.finish_date|hh_format}}</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>
{% endblock %}
