Convert aircraft active to more detailed status #134

This commit is contained in:
Nabeel Shahzad
2018-02-23 16:37:10 -06:00
parent 709aec83e2
commit 910c0e0eab
9 changed files with 91 additions and 34 deletions

View File

@@ -33,14 +33,12 @@
{!! Form::text('registration', null, ['class' => 'form-control']) !!}
<p class="text-danger">{{ $errors->first('registration') }}</p>
</div>
<!-- Active Field -->
<div class="form-group col-6">
{!! Form::label('active', 'Active:') !!}
<br />
<label class="checkbox-inline">
{!! Form::hidden('active', 0) !!}
{!! Form::checkbox('active') !!}
</label>
<div class="form-group col-sm-6">
{!! Form::label('status', 'Status:') !!}
{!! Form::select('status', $statuses, null, ['class' => 'form-control select2', 'placeholder' => 'Select Status']) !!}
<p class="text-danger">{{ $errors->first('subfleet_id') }}</p>
</div>
</div>
<div class="row">

View File

@@ -2,6 +2,7 @@
<thead>
<th>Name</th>
<th>Subfleet</th>
<th style="text-align: center;">Location</th>
{{--<th style="text-align: center;">ICAO</th>--}}
<th style="text-align: center;">Registration</th>
<th style="text-align: center;">Hours</th>
@@ -21,16 +22,20 @@
-
@endif
</td>
<td style="text-align: center;">{!! $ac->icao !!}</td>
{{--<td style="text-align: center;">{!! $ac->registration !!}</td>--}}
<td style="text-align: center;">{!! $ac->airport_id !!}</td>
<td style="text-align: center;">{!! $ac->registration !!}</td>
<td style="text-align: center;">
{!! Utils::minutesToTimeString($ac->flight_hours) !!}
</td>
<td style="text-align: center;">
@if($ac->active == GenericState::ACTIVE)
<span class="label label-success">{!! GenericState::label($ac->active); !!}</span>
@if($ac->status == \App\Models\Enums\AircraftStatus::ACTIVE)
<span class="label label-success">{!! \App\Models\Enums\AircraftStatus::label($ac->status); !!}</span>
@else
<span class="label label-default">Inactive</span>
<span class="label label-default">
{!! \App\Models\Enums\AircraftStatus::label($ac->status) !!}
</span>
@endif
</td>
<td style="width: 10%; text-align: right;">