{% extends "base.html" %}

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

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

{% block content %}
	<!-- Layer Section -->
	<div class="layer-section">
		<!-- Section Header -->
		<div class="section-header">
			<h2>Download CSV</h2>	
		</div>
		<!-- End Section Header -->
		<!-- Section Content -->
		<div class="section-content">
			<div class="section-data">
				<div class="standardForm textWidthAuto ">
					<form action="/reports/csv_site_snags">
						<fieldset>
							<input type="submit" value="Download">
						</fieldset>
					</form>
				</div>
			</div>
		</div>
		<!-- End Section Content -->
		<!-- Section Header -->
		<div class="section-header">
			<h2>Site Snags</h2>	
		</div>
		<!-- End Section Header -->
		
		<!-- Section Content -->
		<div class="section-content">
			<div class="section-data">
				<p>
					There are {{snags|length}} snag(s), over {{site_count}} site(s)
				</p>

				<table class="DataTable widthAuto noMarginBottom">
					<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="/site_snags/{{snag.id}}">view</a>
									[<a href="/site_snags/{{snag.id}}/edit">edit</a>]
								</td>
								<td>{{snag.date_created|hh_format}}</td>
								<td>
									<a href="/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>
			</div>
		</div>
		<!-- End Section Content -->
	</div>
	<!-- End Layer Section -->
{% endblock %}
