Fix PIREP field and non-existant airport errors when editing PIREPs
This commit is contained in:
@@ -15,9 +15,13 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
{{ Form::text($field->slug, null, [
|
||||
'class' => 'form-control'
|
||||
]) }}
|
||||
@if(!$field->read_only)
|
||||
{{ Form::text($field->slug, $field->value, [
|
||||
'class' => 'form-control'
|
||||
]) }}
|
||||
@else
|
||||
<p>{{ $field->value }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first($field->slug) }}</p>
|
||||
</td>
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
<div>
|
||||
<span class="description">
|
||||
<b>DEP</b>
|
||||
{{ $pirep->dpt_airport->icao }}
|
||||
{{ $pirep->dpt_airport_id }}
|
||||
<b>ARR</b>
|
||||
{{ $pirep->arr_airport->icao }}
|
||||
{{ $pirep->arr_airport_id }}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<tr>
|
||||
<td>
|
||||
{{ $field->name }}
|
||||
@if($field->required === true)
|
||||
<span class="text-danger">*</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm form-group">
|
||||
@if(!$field->read_only)
|
||||
{{ Form::text($field->slug, $field->value, [
|
||||
'class' => 'form-control',
|
||||
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||
]) }}
|
||||
@else
|
||||
{{ $field->value }}
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first($field->slug) }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -4,7 +4,7 @@
|
||||
{{ trans_choice('pireps.fare', 2) }}
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
@foreach($aircraft->subfleet->fares as $fare)
|
||||
@foreach($pirep->aircraft->subfleet->fares as $fare)
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{Form::label('fare_'.$fare->id, $fare->name.' ('.$fare->code.')')}}
|
||||
|
||||
@@ -276,36 +276,16 @@ flight reports that have been filed. You've been warned!
|
||||
{{ trans_choice('common.field', 2) }}
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
|
||||
{{--
|
||||
Write out the custom fields, and label if they're required
|
||||
--}}
|
||||
@foreach($pirep_fields as $field)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $field->name }}
|
||||
@if($field->required === true)
|
||||
<span class="text-danger">*</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group input-group-sm form-group">
|
||||
{{ Form::text($field->slug, null, [
|
||||
'class' => 'form-control',
|
||||
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||
]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first($field->slug) }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@each('pireps.custom_fields', $pirep->fields, 'field')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="fares_container">
|
||||
@include('pireps.fares')
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@@ -22,16 +22,12 @@
|
||||
$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>)
|
||||
@if($pirep->dpt_airport){{ $pirep->dpt_airport->name }}@endif
|
||||
(<a href="{{route('frontend.airports.show', ['id' => $pirep->dpt_airport_id])}}">{{$pirep->dpt_airport_id}}</a>)
|
||||
</td>
|
||||
<td>
|
||||
{{ $pirep->arr_airport->name }}
|
||||
(<a href="{{route('frontend.airports.show', [
|
||||
'id' => $pirep->arr_airport->icao
|
||||
])}}">{{$pirep->arr_airport->icao}}</a>)
|
||||
@if($pirep->arr_airport){{ $pirep->arr_airport->name }}@endif
|
||||
(<a href="{{route('frontend.airports.show', ['id' => $pirep->arr_airport_id])}}">{{$pirep->arr_airport_id}}</a>)
|
||||
</td>
|
||||
<td>
|
||||
@if($pirep->aircraft)
|
||||
|
||||
Reference in New Issue
Block a user