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 +