Add edit for flight type; block_on_time and block_off_time for PIREP API

This commit is contained in:
Nabeel Shahzad 2018-03-29 14:10:49 -05:00
parent be6fead812
commit 2ab4db3a2e
11 changed files with 65 additions and 27 deletions

View File

@ -23,6 +23,7 @@ class CreatePirepTables extends Migration
$table->string('flight_number', 10)->nullable();
$table->string('route_code', 5)->nullable();
$table->string('route_leg', 5)->nullable();
$table->char('flight_type', 1)->default(FlightType::SCHED_PAX);
$table->string('dpt_airport_id', 5);
$table->string('arr_airport_id', 5);
$table->unsignedInteger('level')->nullable();
@ -39,9 +40,10 @@ class CreatePirepTables extends Migration
$table->text('notes')->nullable();
$table->unsignedTinyInteger('source')->nullable()->default(0);
$table->string('source_name', 25)->nullable();
$table->char('flight_type', 1)->default(FlightType::SCHED_PAX);
$table->tinyInteger('state')->default(PirepState::PENDING);
$table->tinyInteger('status')->default(PirepStatus::SCHEDULED);
$table->dateTime('block_off_time')->nullable();
$table->dateTime('block_on_time')->nullable();
$table->timestamps();
$table->primary('id');

View File

@ -68,6 +68,8 @@ class Pirep extends Model
'flight_type',
'state',
'status',
'block_off_time',
'block_on_time',
'created_at',
'updated_at',
];
@ -87,9 +89,10 @@ class Pirep extends Model
'fuel_used' => 'float',
'landing_rate' => 'float',
'source' => 'integer',
'flight_type' => 'integer',
'state' => 'integer',
'status' => 'integer',
'block_off_time' => 'datetime',
'block_on_time' => 'datetime',
];
public static $rules = [

View File

@ -2719,7 +2719,6 @@ h3, .h3 {
h4, .h4 {
font-size: 1.714em;
line-height: 1.45em;
margin-top: 30px;
margin-bottom: 15px;
}

View File

@ -9520,7 +9520,6 @@ h3, .h3 {
h4, .h4 {
font-size: 1.714em;
line-height: 1.45em;
margin-top: 30px;
margin-bottom: 15px;
}

View File

@ -1,6 +1,6 @@
{
"/assets/frontend/js/app.js": "/assets/frontend/js/app.js?id=373465bdf8c91ab66596",
"/assets/frontend/css/now-ui-kit.css": "/assets/frontend/css/now-ui-kit.css?id=9923ce002ceafb1d740a",
"/assets/frontend/css/now-ui-kit.css": "/assets/frontend/css/now-ui-kit.css?id=dae9f7e5d10b71e28486",
"/assets/admin/css/vendor.min.css": "/assets/admin/css/vendor.min.css?id=a11d81c6bf8d7a548c86",
"/assets/admin/js/app.js": "/assets/admin/js/app.js?id=7cc40ba818ed0f94c3fb",
"/assets/installer/js/app.js": "/assets/installer/js/app.js?id=c65781eda730445d666e",
@ -15,6 +15,6 @@
"/assets/admin/css/blue@2x.png": "/assets/admin/css/blue@2x.png?id=97da23d47b838cbd4bef",
"/assets/global/js/vendor.js": "/assets/global/js/vendor.js?id=6436d215691e8f38eb12",
"/assets/global/css/vendor.css": "/assets/global/css/vendor.css?id=115d5c4f2370ae94a962",
"/assets/installer/css/vendor.css": "/assets/installer/css/vendor.css?id=81f225b61b069fa804fa",
"/assets/installer/css/vendor.css": "/assets/installer/css/vendor.css?id=affe665b10baf5ba6905",
"/assets/installer/js/vendor.js": "/assets/installer/js/vendor.js?id=01249af00bd2c1267e15"
}

View File

@ -39,7 +39,7 @@ h3, .h3{
h4, .h4{
font-size: $font-size-h4;
line-height: 1.45em;
margin-top: $margin-base-vertical * 2;
//margin-top: $margin-base-vertical * 2;
margin-bottom: $margin-base-vertical;
& + .category,

View File

@ -39,7 +39,18 @@
</div>
@endif
</div>
<div class="form-group col-sm-6">
<div class="form-group col-sm-3">
{{ Form::label('flight_type', 'Flight Type') }}
{{ Form::select('flight_type',
\App\Models\Enums\FlightType::select(),
null, [
'class' => 'form-control select2',
'readonly' => $read_only
])
}}
<p class="text-danger">{{ $errors->first('flight_type') }}</p>
</div>
<div class="form-group col-sm-3">
<p class="description">Filed Via:</p>
{{ PirepSource::label($pirep->source) }}
@if(filled($pirep->source_name))

View File

@ -12,7 +12,6 @@
{{-- End the required lines block --}}
<link rel="shortcut icon" type="image/png" href="{{ public_asset('/assets/img/favicon.png') }}"/>
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet"/>
<link href="{{ public_asset('/assets/frontend/css/bootstrap.min.css') }}" rel="stylesheet"/>
<link href="{{ public_asset('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/>

View File

@ -94,6 +94,27 @@ flight reports that have been filed. You've been warned!
</td>
</tr>
<tr>
<td>Flight Type</td>
<td>
@if($read_only)
<p>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</p>
{{ Form::hidden('flight_type') }}
@else
<div class="input-group form-group">
{{ Form::select('flight_type',
\App\Models\Enums\FlightType::select(),
null, [
'class' => 'custom-select select2',
'readonly' => $read_only
])
}}
</div>
<p class="text-danger">{{ $errors->first('flight_type') }}</p>
@endif
</td>
</tr>
<tr>
<td>Origin Airport</td>
<td>

View File

@ -1,6 +1,6 @@
<div class="row">
<div class="col-md-12">
<h3 class="description">flight map</h3>
<h4 class="description">flight map</h4>
</div>
<div class="col-12">
<div class="box-body">

View File

@ -3,13 +3,14 @@
@section('content')
<div class="row">
<div class="col-md-12">
<div class="col-12">
<h2 class="description">{{ $pirep->ident }}</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-8">
<h4 class="description">flight info</h4>
<table class="table table-hover">
<tr>
<td>Status</td>
@ -40,6 +41,11 @@
</td>
</tr>
<tr>
<td>Flight Type</td>
<td>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</td>
</tr>
<tr>
<td>Flight Time</td>
<td>
@ -70,20 +76,18 @@
</table>
</div>
</div>
{{--
Show the fields that have been entered
--}}
<div class="col-4">
{{--
Show the fields that have been entered
--}}
@if(count($pirep->fields) > 0)
<div class="row">
<div class="col-md-12">
<h3 class="description">fields</h3>
@if(count($pirep->fields) > 0)
<h4 class="description">fields</h4>
<table class="table table-hover">
<thead>
<th>Name</th>
<th>Value</th>
<th>Name</th>
<th>Value</th>
</thead>
<tbody>
@foreach($pirep->fields as $field)
@ -94,9 +98,9 @@
@endforeach
</tbody>
</table>
</div>
@endif
</div>
@endif
</div>
{{--
Show the fares that have been entered
@ -104,8 +108,8 @@
@if(count($pirep->fares) > 0)
<div class="row">
<div class="col-md-12">
<h3 class="description">fares</h3>
<div class="col-12">
<h4 class="description">fares</h4>
<table class="table table-hover">
<thead>
<th>Class</th>
@ -124,7 +128,7 @@
</div>
@endif
@include("pireps.map")
@include('pireps.map')
@if(count($pirep->acars_logs) > 0)
<br /><br />