From 9dfdc8195d71926d670438e8162ff96a981b5e9a Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 21 Feb 2018 15:24:46 -0600 Subject: [PATCH] Add flight log to both frontend and admin pirep edit view --- .../Controllers/Frontend/PirepController.php | 6 ++++-- resources/views/admin/pireps/edit.blade.php | 8 +++++++ .../views/admin/pireps/flight_log.blade.php | 14 +++++++++++++ .../layouts/default/pireps/show.blade.php | 21 +++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 resources/views/admin/pireps/flight_log.blade.php diff --git a/app/Http/Controllers/Frontend/PirepController.php b/app/Http/Controllers/Frontend/PirepController.php index 18fd0713..79a0c282 100644 --- a/app/Http/Controllers/Frontend/PirepController.php +++ b/app/Http/Controllers/Frontend/PirepController.php @@ -5,9 +5,11 @@ namespace App\Http\Controllers\Frontend; use App\Facades\Utils; use App\Http\Controllers\Controller; use App\Http\Requests\CreatePirepRequest; +use App\Models\Enums\AcarsType; use App\Models\Enums\PirepSource; use App\Models\Enums\PirepState; use App\Models\Pirep; +use App\Repositories\AcarsRepository; use App\Repositories\AirlineRepository; use App\Repositories\AirportRepository; use App\Repositories\Criteria\WhereCriteria; @@ -182,11 +184,11 @@ class PirepController extends Controller return redirect(route('frontend.pirep.index')); } - $map_featuers = $this->geoSvc->pirepGeoJson($pirep); + $map_features = $this->geoSvc->pirepGeoJson($pirep); return $this->view('pireps.show', [ 'pirep' => $pirep, - 'map_features' => $map_featuers, + 'map_features' => $map_features, ]); } } diff --git a/resources/views/admin/pireps/edit.blade.php b/resources/views/admin/pireps/edit.blade.php index ee9ca816..8b08d090 100644 --- a/resources/views/admin/pireps/edit.blade.php +++ b/resources/views/admin/pireps/edit.blade.php @@ -41,6 +41,14 @@ @include('admin.pireps.comments') + +
+
+

flight log

+ @include('admin.pireps.flight_log') +
+
+ @endsection diff --git a/resources/views/admin/pireps/flight_log.blade.php b/resources/views/admin/pireps/flight_log.blade.php new file mode 100644 index 00000000..89da6442 --- /dev/null +++ b/resources/views/admin/pireps/flight_log.blade.php @@ -0,0 +1,14 @@ +@if(count($pirep->acars_logs) > 0) +
+ + + @foreach($pirep->acars_logs as $log) + + + + + @endforeach + +
{!! show_datetime($log->created_at) !!}{!! $log->log !!}
+
+@endif diff --git a/resources/views/layouts/default/pireps/show.blade.php b/resources/views/layouts/default/pireps/show.blade.php index d9b81bf5..b4c79762 100644 --- a/resources/views/layouts/default/pireps/show.blade.php +++ b/resources/views/layouts/default/pireps/show.blade.php @@ -94,5 +94,26 @@ @endif @include("layouts.${SKIN_NAME}.pireps.map") + + @if(count($pirep->acars_logs) > 0) +

+
+
+

flight log

+
+
+ + + @foreach($pirep->acars_logs as $log) + + + + + @endforeach + +
{!! show_datetime($log->created_at) !!}{!! $log->log !!}
+
+
+ @endif @endsection