SimBrief integration #405 (#635)

* SimBrief integration #405

* Add briefing as API response; add acars_xml field #405
This commit is contained in:
Nabeel S
2020-03-23 09:31:35 -04:00
committed by GitHub
parent 04b9e37e1d
commit 9e5386264f
70 changed files with 6816 additions and 192 deletions
@@ -7,7 +7,6 @@
<h2>@lang('pireps.newflightreport')</h2>
@include('flash::message')
@if(!empty($pirep))
wee
{{ Form::model($pirep, ['route' => 'frontend.pireps.store']) }}
@else
{{ Form::open(['route' => 'frontend.pireps.store']) }}
@@ -303,22 +303,24 @@ flight reports that have been filed. You've been warned!
&nbsp;{{ trans_choice('common.field', 2) }}
</h6>
<div class="form-container-body">
@if(isset($pirep) && $pirep->fields)
@each('pireps.custom_fields', $pirep->fields, 'field')
@else
@each('pireps.custom_fields', $pirep_fields, 'field')
@endif
<table class="table table-striped">
@if(isset($pirep) && $pirep->fields)
@each('pireps.custom_fields', $pirep->fields, 'field')
@else
@each('pireps.custom_fields', $pirep_fields, 'field')
@endif
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="float-right">
<div class="form-group">
{{ Form::hidden('flight_id') }}
{{ Form::hidden('sb_id', $simbrief_id) }}
@if(isset($pirep) && !$pirep->read_only)
{{ Form::button(__('pireps.deletepirep'), [
@@ -5,7 +5,7 @@
<div class="row">
<div class="col-md-12">
<div style="float:right;">
<a class="btn btn-info pull-right btn-lg"
<a class="btn btn-outline-info pull-right btn-lg"
style="margin-top: -10px;margin-bottom: 5px"
href="{{ route('frontend.pireps.create') }}">@lang('pireps.filenewpirep')</a>
</div>
@@ -3,12 +3,40 @@
@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 class="col-sm-8">
<h2>{{ $pirep->airline->icao }}{{ $pirep->ident }}
: {{ $pirep->dpt_airport_id }} to {{ $pirep->arr_airport_id }}</h2>
</div>
<div class="col-sm-4">
{{-- Show the link to edit if it can be edited --}}
@if (!empty($pirep->simbrief))
<a href="{{ url(route('frontend.simbrief.briefing', [$pirep->simbrief->id])) }}"
class="btn btn-outline-info">View SimBrief</a>
@endif
@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-outline-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-outline-success">@lang('common.submit')</button>
</form>
</div>
</div>
@endif
</div>
</div>
<div class="row">
<div class="col-8">
<div class="row">
{{--
DEPARTURE INFO
@@ -70,29 +98,7 @@
--}}
<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>
@@ -102,6 +108,7 @@
</td>
</tr>
@if ($pirep->state !== PirepState::DRAFT)
<tr>
<td width="30%">@lang('common.status')</td>
<td>
@@ -110,6 +117,7 @@
</div>
</td>
</tr>
@endif
<tr>
<td>@lang('pireps.source')</td>
@@ -217,5 +225,22 @@
</div>
</div>
@endif
@endsection
@if(!empty($pirep->simbrief))
<div class="separator"></div>
<div class="row mt-5">
<div class="col-12">
<div class="form-container">
<h6><i class="fas fa-info-circle"></i>
&nbsp;OFP
</h6>
<div class="form-container-body border border-dark">
<div class="overflow-auto" style="height: 600px;">
{!! $pirep->simbrief->xml->text->plan_html !!}
</div>
</div>
</div>
</div>
</div>
@endif
@endsection
@@ -39,16 +39,17 @@
@minutestotime($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>
@php
$color = 'badge-info';
if($pirep->state === PirepState::PENDING) {
$color = 'badge-warning';
} elseif ($pirep->state === PirepState::ACCEPTED) {
$color = 'badge-success';
} elseif ($pirep->state === PirepState::REJECTED) {
$color = 'badge-danger';
}
@endphp
<div class="badge {{ $color }}">{{ PirepState::label($pirep->state) }}</div>
</td>
<td>
@if(filled($pirep->submitted_at))
@@ -58,7 +59,7 @@
<td>
@if(!$pirep->read_only)
<a href="{{ route('frontend.pireps.edit', [$pirep->id]) }}"
class="btn btn-info btn-sm"
class="btn btn-outline-info btn-sm"
style="z-index: 9999"
title="@lang('common.edit')">
@lang('common.edit')