Skip to content

Commit

Permalink
Fix pax count fields; add fuel used field #295
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Jun 19, 2019
1 parent ae464b7 commit faf51de
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 15 deletions.
1 change: 1 addition & 0 deletions resources/lang/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'aircraft' => 'Aircraft',
'airline' => 'Airline',
'distance' => 'Distance',
'fuel' => 'Fuel',
'metar' => 'METAR',
'hour' => 'Hour|Hours',
'minute' => 'Minute|Minutes',
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/pireps.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
'fieldsreadonly' => 'Once a PIREP has been submitted, certain fields go into read-only mode.',
'flightinformations' => 'Flight Information',
'flightident' => 'Flight Number/Code/Leg',
'fuel_used' => 'Fuel Used',
'codeoptional' => 'Code (optional)',
'legoptional' => 'Leg (optional)',
'deparrinformations' => 'Departure/Arrival Information',
'aircraftinformations' => 'Aircraft Information',
'dateflown' => 'Date Flown',
'deletepirep' => 'Delete PIREP',
'submitted' => 'Submitted',

'source_types' => [
'manual' => 'Manual',
'acars' => 'ACARS',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/es/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'aircraft' => 'Aeronave',
'airline' => 'Aerolínea',
'distance' => 'Distancía',
'fuel' => 'Combustible',
'metar' => 'METAR',
'hour' => 'Hora|Horas',
'minute' => 'Minuto|Minutos',
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/es/pireps.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
'fieldsreadonly' => 'Una vez que se ha enviado un PIREP, ciertos campos pasan al modo de solo lectura.',
'flightinformations' => 'Información de vuelo',
'flightident' => 'Vuelo Número/Código/Etapa',
'fuel_used' => 'Combustible Usado',
'codeoptional' => 'Código (opcional)',
'legoptional' => 'Etapa (opcional)',
'deparrinformations' => 'Información Salida/Legada',
'aircraftinformations' => 'Información aeronave',
'dateflown' => 'Fecha de vuelo',
'deletepirep' => 'Borrar PIREP',
'submitted' => 'Enviado',

'source_types' => [
'manual' => 'Manual',
'acars' => 'ACARS',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/it/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'aircraft' => 'Aereomobile',
'airline' => 'Compagnia Aerea',
'distance' => 'Distanza',
'fuel' => 'Carburante',
'metar' => 'METAR',
'hour' => 'Ora|Ore',
'minute' => 'Minuto|Minuti',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/it/pireps.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'fieldsreadonly' => 'Quando un PIREP viene sottoporre, alcuni cami entrano in modalità di sola lettura.',
'flightinformations' => 'Informazioni di Volo',
'flightident' => 'Numero di Volo/Codice/Leg',
'fuel_used' => 'Carburante Usato',
'codeoptional' => 'Codice (facoltativo)',
'legoptional' => 'Leg (facoltativa)',
'deparrinformations' => 'Informazioni di Partenza/Arrivo',
Expand Down
13 changes: 4 additions & 9 deletions resources/views/layouts/default/pireps/fares.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
 {{ trans_choice('pireps.fare', 2) }}
</h6>
<div class="form-container-body">
@foreach($pirep->aircraft->subfleet->fares as $fare)
@foreach($aircraft->subfleet->fares as $fare)
<div class="row">
<div class="col">
{{Form::label('fare_'.$fare->id, $fare->name.' ('.$fare->code.')')}}
@if($pirep->read_only)
<p>{{ $pirep->{'fare_'.$fare->id} }}</p>
{{ Form::hidden('fare_'.$fare->id) }}
@else
<div class="input-group form-group">
{{ Form::number('fare_'.$fare->id, null, ['class' => 'form-control', 'min' => 0]) }}
</div>
@endif
<div class="input-group form-group">
{{ Form::number('fare_'.$fare->id, null, ['class' => 'form-control', 'min' => 0]) }}
</div>
</div>
</div>
@endforeach
Expand Down
25 changes: 21 additions & 4 deletions resources/views/layouts/default/pireps/fields.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
</h6>
<div class="form-container-body">
<div class="row">
<div class="col">
<div class="col-4">
{{ Form::label('aircraft_id', __('common.aircraft')) }}
@if(!empty($pirep) && $pirep->read_only)
<p>{{ $pirep->aircraft->name }}</p>
Expand All @@ -228,10 +228,30 @@
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
@endif
</div>
<div class="col-4">
{{ Form::label('fuel_used', __('pireps.fuel_used')) }}
@if(!empty($pirep) && $pirep->read_only)
<p>{{ $pirep->fuel_used }}</p>
@else
<div class="input-group input-group-sm form-group">
{{-- You probably don't want to change this ID if you want the fare select to work --}}
{{ Form::number('fuel_used', null, [
'class' => 'form-control',
'min' => '0',
'readonly' => (!empty($pirep) && $pirep->read_only),
]) }}
</div>
<p class="text-danger">{{ $errors->first('fuel_used') }}</p>
@endif
</div>
</div>
</div>
</div>

<div id="fares_container" class="form-container">
@include('pireps.fares')
</div>

<div class="form-container">
<h6><i class="far fa-comments"></i>
&nbsp;@lang('flights.route')
Expand Down Expand Up @@ -283,9 +303,6 @@
</div>
</div>
@endif
<div id="fares_container">
@include('pireps.fares')
</div>
</div>
</div>
<div class="row">
Expand Down

0 comments on commit faf51de

Please sign in to comment.