#32 assign aircraft to subfleets, and aircraft to subfleets
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
{!! Form::text('name', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('subfleet_id', 'Subfleet:') !!}
|
||||
{!! Form::select('subfleet_id', $subfleets, null, ['class' => 'form-control', 'placeholder' => 'Select Subfleet']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Registration Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('registration', 'Registration:') !!}
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
<h3 class="box-title">{!! Form::label('icao', 'ICAO') !!}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p class="lead">{!! $aircraft->icao !!}/<strong>{!! $aircraft->class->code !!}</strong> ({!! $aircraft->class->name !!})</p>
|
||||
<p class="lead">{!! $aircraft->icao !!}
|
||||
@if($aircraft->subfleet)
|
||||
/{!! $aircraft->subfleet->name !!}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<thead>
|
||||
<th>ICAO</th>
|
||||
<th>Name</th>
|
||||
<th>Subfleet</th>
|
||||
<th>Registration</th>
|
||||
<th style="text-align: center;">Active</th>
|
||||
<th style="text-align: center;">Actions</th>
|
||||
@@ -11,6 +12,13 @@
|
||||
<tr>
|
||||
<td><a href="{!! route('admin.aircraft.show', [$ac->id]) !!}">{!! $ac->icao !!}</a></td>
|
||||
<td>{!! $ac->name !!}</td>
|
||||
<td>
|
||||
@if($ac->subfleet)
|
||||
{!! $ac->subfleet->name !!}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>{!! $ac->registration !!}</td>
|
||||
<td style="text-align: center;">
|
||||
<i class="fa fa-{{$ac->active == 1?"check":""}}-square-o" aria-hidden="true"
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h3>assigned aircraft</h3>
|
||||
<h3>assigned subfleets</h3>
|
||||
<div class="box-body">
|
||||
@include('admin.flights.aircraft')
|
||||
@include('admin.flights.subfleets')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,9 +32,9 @@
|
||||
$(document).ready(function () {
|
||||
$(".ac-flight-dropdown").select2();
|
||||
|
||||
$(document).on('submit', 'form.flight_ac_frm', function (event) {
|
||||
$(document).on('submit', 'form.flight_subfleet', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#flight_aircraft_wrapper', {push: false});
|
||||
$.pjax.submit(event, '#subfleet_flight_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
<div id="flight_aircraft_wrapper" >
|
||||
<div id="subfleet_flight_wrapper">
|
||||
<table class="table table-responsive" id="aircrafts-table">
|
||||
<thead>
|
||||
<th>ICAO</th>
|
||||
<th>Type</th>
|
||||
<th>Name</th>
|
||||
<th>Registration</th>
|
||||
<th style="text-align: center;">Actions</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($flight->aircraft as $ac)
|
||||
@foreach($flight->subfleets as $sf)
|
||||
<tr>
|
||||
<td>{!! $ac->icao !!}</td>
|
||||
<td>{!! $ac->name !!}</td>
|
||||
<td>{!! $ac->registration !!}</td>
|
||||
<td>{!! $sf->type !!}</td>
|
||||
<td>{!! $sf->name !!}</td>
|
||||
<td style="width: 10%; text-align: center;" class="form-inline">
|
||||
{!! Form::open(['url' => '/admin/flights/'.$flight->id.'/aircraft', 'method' => 'delete', 'class' => 'flight_ac_frm']) !!}
|
||||
{!! Form::hidden('aircraft_id', $flight->id) !!}
|
||||
{!! Form::open(['url' => '/admin/flights/'.$flight->id.'/subfleets', 'method' => 'delete', 'class' => 'flight_subfleet']) !!}
|
||||
{!! Form::hidden('subfleet_id', $sf->id) !!}
|
||||
<div class='btn-group'>
|
||||
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>',
|
||||
['type' => 'submit',
|
||||
@@ -31,13 +29,13 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="input-group input-group-lg pull-right">
|
||||
{!! Form::open(['url' => '/admin/flights/'.$flight->id.'/aircraft',
|
||||
{!! Form::open(['url' => '/admin/flights/'.$flight->id.'/subfleets',
|
||||
'method' => 'post',
|
||||
'class' => 'flight_ac_frm form-inline'
|
||||
'class' => 'flight_subfleet form-inline'
|
||||
])
|
||||
!!}
|
||||
{!! Form::select('aircraft_id', $avail_aircraft, null, [
|
||||
'placeholder' => 'Select Aircraft',
|
||||
{!! Form::select('subfleet_id', $avail_subfleets, null, [
|
||||
'placeholder' => 'Select Subfleet',
|
||||
'class' => 'ac-flight-dropdown form-control input-lg',
|
||||
])
|
||||
!!}
|
||||
Reference in New Issue
Block a user