<div class="modal-header">
	<button type="button" class="close" data-ng-click="cancel()">×</button>
	<h4><i class="fa fa-random"></i> Link this call to a job</h4>
</div>

	<div class="modal-body">

		<div data-tabset>
			<div data-tab data-heading="Existing Job">
				<form class="form-horizontal" ng-submit="link()">
					<p class="lead text-center" style="margin: 10px 10px 20px;">Link this call {[{ call.number }]} to an existing job.</p>

					<div class="control-group">
						<label class="control-label label-required" for="taskId">Job id</label>
						<div class="controls">
							<input id="taskId" class="input-large" type="hidden" name="task_id" ng-model="data.task" ui-select2="select2Options" required>
						</div>
					</div>

					<div class="form-actions">
						<span class="btn" data-ng-click="cancel()" eat-click>Close</span>
						<button class="btn btn-primary">Link</button>
					</div>
				</form>
			</div>

			<div data-tab data-heading="New Job" ng-show="data.client_id">
				<form class="form-horizontal" ng-submit="create()">
					<p class="lead text-center" style="margin: 10px 10px 20px;">Create a new job for this call.</p>

					<div class="control-group">
						<label class="control-label label-required" for="taskTitle">Title</label>
						<div class="controls">
							<input id="taskTitle" class="input-large" type="text" name="title" ng-model="data.title" required>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label label-required" for="taskType">Type</label>
						<div class="controls">
							<select name="type" ng-model="data.type" required>
								<option value="repair" @if('support' == 'repair') selected @endif>Repair</option>
								<option value="support" @if('support' == 'support') selected @endif>Remote Support</option>
								<option value="onsite" @if('support' == 'onsite') selected @endif>Onsite</option>
								<option value="sale-lead" @if('support' == 'sale-lead') selected @endif>Sale Lead</option>
								<option value="order" @if('support' == 'order') selected @endif>Order</option>
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label label-required" for="taskSeverity">Severity</label>
						<div class="controls">
							<select name="severity_id" ng-model="data.severity_id" required>
								@foreach(\App\Models\Severity::all() as $severity)
									<option value="{{ $severity->id }}" @if(2 == $severity->id) selected @endif>{{ $severity->name }}</option>
								@endforeach
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label label-required" for="taskProblem">Problem</label>
						<div class="controls">
							<textarea id="taskProblem" name="problem" ng-model="data.problem" required></textarea>
						</div>
					</div>

					<div class="form-actions">
						<span class="btn" data-ng-click="cancel()" eat-click>Close</span>
						<button class="btn btn-primary">Create</button>
					</div>
				</form>
			</div>
		</div>

	</div>