<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">

	<title>{{ competition.title }} - {{ season.title }}</title>

	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
	<!-- Optional theme -->
	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
	<!-- Latest compiled and minified JavaScript -->
	<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

	<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.3.6/slick.css">
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
	<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.3.6/slick.min.js"></script>
</head>
<body>
{% load i18n %}
	<div class="container-fluid">
		<div class="page-header">
			<h1>
				Registration Counts
				<small>{{ competition.title }} - {{ season.title }}</small>
			</h1>
		</div>

		{% regroup teams by club_id as clubs %}
		<table class="table table-striped table-condensed">
			<thead>
				<tr>
					<th>Club</th>
					<th>Team</th>
					<th>Division</th>
					<th>Players</th>
					<th>Non players</th>
				</tr>
			</thead>
				{% for club in clubs %}
					<tbody>
						{% for team in club.list %}
							<tr>
								<th>
									{% ifchanged team.club_id %}
										{{ team.club.title }}
									{% endifchanged %}
								</th>
								<th>{{ team.title }}</th>
								<td>{{ team.division.title }}</td>
								<td>{{ team.player_count|default_if_none:0 }}</td>
								<td>{{ team.non_player_count|default_if_none:0 }}</td>
							</tr>
						{% endfor %}
					</tbody>
				{% endfor %}
			</tbody>
		</table>
	</div>
</body>
</html>
