@section('header')
	@include('common.header')
@stop

@section('content')
	<div class="row" ng-controller="TasksPageCtrl">
		<div class="col-sm-3">
			<p class="lead">Filter Tasks</p>

			<label>Filter by type</label>
			<select multiple>
				<option value="repair">Repairs</option>
				<option value="support">Remote Support</option>
				<option value="onsite">Onsite</option>
				<option value="sale_lead">Sale Leads</option>
				<option value="order">Orders</option>
				<option value="rma">RMA</option>
			</select>

			<label>Assigned to</label>
			<select></select>

			<label>Filter by severity</label>
			<select multiple>
				<option value="1">Low priority</option>
				<option value="2">Normal</option>
				<option value="3">High priority</option>
				<option value="4">Gold service</option>
			</select>

			<label>Status</label>
			<label class="checkbox">
				<input type="checkbox"> Completed
			</label>
			<label class="checkbox">
				<input type="checkbox"> Open
			</label>
			<label class="checkbox">
				<input type="checkbox"> Paid
			</label>
			<label class="checkbox">
				<input type="checkbox"> Not Paid
			</label>
			<label class="checkbox">
				<input type="checkbox"> Invoiced
			</label>

			<br>
			<label>Time filters</label>
			<em>Created before 20/01/2014</em><br>
			<em>Updated after 20/01/2014</em><br>
			<em>Completed after 20/01/2014</em><br>
			<em>Paid after 20/01/2014</em><br>

			<br>
			<label>Save current configuration as</label>
			<input type="text">
		</div>

		<div class="col-sm-9">
			<p class="lead">All Tasks</p>

			<div style="background: #FFF;">
				<table class="table">
					<tbody>
						<tr ng-repeat="task in tasks">
							<td ng-class="{'severity-4': task.severity_id == '4', 'severity-3': task.severity_id == '3', 'prebook-note': task.prebook == '1'}"><input type="checkbox"></td>
							<td>
								<div style="font-size: 1.3em;"><strong>{[{ task.title }]} <span class="muted">#{[{ task.id }]}</span></strong></div>
								<div><span class="muted">Booked by:</span> {[{ task.creator.name }]} &middot; <span class="muted">Created:</span> {[{ task.created_at | fromNow }]} &middot; <span class="muted">Customer:</span> {[{ task.client.name }]}</div>
								<div><em ng-html="{[{ task.problem }]}"></em></div>
							</td>
							<td style="vertical-align: middle;">
								<span class="label label-info" ng-if="task.client.contract_id"><i class="fa fa-star"></i> {[{ task.client.contract.name }]}</span>
							</td>
							<td style="width: 80px; border-left: 1px solid #EAEAEA;">
								<div class="muted">Assigned to:</div>
								<div class="muted">Status:</div>
								<div class="muted">Priority:</div>
							</td>
							<td>
								<div ng-bind="task.user.name || 'Unassigned'" style="white-space: nowrap;"></div>
								<div ng-bind="task.status.name || 'No status'" style="white-space: nowrap;"></div>
								<div ng-bind="task.priority.name || 'No priority'" style="white-space: nowrap;"></div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
@stop