@model System.Tuple<Core.Entities.Team[],Core.Entities.Student[]>

@{
	ViewData["Title"] = "Team Grid";
}

<table class="table">
	<thead>
	<tr> <th></th>
		@foreach (var team in Model.Item1)
		{
			if (team.Name == team.EventDefinition.Name)
			{
					<td style="writing-mode: vertical-rl;text-orientation:sideways">
						@team.EventDefinition.ShortName
					</td>
			}
			else
			{
					<td style="writing-mode: vertical-rl;text-orientation:sideways">
						@team.Name
					</td>
			}
		}
	</tr>
	</thead>
	<tbody>
	@foreach (var student in Model.Item2.OrderBy(s => s.FirstName))
	{
		<tr>
			<td>@student.FirstName</td>
			@foreach (var team in Model.Item1)
			{
				@if (team.Students.Contains(student))
				{
						<td><strong> X</strong></td>
				}
				else
				{
					<td></td>
				}
			}
		</tr>
	}
	</tbody>
</table>
