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)
This commit is contained in:
B.Fatih KOZ
2021-08-10 20:23:43 +03:00
committed by GitHub
parent 54c3c8f346
commit b6abe8dd5b
2 changed files with 12 additions and 1 deletions

View File

@@ -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'),
]);
}

View File

@@ -6,7 +6,14 @@
<div class="col-8">
<div class="row">
<div class="col-12">
<h2>{{ $flight->ident }}</h2>
<h2>
{{ $flight->ident }}
@if ($acars_plugin && $bid)
<a href="vmsacars:bid/{{$bid->id}}" class="btn btn-info btn-sm float-right">Load in vmsACARS</a>
@elseif ($acars_plugin)
<a href="vmsacars:flight/{{$flight->id}}" class="btn btn-info btn-sm float-right">Load in vmsACARS</a>
@endif
</h2>
</div>
</div>
<div class="row">