@extends('layouts.master')

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

@section('content')
	<div class="row" ng-controller="AdminContractsCtrl">
		<div class="col-sm-8">
			<div class="widget widget-classic">
				<div class="widget-content">
					<p class="lead">Edit contract</p>

					@if (Session::has('message'))
						<div class="alert alert-success">
							<i class="fa fa-check-circle"></i> {!! Session::get('message') !!}
						</div>
					@endif

					<form method="POST" action="{{ route('admin.settings.contracts.update', $contract->id) }}" class="form-horizontal form-edit">
						@csrf
						@method('PUT')

						<!-- Include form fields -->
						@include('admin::settings.contracts.partials.form-fields')

						<div class="text-right form-actions">
							<!-- Redirect urls -->
							<span ng-init="redirect = '{{ route('admin.settings.contracts.index') }}'"></span>
							<span ng-init="delete_url = '{{ route('admin.settings.contracts.destroy', $contract->id) }}'"></span>

							<span class="btn btn-danger pull-left" ng-confirm-click="Are you sure you want to delete this contract?" confirmed-click="remove()"><i class="fa fa-times"></i> Delete Contract</span>
							<button type="submit" class="btn btn-primary">Save changes</button>
							<a href="{{ route('admin.settings.contracts.index') }}" class="btn btn-default">Cancel</a>
						</div>
					</form>

				</div>
			</div>
		</div>
		<div class="col-sm-4">
			@include('admin::settings.contracts.partials.info')
		</div>
	</div>
@stop