7.0.0-beta3 Release (#541)

* 391 Notification refactorings (#441)

* Refactor notifications to allow easier plugins

* Notification refactoring

* Formatting

* Move news to NewsService; cleanup of events

* More refactoring; added send email out for news item and the template

* Formatting

* Formatting

* Fix missing newsRepo (#445)

* Refactor and add importer to Installer module #443 (#444)

* Refactor and add importer to Installer module #443

* Refactor for finances to use in import

* Import groups into roles

* Formatting

* Formatting

* Add interface in installer for import

* Notes about importing

* Check for installer folder

* Formatting

* Fix pirep->user mapping

* Unused import

* Formatting

* Replace importer with AJAX powered; better error handling #443 (#447)

* Replace importer with AJAX powered; better error handling #443

* Formatting

* Fix command line importer

* Remove bootstrap cache (#448)

* Cleanup the bootstrap/cache directory when packaging

* Fix removal of bootstrap cache

* Formatting

* Stricter checks on ACARS API data (#451)

* Stricter checks on ACARS API data

* More checks

* Fix for flight_number check forcing to exist

* Allow nullable on flight_id

* Avoid proc_open use #455 (#456)

* Use PhpExecutableFinder() closes #457 #458 (#460)

* Use DateTimeZone instead of int for creating datetime

closes #461

* Fix CSV imports giving Storage class not found #454 (#462)

* Fix CSV imports giving Storage class not found #454

* Update yarn files for security alert

* Add PHP 7.4 support (#464)

* Add PHP 7.4 to build matrix

* DB fix

* YAML parser fix in test data

* Show versions

* Package updates

* Track used ICAOs

* 7.4 METAR parsing fix

* METAR parser fix

* Formatting

* Add meters to response units

* Call instance for unit conversion

* Return value

* Catch exception for unknown quantity

* Comment fix

* Formatting

* METAR parsing fixes on PHP 7.4

* Package updates

* More random airport ID

* More random airport ID

* Properly disable toolbar

* Semver written out to version file

* Use dev as default identifier

* Fix BindingResolutionError when debug toolbar isn't present (#465)

* Fix BindingResolutionError when debug toolbar isn't present

* Formatting

* Split the importer module out from the installer module (#468)

* Split the importer module out from the installer module

* Cleanup of unused imports

* Move updater into separate module #453

* Remove unused imports/formatting

* Disable the install and importer modules at the end of the setup

* Unused imports; update IJ style

* test explicit stage for php+mysql

* add more to matrix

* Add different MariaDB versions

* undo

* Cleanup Model doc

* Pilots cannot use the dashboard or flights without admin rights (#481)

* Use auth middleware instead of specific groups for logged in state

* Auth check for admin access

* Check user admin access for updates

* Formatting

* Allow nullable field and calculate distance if nulled for flight import #478 (#482)

* Check for no roles being attached #480 (#483)

* Return the flight fares if there are no subfleet fares #488 (#489)

* Return the flight fares if there are no subfleet fares #488

* Formatting

* Formatting

* Account for units when entering fuel amounts #493

* Search for ICAO not working properly (#496)

* /flights and /flights/search direct to the same endpoint

* Properly set the distance/planned_distance on save (#497)

* 491 Installation Error (#495)

* Disable CSRF token

* Add error handling around looking up the theme and set a default

* Note about logs in issue template

* Formatting

* Fix GeoService errors when viewing PIREP #498 (#499)

* Add new command to export a specific PIREP for debugging (#501)

* Set a default model value for airports on PIREP (#500)

* Set a default model value for airports on PIREP

* Fix airport icao reference

* Default airport models

* Catch broader exception writing out config files #491

* style

* Add reference to docs on doc site (#502)

* Properly create/update rows importing #486 (#503)

* Add base Dockerfile for Dockerhub builds (#504)

* New subfleet not being attached to an airline on import #479 (#505)

* Fix subfleet not being attached to an airline on creation in import #479

* Call airline name with optional() around subfleet

* Minor cleanup

* Search flights by subfleet #484 (#506)

* API level search of flights #484

* Add Subfleet to flights page for search

* Make the fuel used optional (#512)

* Add make to Docker container

* Add getRootDomain() to Utils (#514)

* Show admin dropdown for admin-access ability (#515)

* Show admin dropdown for admin-access ability closes #509

* Formatting

* Check user permissions on the routes #508 (#516)

* Check user permissions on the routes #508

* Formatting

* Return default value on exception for setting()

* Correct text for no subfleets #507 (#518)

* Add a public_url() helper #513 (#519)

* Reduce number of queries for update check (#520)

* Try to clear caches before updating (#522)

* Try to clear caches before updating

* Add clear-compiled to maintenance cache list

* Formatting

* Set PIREPs page to public (#526)

Set PIREPs page to public

* Fix live and route map errors #527 (#528)

* Add menu bar for mobile (#529)

* Format all blade templates to 2 spaces #530 (#531)

* Fix PIREP edit endpoint closes #533 (#534)

* Fix import during flight cron #532 (#535)

* PIREPS resource except for show (#536)

* Use optional() around the airport fields (#537)

* Use optional() around the airport fields

* Add null-coalesce around full_name

* Add link to download ACARS config from profile (#539)

* Add link to download ACARS config from profile

* Formatting

* Update xml config file template (#540)
This commit is contained in:
Nabeel S
2020-02-08 13:29:34 -05:00
committed by GitHub
parent a335ed8e9b
commit 073e48c396
515 changed files with 13930 additions and 10708 deletions
@@ -1,21 +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>
<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>
@@ -1,19 +1,19 @@
@extends('app')
@section('title', __('pireps.editflightreport'))
@section('content')
<div class="row">
<div class="col-md-12">
<h2>@lang('pireps.editflightreport')</h2>
@include('flash::message')
{{ Form::model($pirep, [
'route' => ['frontend.pireps.update', $pirep->id],
'class' => 'form-group',
'method' => 'patch']) }}
<div class="row">
<div class="col-md-12">
<h2>@lang('pireps.editflightreport')</h2>
@include('flash::message')
{{ Form::model($pirep, [
'route' => ['frontend.pireps.update', $pirep->id],
'class' => 'form-group',
'method' => 'patch']) }}
@include('pireps.fields')
@include('pireps.fields')
{{ Form::close() }}
</div>
{{ Form::close() }}
</div>
</div>
@endsection
@include('pireps.scripts')
@@ -1,19 +1,19 @@
@if($aircraft)
<div class="form-container">
<h6><i class="fas fa-ellipsis-h"></i>
&nbsp;{{ trans_choice('pireps.fare', 2) }}
</h6>
<div class="form-container-body">
@foreach($aircraft->subfleet->fares as $fare)
<div class="row">
<div class="col">
{{Form::label('fare_'.$fare->id, $fare->name.' ('.$fare->code.')')}}
<div class="input-group form-group">
{{ Form::number('fare_'.$fare->id, null, ['class' => 'form-control', 'min' => 0]) }}
</div>
</div>
</div>
@endforeach
<div class="form-container">
<h6><i class="fas fa-ellipsis-h"></i>
&nbsp;{{ trans_choice('pireps.fare', 2) }}
</h6>
<div class="form-container-body">
@foreach($aircraft->subfleet->fares as $fare)
<div class="row">
<div class="col">
{{Form::label('fare_'.$fare->id, $fare->name.' ('.$fare->code.')')}}
<div class="input-group form-group">
{{ Form::number('fare_'.$fare->id, null, ['class' => 'form-control', 'min' => 0]) }}
</div>
</div>
</div>
@endforeach
</div>
</div>
@endif
@@ -218,7 +218,7 @@ flight reports that have been filed. You've been warned!
@endif
</div>
<div class="col-4">
{{ Form::label('block_fuel', __('pireps.block_fuel')) }} ({{config('phpvms.internal_units.fuel')}})
{{ Form::label('block_fuel', __('pireps.block_fuel')) }} ({{setting('units.fuel')}})
@if(!empty($pirep) && $pirep->read_only)
<p>{{ $pirep->block_fuel }}</p>
@else
@@ -234,7 +234,7 @@ flight reports that have been filed. You've been warned!
@endif
</div>
<div class="col-4">
{{ Form::label('fuel_used', __('pireps.fuel_used')) }} ({{config('phpvms.internal_units.fuel')}})
{{ Form::label('fuel_used', __('pireps.fuel_used')) }} ({{setting('units.fuel')}})
@if(!empty($pirep) && $pirep->read_only)
<p>{{ $pirep->fuel_used }}</p>
@else
@@ -2,22 +2,22 @@
@section('title', trans_choice('common.pirep', 2))
@section('content')
<div class="row">
<div class="row">
<div class="col-md-12">
<div style="float:right;">
<a class="btn btn-info pull-right btn-lg"
style="margin-top: -10px;margin-bottom: 5px"
href="{{ route('frontend.pireps.create') }}">@lang('pireps.filenewpirep')</a>
</div>
<h2>{{ trans_choice('pireps.pilotreport', 2) }}</h2>
@include('flash::message')
@include('pireps.table')
<div style="float:right;">
<a class="btn btn-info pull-right btn-lg"
style="margin-top: -10px;margin-bottom: 5px"
href="{{ route('frontend.pireps.create') }}">@lang('pireps.filenewpirep')</a>
</div>
<h2>{{ trans_choice('pireps.pilotreport', 2) }}</h2>
@include('flash::message')
@include('pireps.table')
</div>
</div>
<div class="row">
</div>
<div class="row">
<div class="col-12 text-center">
{{ $pireps->links('pagination.default') }}
{{ $pireps->links('pagination.default') }}
</div>
</div>
</div>
@endsection
@@ -1,20 +1,20 @@
<div class="row">
<div class="col-12">
<div class="box-body">
<div id="map" style="width: 100%; height: 800px"></div>
</div>
<div class="col-12">
<div class="box-body">
<div id="map" style="width: 100%; height: 800px"></div>
</div>
</div>
</div>
@section('scripts')
<script type="text/javascript">
phpvms.map.render_route_map({
pirep_uri: '{!! url('/api/pireps/'.$pirep->id.'/acars/geojson') !!}',
route_points: {!! json_encode($map_features['planned_rte_points']) !!},
planned_route_line: {!! json_encode($map_features['planned_rte_line']) !!},
actual_route_line: {!! json_encode($map_features['actual_route_line']) !!},
actual_route_points: {!! json_encode($map_features['actual_route_points']) !!},
aircraft_icon: '{!! public_asset('/assets/img/acars/aircraft.png') !!}',
});
</script>
<script type="text/javascript">
phpvms.map.render_route_map({
pirep_uri: '{!! url('/api/pireps/'.$pirep->id.'/acars/geojson') !!}',
route_points: {!! json_encode($map_features['planned_rte_points']) !!},
planned_route_line: {!! json_encode($map_features['planned_rte_line']) !!},
actual_route_line: {!! json_encode($map_features['actual_route_line']) !!},
actual_route_points: {!! json_encode($map_features['actual_route_points']) !!},
aircraft_icon: '{!! public_asset('/assets/img/acars/aircraft.png') !!}',
});
</script>
@endsection
@@ -1,66 +1,68 @@
<div class="card border-blue-bottom">
<div class="card-block" style="min-height: 0px">
<div class="row">
<div class="col-12">
<p class="float-right">
<a href="{{ route('frontend.pireps.edit', [$pirep->id]) }}" class="btn btn-sm btn-info">@lang('common.edit')</a>
</p>
<h5>
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">
{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
-
{{ $pirep->dpt_airport->name }}
(<a href="{{route('frontend.airports.show', [
<div class="card-block" style="min-height: 0px">
<div class="row">
<div class="col-12">
<p class="float-right">
<a href="{{ route('frontend.pireps.edit', [$pirep->id]) }}"
class="btn btn-sm btn-info">@lang('common.edit')</a>
</p>
<h5>
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">
{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
-
{{ $pirep->dpt_airport->name }}
(<a href="{{route('frontend.airports.show', [
'id' => $pirep->dpt_airport->icao
])}}">{{$pirep->dpt_airport->icao}}</a>)
<span class="description">to</span>
{{ $pirep->arr_airport->name }}
(<a href="{{route('frontend.airports.show', [
<span class="description">to</span>
{{ $pirep->arr_airport->name }}
(<a href="{{route('frontend.airports.show', [
'id' => $pirep->arr_airport->icao
])}}">{{$pirep->arr_airport->icao}}</a>)
</h5>
</div>
<div class="col-sm-2 text-center">
<div>
@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
</h5>
</div>
<div class="col-sm-2 text-center">
<div>
@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>
</div>
</div>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-12">
<table class="table-condensed" width="100%">
<tr>
<td nowrap><span class="title">@lang('pireps.flighttime')&nbsp;</span></td>
<td>{{ Utils::minutesToTimeString($pirep->flight_time) }}</td>
</tr>
<tr>
<td nowrap><span class="title">@lang('common.aircraft')&nbsp;</span></td>
<td>{{ $pirep->aircraft->name }}
({{ $pirep->aircraft->registration }})</td>
</tr>
@if($pirep->level)
<tr>
<td nowrap><span class="title">@lang('pireps.flightlevel')&nbsp;</span></td>
<td>{{ $pirep->level }}</td>
</tr>
@endif
<tr>
<td nowrap><span class="title">@lang('pireps.filedon'):&nbsp;</span></td>
<td>{{ show_datetime($pirep->created_at) }}</td>
</tr>
</table>
@endif
{{ PirepState::label($pirep->state) }}</div>
</div>
</div>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-12">
<table class="table-condensed" width="100%">
<tr>
<td nowrap><span class="title">@lang('pireps.flighttime')&nbsp;</span></td>
<td>{{ Utils::minutesToTimeString($pirep->flight_time) }}</td>
</tr>
<tr>
<td nowrap><span class="title">@lang('common.aircraft')&nbsp;</span></td>
<td>{{ $pirep->aircraft->name }}
({{ $pirep->aircraft->registration }})
</td>
</tr>
@if($pirep->level)
<tr>
<td nowrap><span class="title">@lang('pireps.flightlevel')&nbsp;</span></td>
<td>{{ $pirep->level }}</td>
</tr>
@endif
<tr>
<td nowrap><span class="title">@lang('pireps.filedon'):&nbsp;</span></td>
<td>{{ show_datetime($pirep->created_at) }}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -1,16 +1,16 @@
@section('scripts')
<script>
const select_id = "select#aircraft_select";
const destContainer = $('#fares_container');
<script>
const select_id = "select#aircraft_select";
const destContainer = $('#fares_container');
$(select_id).change(e => {
const aircraft_id = $(select_id + ' option:selected').val();
const url = '/pireps/fares?aircraft_id=' + aircraft_id;
console.log('aircraft select change: ', aircraft_id);
$(select_id).change(e => {
const aircraft_id = $(select_id + ' option:selected').val();
const url = '/pireps/fares?aircraft_id=' + aircraft_id;
console.log('aircraft select change: ', aircraft_id);
phpvms.request(url).then(response => {
phpvms.request(url).then(response => {
destContainer.html(response.data);
});
});
});
</script>
</script>
@endsection
@@ -2,220 +2,220 @@
@section('title', trans_choice('common.pirep', 1).' '.$pirep->ident)
@section('content')
<div class="row">
<div class="col-8">
<div class="row">
<div class="col-12">
<h2 style="margin-bottom: 5px;">{{$pirep->airline->code}}{{ $pirep->ident }}</h2>
</div>
</div>
<div class="row">
{{--
DEPARTURE INFO
--}}
<div class="col-6 text-left">
<h4>
{{$pirep->dpt_airport->location}}
</h4>
<p>
<a href="{{route('frontend.airports.show', $pirep->dpt_airport_id)}}">
{{ $pirep->dpt_airport->full_name }} ({{ $pirep->dpt_airport_id }})</a>
<br/>
@if($pirep->block_off_time)
{{ $pirep->block_off_time->toDayDateTimeString() }}
@endif
</p>
</div>
{{--
ARRIVAL INFO
--}}
<div class="col-6 text-right">
<h4>
{{$pirep->arr_airport->location}}
</h4>
<p>
<a href="{{route('frontend.airports.show', $pirep->arr_airport_id)}}">
{{ $pirep->arr_airport->full_name }} ({{ $pirep->arr_airport_id }})</a>
<br/>
@if($pirep->block_on_time)
{{ $pirep->block_on_time->toDayDateTimeString() }}
@endif
</p>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="progress" style="margin: 20px 0;">
<div class="progress-bar progress-bar-success" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"
style="width: {{$pirep->progress_percent}}%;">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
@include('pireps.map')
</div>
</div>
<div class="row">
<div class="col-8">
<div class="row">
<div class="col-12">
<h2 style="margin-bottom: 5px;">{{$pirep->airline->code}}{{ $pirep->ident }}</h2>
</div>
</div>
<div class="row">
{{--
DEPARTURE INFO
--}}
<div class="col-6 text-left">
<h4>
{{$pirep->dpt_airport->location}}
</h4>
<p>
<a href="{{route('frontend.airports.show', $pirep->dpt_airport_id)}}">
{{ $pirep->dpt_airport->full_name }} ({{ $pirep->dpt_airport_id }})</a>
<br/>
@if($pirep->block_off_time)
{{ $pirep->block_off_time->toDayDateTimeString() }}
@endif
</p>
</div>
{{--
RIGHT SIDEBAR
ARRIVAL INFO
--}}
<div class="col-4">
<h2>&nbsp;</h2>
{{-- Show the link to edit if it can be edited --}}
@if(!$pirep->read_only)
<div class="float-right" style="margin-bottom: 10px;">
<form method="get"
action="{{ route('frontend.pireps.edit', $pirep->id) }}"
style="display: inline">
@csrf
<button class="btn btn-info">@lang('common.edit')</button>
</form>
&nbsp;
<form method="post"
action="{{ route('frontend.pireps.submit', $pirep->id) }}"
style="display: inline">
@csrf
<button class="btn btn-success">@lang('common.submit')</button>
</form>
</div>
@endif
<table class="table table-striped">
<tr>
<td width="30%">@lang('common.state')</td>
<td>
<div class="badge badge-info">
{{ PirepState::label($pirep->state) }}
</div>
</td>
</tr>
<tr>
<td width="30%">@lang('common.status')</td>
<td>
<div class="badge badge-info">
{{ PirepStatus::label($pirep->status) }}
</div>
</td>
</tr>
<tr>
<td>@lang('pireps.source')</td>
<td>{{ PirepSource::label($pirep->source) }}</td>
</tr>
<tr>
<td>@lang('flights.flighttype')</td>
<td>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</td>
</tr>
<tr>
<td>@lang('pireps.filedroute')</td>
<td>
{{ $pirep->route }}
</td>
</tr>
<tr>
<td>{{ trans_choice('common.note', 2) }}</td>
<td>
{{ $pirep->notes }}
</td>
</tr>
<tr>
<td>@lang('pireps.filedon')</td>
<td>
{{ show_datetime($pirep->created_at) }}
</td>
</tr>
</table>
@if(count($pirep->fields) > 0 || count($pirep->fares) > 0)
<div class="separator"></div>
@endif
@if(count($pirep->fields) > 0)
<h5>{{ trans_choice('common.field', 2) }}</h5>
<table class="table table-hover table-condensed">
<thead>
<th>@lang('common.name')</th>
<th>@lang('common.value')</th>
</thead>
<tbody>
@foreach($pirep->fields as $field)
<tr>
<td>{{ $field->name }}</td>
<td>{{ $field->value }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@if(count($pirep->fares) > 0)
<div class="separator"></div>
@endif
{{--
Show the fares that have been entered
--}}
@if(count($pirep->fares) > 0)
<div class="row">
<div class="col-12">
<h5>{{ trans_choice('pireps.fare', 2) }}</h5>
<table class="table table-hover table-condensed">
<thead>
<th>@lang('pireps.class')</th>
<th>@lang('pireps.count')</th>
</thead>
<tbody>
@foreach($pirep->fares as $fare)
<tr>
<td>{{ $fare->fare->name }} ({{ $fare->fare->code }})</td>
<td>{{ $fare->count }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="col-6 text-right">
<h4>
{{$pirep->arr_airport->location}}
</h4>
<p>
<a href="{{route('frontend.airports.show', $pirep->arr_airport_id)}}">
{{ $pirep->arr_airport->full_name }} ({{ $pirep->arr_airport_id }})</a>
<br/>
@if($pirep->block_on_time)
{{ $pirep->block_on_time->toDayDateTimeString() }}
@endif
</p>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="progress" style="margin: 20px 0;">
<div class="progress-bar progress-bar-success" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"
style="width: {{$pirep->progress_percent}}%;">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
@include('pireps.map')
</div>
</div>
</div>
@if(count($pirep->acars_logs) > 0)
<div class="separator"></div>
<div class="row">
<div class="col-12">
<h5>@lang('pireps.flightlog')</h5>
</div>
<div class="col-12">
<table class="table table-hover table-condensed" id="users-table">
<tbody>
@foreach($pirep->acars_logs as $log)
<tr>
<td nowrap="true">{{ show_datetime($log->created_at) }}</td>
<td>{{ $log->log }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{--
RIGHT SIDEBAR
--}}
<div class="col-4">
<h2>&nbsp;</h2>
{{-- Show the link to edit if it can be edited --}}
@if(!$pirep->read_only)
<div class="float-right" style="margin-bottom: 10px;">
<form method="get"
action="{{ route('frontend.pireps.edit', $pirep->id) }}"
style="display: inline">
@csrf
<button class="btn btn-info">@lang('common.edit')</button>
</form>
&nbsp;
<form method="post"
action="{{ route('frontend.pireps.submit', $pirep->id) }}"
style="display: inline">
@csrf
<button class="btn btn-success">@lang('common.submit')</button>
</form>
</div>
@endif
@endif
<table class="table table-striped">
<tr>
<td width="30%">@lang('common.state')</td>
<td>
<div class="badge badge-info">
{{ PirepState::label($pirep->state) }}
</div>
</td>
</tr>
<tr>
<td width="30%">@lang('common.status')</td>
<td>
<div class="badge badge-info">
{{ PirepStatus::label($pirep->status) }}
</div>
</td>
</tr>
<tr>
<td>@lang('pireps.source')</td>
<td>{{ PirepSource::label($pirep->source) }}</td>
</tr>
<tr>
<td>@lang('flights.flighttype')</td>
<td>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</td>
</tr>
<tr>
<td>@lang('pireps.filedroute')</td>
<td>
{{ $pirep->route }}
</td>
</tr>
<tr>
<td>{{ trans_choice('common.note', 2) }}</td>
<td>
{{ $pirep->notes }}
</td>
</tr>
<tr>
<td>@lang('pireps.filedon')</td>
<td>
{{ show_datetime($pirep->created_at) }}
</td>
</tr>
</table>
@if(count($pirep->fields) > 0 || count($pirep->fares) > 0)
<div class="separator"></div>
@endif
@if(count($pirep->fields) > 0)
<h5>{{ trans_choice('common.field', 2) }}</h5>
<table class="table table-hover table-condensed">
<thead>
<th>@lang('common.name')</th>
<th>@lang('common.value')</th>
</thead>
<tbody>
@foreach($pirep->fields as $field)
<tr>
<td>{{ $field->name }}</td>
<td>{{ $field->value }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@if(count($pirep->fares) > 0)
<div class="separator"></div>
@endif
{{--
Show the fares that have been entered
--}}
@if(count($pirep->fares) > 0)
<div class="row">
<div class="col-12">
<h5>{{ trans_choice('pireps.fare', 2) }}</h5>
<table class="table table-hover table-condensed">
<thead>
<th>@lang('pireps.class')</th>
<th>@lang('pireps.count')</th>
</thead>
<tbody>
@foreach($pirep->fares as $fare)
<tr>
<td>{{ $fare->fare->name }} ({{ $fare->fare->code }})</td>
<td>{{ $fare->count }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
</div>
@if(count($pirep->acars_logs) > 0)
<div class="separator"></div>
<div class="row">
<div class="col-12">
<h5>@lang('pireps.flightlog')</h5>
</div>
<div class="col-12">
<table class="table table-hover table-condensed" id="users-table">
<tbody>
@foreach($pirep->acars_logs as $log)
<tr>
<td nowrap="true">{{ show_datetime($log->created_at) }}</td>
<td>{{ $log->log }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
@endsection
@@ -1,73 +1,73 @@
<div class="table-responsive">
<table class="table table-sm table-hover table-striped">
<thead>
<tr>
<th>{{ trans_choice('common.flight', 1) }}</th>
<th>@lang('common.departure')</th>
<th>@lang('common.arrival')</th>
<th>@lang('common.aircraft')</th>
<th class="text-center">@lang('flights.flighttime')</th>
<th class="text-center">@lang('common.status')</th>
<th>@lang('pireps.submitted')</th>
<th></th>
</tr>
</thead>
<tbody>
<thead>
<tr>
<th>{{ trans_choice('common.flight', 1) }}</th>
<th>@lang('common.departure')</th>
<th>@lang('common.arrival')</th>
<th>@lang('common.aircraft')</th>
<th class="text-center">@lang('flights.flighttime')</th>
<th class="text-center">@lang('common.status')</th>
<th>@lang('pireps.submitted')</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($pireps as $pirep)
<tr>
<td>
<a href="{{ route('frontend.pireps.show', [
@foreach($pireps as $pirep)
<tr>
<td>
<a href="{{ route('frontend.pireps.show', [
$pirep->id]) }}">{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
</td>
<td>
@if($pirep->dpt_airport){{ $pirep->dpt_airport->name }}@endif
</td>
<td>
@if($pirep->dpt_airport){{ $pirep->dpt_airport->name }}@endif
(<a href="{{route('frontend.airports.show', [$pirep->dpt_airport_id])}}">{{$pirep->dpt_airport_id}}</a>)
</td>
<td>
@if($pirep->arr_airport){{ $pirep->arr_airport->name }}@endif
</td>
<td>
@if($pirep->arr_airport){{ $pirep->arr_airport->name }}@endif
(<a href="{{route('frontend.airports.show', [$pirep->arr_airport_id])}}">{{$pirep->arr_airport_id}}</a>)
</td>
<td>
@if($pirep->aircraft)
{{ $pirep->aircraft->name }}
@else
-
@endif
</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">
</td>
<td>
@if($pirep->aircraft)
{{ $pirep->aircraft->name }}
@else
-
@endif
</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>
@if(filled($pirep->submitted_at))
{{ $pirep->submitted_at->diffForHumans() }}
@endif
</td>
<td>
@if(!$pirep->read_only)
<a href="{{ route('frontend.pireps.edit', [$pirep->id]) }}"
class="btn btn-info btn-sm"
style="z-index: 9999"
title="@lang('common.edit')">
@lang('common.edit')
</a>
@endif
</td>
</tr>
@endforeach
<div class="badge badge-danger">
@else
<div class="badge badge-info">
@endif
{{ PirepState::label($pirep->state) }}</div>
</td>
<td>
@if(filled($pirep->submitted_at))
{{ $pirep->submitted_at->diffForHumans() }}
@endif
</td>
<td>
@if(!$pirep->read_only)
<a href="{{ route('frontend.pireps.edit', [$pirep->id]) }}"
class="btn btn-info btn-sm"
style="z-index: 9999"
title="@lang('common.edit')">
@lang('common.edit')
</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</tbody>
</table>
</div>