From ddc2ed4d89a9e652e2536a59e93c4b0f9ace9ff3 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sun, 2 Jul 2017 15:11:27 -0500 Subject: [PATCH] #32 Cleanup of subfleet edit and linked from the aircraft screen --- app/Http/Controllers/Admin/RankController.php | 4 --- .../Controllers/Admin/SubfleetController.php | 2 ++ .../views/admin/aircraft/table.blade.php | 2 ++ .../views/admin/subfleets/edit.blade.php | 18 ++++++++++++ .../views/admin/subfleets/fields.blade.php | 8 ++++-- .../views/admin/subfleets/script.blade.php | 27 ++++++++++++++++++ .../views/admin/subfleets/show.blade.php | 28 +------------------ 7 files changed, 55 insertions(+), 34 deletions(-) create mode 100644 resources/views/admin/subfleets/script.blade.php diff --git a/app/Http/Controllers/Admin/RankController.php b/app/Http/Controllers/Admin/RankController.php index 9aa76ffc..3695e741 100644 --- a/app/Http/Controllers/Admin/RankController.php +++ b/app/Http/Controllers/Admin/RankController.php @@ -77,10 +77,6 @@ class RankController extends BaseController Flash::success('Ranking saved successfully.'); return redirect(route('admin.ranks.edit', ['id' => $model->id])); - /*$ranks = $this->rankRepository->all(); - return view('admin.ranks.table', [ - 'ranks' => $ranks, - ]);*/ } /** diff --git a/app/Http/Controllers/Admin/SubfleetController.php b/app/Http/Controllers/Admin/SubfleetController.php index 8412c231..6fcc8b52 100644 --- a/app/Http/Controllers/Admin/SubfleetController.php +++ b/app/Http/Controllers/Admin/SubfleetController.php @@ -127,8 +127,10 @@ class SubfleetController extends BaseController return redirect(route('admin.subfleets.index')); } + $avail_fares = $this->getAvailFares($subfleet); return view('admin.subfleets.edit', [ 'airlines' => Airline::all()->pluck('name', 'id'), + 'avail_fares' => $avail_fares, 'subfleet' => $subfleet, ]); } diff --git a/resources/views/admin/aircraft/table.blade.php b/resources/views/admin/aircraft/table.blade.php index 0c610c36..03fcf1ed 100644 --- a/resources/views/admin/aircraft/table.blade.php +++ b/resources/views/admin/aircraft/table.blade.php @@ -11,7 +11,9 @@ @if($ac->subfleet_id) + {!! $ac->subfleet->name !!} + @else - @endif diff --git a/resources/views/admin/subfleets/edit.blade.php b/resources/views/admin/subfleets/edit.blade.php index ca2954ec..cd51e7d5 100644 --- a/resources/views/admin/subfleets/edit.blade.php +++ b/resources/views/admin/subfleets/edit.blade.php @@ -17,5 +17,23 @@ +
+
+
+
+

fares

+
+
+    + Fares assigned to the current subfleet. These can be overridden, + otherwise, the value used is the default, which comes from the fare. +
+ @include('admin.subfleets.fares') +
+
+
+
+
@endsection +@include('admin.subfleets.script') diff --git a/resources/views/admin/subfleets/fields.blade.php b/resources/views/admin/subfleets/fields.blade.php index 19f2ffb4..b793e1b3 100644 --- a/resources/views/admin/subfleets/fields.blade.php +++ b/resources/views/admin/subfleets/fields.blade.php @@ -1,23 +1,25 @@ -
+
{!! Form::label('airline_id', 'Airline Id:') !!} {!! Form::select('airline_id', $airlines, null , ['class' => 'form-control']) !!}
-
+
{!! Form::label('name', 'Name:') !!} {!! Form::text('name', null, ['class' => 'form-control']) !!}
-
+
{!! Form::label('type', 'Type:') !!} {!! Form::text('type', null, ['class' => 'form-control']) !!}
+
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} Cancel +
diff --git a/resources/views/admin/subfleets/script.blade.php b/resources/views/admin/subfleets/script.blade.php new file mode 100644 index 00000000..059bf8c5 --- /dev/null +++ b/resources/views/admin/subfleets/script.blade.php @@ -0,0 +1,27 @@ +@section('scripts') + +@endsection diff --git a/resources/views/admin/subfleets/show.blade.php b/resources/views/admin/subfleets/show.blade.php index a9891af7..efd6e828 100644 --- a/resources/views/admin/subfleets/show.blade.php +++ b/resources/views/admin/subfleets/show.blade.php @@ -31,30 +31,4 @@
@endsection -@section('scripts') - -@endsection +@include('admin.subfleets.script')