From b6abe8dd5ba9515ca19afdb7208064916925059b Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" Date: Tue, 10 Aug 2021 20:23:43 +0300 Subject: [PATCH] Bid check for flights/show (#1278) * Update FlightController.php Add missing $bid to flight/show so when needed Load In Acars button can be placed there too. * Update show.blade.php Add Load In Acars button to flight details page (flights/show.blade.php) --- app/Http/Controllers/Frontend/FlightController.php | 4 ++++ resources/views/layouts/default/flights/show.blade.php | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Frontend/FlightController.php b/app/Http/Controllers/Frontend/FlightController.php index a5e44f33..370e7fbc 100644 --- a/app/Http/Controllers/Frontend/FlightController.php +++ b/app/Http/Controllers/Frontend/FlightController.php @@ -223,9 +223,13 @@ class FlightController extends Controller $map_features = $this->geoSvc->flightGeoJson($flight); + // See if the user has a bid for this flight + $bid = Bid::where(['user_id' => Auth::id(), 'flight_id' => $flight->id])->first(); + return view('flights.show', [ 'flight' => $flight, 'map_features' => $map_features, + 'bid' => $bid, 'acars_plugin' => $this->moduleSvc->isModuleActive('VMSAcars'), ]); } diff --git a/resources/views/layouts/default/flights/show.blade.php b/resources/views/layouts/default/flights/show.blade.php index 02a0ca1c..8f14af3c 100644 --- a/resources/views/layouts/default/flights/show.blade.php +++ b/resources/views/layouts/default/flights/show.blade.php @@ -6,7 +6,14 @@
-

{{ $flight->ident }}

+

+ {{ $flight->ident }} + @if ($acars_plugin && $bid) + Load in vmsACARS + @elseif ($acars_plugin) + Load in vmsACARS + @endif +