<!DOCTYPE html>
<html lang="en-US">
	<head>
		<meta charset="utf-8">

		<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
	</head>
	<body>
		<h4>Hi {!! $user->name !!},</h4>

		<p>You are the current manager of the repairs department, and Seraph detected a list of repairs that have not been touched for more than 72 hours.</p>

		<div style="padding: 0 20px;">

			<table class="table table-striped">
				<thead>
					<th>Technician</th>
					<th>ID</th>
					<th>Title</th>
					<th>Client</th>
					<th>Contract</th>
					<th>Priority</th>
					<th>Created</th>
					<th>Updated</th>
				</thead>
				<tbody>
					@foreach ($technicians as $name => $tasks)
						<tr>
							<td rowspan="{!! count($tasks) !!}">{!! $name !!}</td>

							@foreach($tasks as $index => $task)
								@if ($index > 0)
									<tr>
								@endif

								<td><a href="{!! URL::to('tasks/repairs/'.$task->id) !!}">{!! $task->id !!}</a></td>
								<td>{!! $task->title !!}</td>
								<td>{!! $task->client->name !!}</td>
								<td>
									@if ($task->client->contract_id)
										<span class="label label-info">{!! $task->client->contract->name !!}</span>
									@endif
								</td>
								<td>{!! $task->severity ? $task->severity->name : 'No severity' !!}</td>
								<td>{!! $task->created_at !!}</td>
								<td>{!! $task->updated_at !!}</td>

								@if ($index < count($tasks) - 1)
									</tr>
								@endif
							@endforeach

						</tr>
					@endforeach
				</tbody>
			</table>

		</div>
	</body>
</html>