Add a PIREP flag for ready_only; some more METAR cleanup
This commit is contained in:
@@ -11,14 +11,14 @@
|
||||
<td>{{ $fare->name }} ({{ $fare->code }})</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->{'fare_'.$fare->id} }}</p>
|
||||
{{ Form::hidden('fare_'.$fare->id) }}
|
||||
@else
|
||||
{{ Form::number('fare_'.$fare->id, null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@component('admin.components.info')
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('flight_number', 'Flight Number/Route Code/Leg') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->ident }}
|
||||
{{ Form::hidden('flight_number') }}
|
||||
{{ Form::hidden('flight_code') }}
|
||||
@@ -45,7 +45,7 @@
|
||||
\App\Models\Enums\FlightType::select(),
|
||||
null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
])
|
||||
}}
|
||||
<p class="text-danger">{{ $errors->first('flight_type') }}</p>
|
||||
@@ -61,46 +61,46 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('airline_id', 'Airline') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->airline->name }}</p>
|
||||
{{ Form::hidden('airline_id') }}
|
||||
@else
|
||||
{{ Form::select('airline_id', $airlines_list, null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('aircraft_id', 'Aircraft:') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->aircraft->name }}</p>
|
||||
{{ Form::hidden('aircraft_id') }}
|
||||
@else
|
||||
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
||||
'id' => 'aircraft_select',
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('dpt_airport_id', 'Departure Airport:') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->dpt_airport->id }} - {{ $pirep->dpt_airport->name }}</p>
|
||||
{{ Form::hidden('dpt_airport_id') }}
|
||||
@else
|
||||
{{ Form::select('dpt_airport_id', $airports_list, null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('arr_airport_id', 'Arrival Airport:') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->arr_airport->id }} - {{ $pirep->arr_airport->name }}</p>
|
||||
{{ Form::hidden('arr_airport_id') }}
|
||||
@else
|
||||
@@ -113,7 +113,7 @@
|
||||
<!-- Flight Time Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('flight_time', 'Flight Time (hours & minutes):') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>
|
||||
{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes
|
||||
{{ Form::hidden('hours') }}
|
||||
@@ -125,13 +125,13 @@
|
||||
{{ Form::number('hours', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'hours',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{ Form::number('minutes', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'minutes',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
||||
<p class="text-danger">{{ $errors->first('minutes') }}</p>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="description">Edit Flight Report</h2>
|
||||
<h2>Edit Flight Report</h2>
|
||||
@include('flash::message')
|
||||
{{ Form::model($pirep, [
|
||||
'route' => ['frontend.pireps.update', $pirep->id],
|
||||
@@ -16,4 +16,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include("pireps.scripts")
|
||||
@include('pireps.scripts')
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{Form::label('fare_'.$fare->id, $fare->name.' ('.$fare->code.')')}}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->{'fare_'.$fare->id} }}</p>
|
||||
{{ Form::hidden('fare_'.$fare->id) }}
|
||||
@else
|
||||
|
||||
@@ -8,7 +8,7 @@ an impact on your stats and financials, and will require a recalculation of all
|
||||
flight reports that have been filed. You've been warned!
|
||||
|
||||
--}}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@component('components.info')
|
||||
@@ -19,7 +19,6 @@ flight reports that have been filed. You've been warned!
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
Flight Information
|
||||
@@ -28,7 +27,7 @@ flight reports that have been filed. You've been warned!
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
{{ Form::label('airline_id', 'Airline') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->airline->name }}</p>
|
||||
{{ Form::hidden('airline_id') }}
|
||||
@else
|
||||
@@ -36,14 +35,14 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::select('airline_id', $airline_list, null, [
|
||||
'class' => 'custom-select select2',
|
||||
'style' => 'width: 100%',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::label('flight_number', 'Flight Number/Code/Leg') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->ident }}
|
||||
{{ Form::hidden('flight_number') }}
|
||||
{{ Form::hidden('flight_code') }}
|
||||
@@ -54,17 +53,17 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::text('flight_number', null, [
|
||||
'placeholder' => 'Flight Number',
|
||||
'class' => 'form-control',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
|
||||
{{ Form::text('route_code', null, [
|
||||
'placeholder' => 'Code (optional)',
|
||||
'class' => 'form-control',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
|
||||
{{ Form::text('route_leg', null, [
|
||||
'placeholder' => 'Leg (optional)',
|
||||
'class' => 'form-control',
|
||||
'readonly' => $read_only]) }}
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('flight_number') }}</p>
|
||||
<p class="text-danger">{{ $errors->first('route_code') }}</p>
|
||||
@@ -73,7 +72,7 @@ flight reports that have been filed. You've been warned!
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
{{ Form::label('flight_type', 'Flight Type') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</p>
|
||||
{{ Form::hidden('flight_type') }}
|
||||
@else
|
||||
@@ -82,7 +81,7 @@ flight reports that have been filed. You've been warned!
|
||||
\App\Models\Enums\FlightType::select(), null, [
|
||||
'class' => 'custom-select select2',
|
||||
'style' => 'width: 100%',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
@@ -94,7 +93,7 @@ flight reports that have been filed. You've been warned!
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
{{ Form::label('hours', 'Flight Time') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>
|
||||
{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes
|
||||
{{ Form::hidden('hours') }}
|
||||
@@ -106,14 +105,14 @@ flight reports that have been filed. You've been warned!
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'hours',
|
||||
'min' => '0',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
|
||||
{{ Form::number('minutes', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'minutes',
|
||||
'min' => 0,
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
||||
@@ -127,7 +126,7 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::text('submmitted_date', null, [
|
||||
'placeholder' => 'Departure TIme',
|
||||
'class' => 'form-control',
|
||||
'readonly' => $read_only]) }}--}}
|
||||
'readonly' => $pirep->read_only]) }}--}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -136,7 +135,7 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::text('departure_time', null, [
|
||||
'placeholder' => 'Departure TIme',
|
||||
'class' => 'form-control',
|
||||
'readonly' => $read_only]) }}--}}
|
||||
'readonly' => $pirep->read_only]) }}--}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -145,7 +144,7 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::text('arrival_time', null, [
|
||||
'placeholder' => 'Arrival TIme',
|
||||
'class' => 'form-control',
|
||||
'readonly' => $read_only]) }}--}}
|
||||
'readonly' => $pirep->read_only]) }}--}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -161,7 +160,7 @@ flight reports that have been filed. You've been warned!
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('dpt_airport_id', 'Departure Airport') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
{{ $pirep->dpt_airport->name }}
|
||||
(<a href="{{route('frontend.airports.show', [
|
||||
'id' => $pirep->dpt_airport->icao
|
||||
@@ -172,7 +171,7 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::select('dpt_airport_id', $airport_list, null, [
|
||||
'class' => 'custom-select select2',
|
||||
'style' => 'width: 100%',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
||||
@@ -181,7 +180,7 @@ flight reports that have been filed. You've been warned!
|
||||
|
||||
<div class="col-6">
|
||||
{{ Form::label('arr_airport_id', 'Arrival Airport') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
{{ $pirep->arr_airport->name }}
|
||||
(<a href="{{route('frontend.airports.show', [
|
||||
'id' => $pirep->arr_airport->icao
|
||||
@@ -192,7 +191,7 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::select('arr_airport_id', $airport_list, null, [
|
||||
'class' => 'custom-select select2',
|
||||
'style' => 'width: 100%',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
||||
@@ -210,7 +209,7 @@ flight reports that have been filed. You've been warned!
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{ Form::label('aircraft_id', 'Aircraft') }}
|
||||
@if($read_only)
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->aircraft->name }}</p>
|
||||
{{ Form::hidden('aircraft_id') }}
|
||||
@else
|
||||
@@ -219,7 +218,7 @@ flight reports that have been filed. You've been warned!
|
||||
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
||||
'id' => 'aircraft_select',
|
||||
'class' => 'custom-select select2',
|
||||
'readonly' => $read_only
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
</p>
|
||||
<h5>
|
||||
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">
|
||||
{{ $pirep->airline->code }}{{ $pirep->ident }}
|
||||
</a>
|
||||
{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
|
||||
-
|
||||
{{ $pirep->dpt_airport->name }}
|
||||
(<a href="{{route('frontend.airports.show', [
|
||||
|
||||
@@ -1,2 +1,66 @@
|
||||
@each('pireps.pirep_card', $pireps, 'pirep')
|
||||
{{--@each('pireps.pirep_card', $pireps, 'pirep')--}}
|
||||
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Flight</th>
|
||||
<th>Departure</th>
|
||||
<th>Arrival</th>
|
||||
<th>Aircraft</th>
|
||||
<th class="text-center">Flight Time</th>
|
||||
<th class="text-center">Status</th>
|
||||
<th>Submitted</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach($pireps as $pirep)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ route('frontend.pireps.show', [
|
||||
$pirep->id]) }}">{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ $pirep->dpt_airport->name }}
|
||||
(<a href="{{route('frontend.airports.show', [
|
||||
'id' => $pirep->dpt_airport->icao
|
||||
])}}">{{$pirep->dpt_airport->icao}}</a>)
|
||||
</td>
|
||||
<td>
|
||||
{{ $pirep->arr_airport->name }}
|
||||
(<a href="{{route('frontend.airports.show', [
|
||||
'id' => $pirep->arr_airport->icao
|
||||
])}}">{{$pirep->arr_airport->icao}}</a>)
|
||||
</td>
|
||||
<td>{{ $pirep->aircraft->name }}</td>
|
||||
<td class="text-center">
|
||||
{{ (new \App\Support\Units\Time($pirep->flight_time)) }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if($pirep->state === PirepState::PENDING)
|
||||
<div class="badge badge-warning">
|
||||
@elseif($pirep->state === PirepState::ACCEPTED)
|
||||
<div class="badge badge-success">
|
||||
@elseif($pirep->state === PirepState::REJECTED)
|
||||
<div class="badge badge-danger">
|
||||
@else
|
||||
<div class="badge badge-info">
|
||||
@endif
|
||||
{{ PirepState::label($pirep->state) }}</div>
|
||||
</td>
|
||||
<td>
|
||||
{{ $pirep->submitted_at->diffForHumans() }}
|
||||
</td>
|
||||
<td>
|
||||
@if(!$pirep->read_only)
|
||||
<a href="{{ route('frontend.pireps.edit', [
|
||||
'id' => $pirep->id,
|
||||
]) }}">edit</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -15,17 +15,13 @@ https://api.checkwx.com/#metar-decoded
|
||||
{{ $metar['temperature'][$unit_temp] }}
|
||||
°{{strtoupper($unit_temp)}}
|
||||
@if($metar['visibility'])
|
||||
, visibility {{ $metar['visibility'][$unit_dist] }}
|
||||
, visibility {{ $metar['visibility'][$unit_dist] }} {{$unit_dist}}
|
||||
@endif
|
||||
{{$unit_dist}}
|
||||
|
||||
@if($metar['humidity'])
|
||||
,
|
||||
{{ $metar['humidity'] }}% humidity
|
||||
, {{ $metar['humidity'] }}% humidity
|
||||
@endif
|
||||
|
||||
@if($metar['dew_point'])
|
||||
, dew point
|
||||
, dew point
|
||||
{{ $metar['dew_point'][$unit_temp] }}
|
||||
°{{strtoupper($unit_temp)}}
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user