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

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

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

					<form action="{{ route('admin.settings.rest.update', $rest->id) }}" method="post" class="form-horizontal form-edit">
						@csrf
						@method('put')

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

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

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

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