Merge pull request #312 from nabeelio/issue/295-fuel-in-pireps

Fix pax count fields; add fuel used field #295
This commit is contained in:
Nabeel Shahzad 2019-06-19 15:14:29 -05:00 committed by GitHub
commit 29ca9711f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 35 additions and 18 deletions

View File

@ -12,7 +12,6 @@ services:
- ./:/var/www
- ./resources/docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
depends_on:
- nginx
- mysql
- redis
@ -24,6 +23,8 @@ services:
- ./resources/docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80
depends_on:
- app
mysql:
image: mysql:5.7.26

View File

@ -25,6 +25,7 @@ return [
'aircraft' => 'Aircraft',
'airline' => 'Airline',
'distance' => 'Distance',
'fuel' => 'Fuel',
'metar' => 'METAR',
'hour' => 'Hour|Hours',
'minute' => 'Minute|Minutes',

View File

@ -21,6 +21,7 @@ return [
'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',
@ -28,8 +29,7 @@ return [
'dateflown' => 'Date Flown',
'deletepirep' => 'Delete PIREP',
'submitted' => 'Submitted',
'source_types' => [
'source_types' => [
'manual' => 'Manual',
'acars' => 'ACARS',
],

View File

@ -25,6 +25,7 @@ return [
'aircraft' => 'Aeronave',
'airline' => 'Aerolínea',
'distance' => 'Distancía',
'fuel' => 'Combustible',
'metar' => 'METAR',
'hour' => 'Hora|Horas',
'minute' => 'Minuto|Minutos',

View File

@ -21,6 +21,7 @@ return [
'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',
@ -28,8 +29,7 @@ return [
'dateflown' => 'Fecha de vuelo',
'deletepirep' => 'Borrar PIREP',
'submitted' => 'Enviado',
'source_types' => [
'source_types' => [
'manual' => 'Manual',
'acars' => 'ACARS',
],

View File

@ -25,6 +25,7 @@ return [
'aircraft' => 'Aereomobile',
'airline' => 'Compagnia Aerea',
'distance' => 'Distanza',
'fuel' => 'Carburante',
'metar' => 'METAR',
'hour' => 'Ora|Ore',
'minute' => 'Minuto|Minuti',

View File

@ -16,6 +16,7 @@ return [
'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',

View File

@ -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

View File

@ -211,7 +211,7 @@ flight reports that have been filed. You've been warned!
</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>
@ -228,10 +228,30 @@ flight reports that have been filed. You've been warned!
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
@endif
</div>
<div class="col-4">
{{ Form::label('fuel_used', __('pireps.fuel_used')) }} ({{config('phpvms.internal_units.fuel')}})
@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')
@ -283,9 +303,6 @@ flight reports that have been filed. You've been warned!
</div>
</div>
@endif
<div id="fares_container">
@include('pireps.fares')
</div>
</div>
</div>
<div class="row">