<!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">
		<STYLE type="text/css">

		   .table {
			  width: 100%;
			  background-color: transparent;
			  border-collapse: collapse;
			  border-spacing: 0;
			}

			.table-header {
			  background-color: #F1F1F1;
			  text-transform: uppercase;
			  color: #999;
			  font-size: .95em;
			  border-top: 1px solid #CACACA;
			  border-bottom: 1px solid #CACACA;
			}

			.text-danger{
				color:red;
			}
			.centred{
				text-align: center;
			}

		</STYLE>
	</head>
	<body>
		<div style="padding: 0 20px;">

			<h4>Hi,</h4>

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

			<table cellpadding="10" class="table table-striped">
				<thead class="table-header">
					<th>Staff</th>
					<th>ID</th>
					<th>Title</th>
					<th>Client</th>
					<th>Contract</th>
					<th>Priority</th>
					<th>Untouched</th>
				</thead>
				<tbody>
					@foreach ($tasks as $task)
						<tr>
							<td>{!! $task->user ? $task->user->name : 'No one' !!}</td>
							<td><a href="{!! URL::to('tasks/support/'.$task->id) !!}">{!! $task->id !!} </a></td>
							<td> {!! $task->title !!}</td>
							<td>{!! $task->client->name !!}</td>
							<td class="centred">
								@if ($task->client->contract_id)
									<span class="label label-info">{!! $task->client->contract->name !!}</span>
								@endif
							</td>
							<td class="centred">{!! $task->severity ? $task->severity->name : 'No severity' !!}</td>
							<td class="centred">
								@if( $task->created_at->diffInHours(\Carbon\Carbon::now()->subHours(72)) > 0 )
									<span class="text-danger">{!! $task->created_at->diffForHumans(\Carbon\Carbon::now()); !!}</span>
								@else
									<span>{!! $task->created_at->diffForHumans(\Carbon\Carbon::now()); !!}</span>
								@endif
							</td>
						</tr>
					@endforeach
				</tbody>
			</table>

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