<div class="row" data-ng-cloak>
	<div class="col-sm-12">
		<div data-ng-hide="loading || data.completed.length == 0">
			<table class="table table-hover table-striped table-condensed">
				<thead class="table-header">
					<th>ID</th>
					<th>Title</th>
					<th>Customer</th>
					<th>Contract</th>
					<th data-ng-hide="filter == 'queue'">Assigned To</th>
					<th>Status</th>
					<th>Start date</th>
					<th class="centered" data-ng-hide="filter == 'queue'">Labour</th>
					<th class="centered">Booked In</th>
					<th class="centered">Completed At</th>
				</thead>
				<tbody>
					<tr data-ng-repeat="task in data.completed" ng-class="{'severity-4': task.severity_id == '4', 'severity-3': task.severity_id == '3', 'prebook-note': task.prebook == '1'}">
						<td><a href="{!! URL::to('tasks') !!}/{[{ task | taskUrl }]}">{[{ task.id }]}</a></td>
						<td>{[{ task.title }]}</td>
						<td><i data-ng-class="{'fa fa-user': task.client_type == 'customer', 'fa fa-building-o': task.client_type == 'client'}"></i> {[{ task.client.name }]}</td>
						<td><span class="label label-success">{[{ task.client.contract.name }]}</span></td>
						<td data-ng-hide="filter == 'queue'">{[{ task.user.name }]}</td>
						<td>{[{ task.status.name }]}</td>
						<td><span tooltip="{[{ task.created_at }]}" data-ng-show="task.type == 'onsite'">{[{ task.onsite_start | fromNow }]}</span></td>
						<td class="centered" data-ng-hide="filter == 'queue'">{[{ task.labour | currency:"£" }]}</td>
						<td class="centered"><span tooltip="{[{ task.created_at }]}">{[{ task.created_at | fromNow }]}</span></td>
						<td class="centered"><span tooltip="{[{ task.completed_at }]}">{[{ task.completed_at | fromNow }]}</span></td>
					</tr>
				</tbody>
			</table>
			<div data-paginator="paginator"></div>
		</div>
		<div class="alert alert-warning" data-ng-show="data.completed.length == 0 && !loading">
			<i class="fa fa-meh-o"></i> Meh, nothing here...
		</div>
		<div class="row" data-ng-show="loading">
			<i class="fa fa-spinner fa-spin"></i> Loading, please wait...
		</div>
	</div>
</div>
