From 30737a7644169cc1fbbaa7c06a501c025d40ea34 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 22 Nov 2017 20:03:49 -0600 Subject: [PATCH] fixed the remaining edit pages --- .../Controllers/Admin/AirlinesController.php | 8 ++-- resources/views/admin/aircraft/edit.blade.php | 21 +++------ .../views/admin/aircraft/fields.blade.php | 27 +++++------ resources/views/admin/airlines/edit.blade.php | 23 +++------- .../views/admin/airlines/fields.blade.php | 8 +++- resources/views/admin/airports/edit.blade.php | 23 +++------- .../views/admin/airports/fields.blade.php | 4 ++ resources/views/admin/app.blade.php | 11 ++--- resources/views/admin/fares/edit.blade.php | 26 ++++------- resources/views/admin/fares/fields.blade.php | 23 +++++----- resources/views/admin/flights/edit.blade.php | 6 +-- resources/views/admin/ranks/edit.blade.php | 45 +++++++------------ resources/views/admin/ranks/fields.blade.php | 6 ++- .../views/admin/ranks/subfleets.blade.php | 19 +++----- 14 files changed, 99 insertions(+), 151 deletions(-) diff --git a/app/Http/Controllers/Admin/AirlinesController.php b/app/Http/Controllers/Admin/AirlinesController.php index b3a5db7e..f4ce4086 100644 --- a/app/Http/Controllers/Admin/AirlinesController.php +++ b/app/Http/Controllers/Admin/AirlinesController.php @@ -81,14 +81,14 @@ class AirlinesController extends BaseController */ public function edit($id) { - $airlines = $this->airlineRepo->findWithoutFail($id); + $airline = $this->airlineRepo->findWithoutFail($id); - if (empty($airlines)) { - Flash::error('Airlines not found'); + if (empty($airline)) { + Flash::error('Airline not found'); return redirect(route('admin.airlines.index')); } - return view('admin.airlines.edit')->with('airlines', $airlines); + return view('admin.airlines.edit')->with('airline', $airline); } /** diff --git a/resources/views/admin/aircraft/edit.blade.php b/resources/views/admin/aircraft/edit.blade.php index e55d3b7e..8fbb46ab 100644 --- a/resources/views/admin/aircraft/edit.blade.php +++ b/resources/views/admin/aircraft/edit.blade.php @@ -1,23 +1,14 @@ @extends('admin.app') - +@section('title', "Edit \"$aircraft->name\"") @section('content') -
-

- Aircraft -

-
+
@include('adminlte-templates::common.errors') -
-
-
- {!! Form::model($aircraft, ['route' => ['admin.aircraft.update', $aircraft->id], 'method' => 'patch']) !!} + {!! Form::model($aircraft, ['route' => ['admin.aircraft.update', $aircraft->id], 'method' => 'patch']) !!} - @include('admin.aircraft.fields') + @include('admin.aircraft.fields') - {!! Form::close() !!} -
-
-
+ {!! Form::close() !!}
+
@endsection diff --git a/resources/views/admin/aircraft/fields.blade.php b/resources/views/admin/aircraft/fields.blade.php index 39805c01..4cbc6fe1 100644 --- a/resources/views/admin/aircraft/fields.blade.php +++ b/resources/views/admin/aircraft/fields.blade.php @@ -1,3 +1,4 @@ +
{!! Form::label('name', 'Name:') !!} @@ -22,23 +23,19 @@
-
-
- -
+
+ {!! Form::label('active', 'Active:') !!} +
- {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} - Cancel +
+ {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} + Cancel +
+
- diff --git a/resources/views/admin/airlines/edit.blade.php b/resources/views/admin/airlines/edit.blade.php index 2614e3ab..e2404230 100644 --- a/resources/views/admin/airlines/edit.blade.php +++ b/resources/views/admin/airlines/edit.blade.php @@ -1,23 +1,12 @@ @extends('admin.app') - +@section('title', "Edit \"$airline->name\"") @section('content') -
-

- Airlines -

-
+
@include('adminlte-templates::common.errors') -
-
-
- {!! Form::model($airlines, ['route' => ['admin.airlines.update', $airlines->id], 'method' => 'patch']) !!} - - @include('admin.airlines.fields') - - {!! Form::close() !!} -
-
-
+ {!! Form::model($airline, ['route' => ['admin.airlines.update', $airline->id], 'method' => 'patch']) !!} + @include('admin.airlines.fields') + {!! Form::close() !!}
+
@endsection diff --git a/resources/views/admin/airlines/fields.blade.php b/resources/views/admin/airlines/fields.blade.php index 96507521..87a075c1 100644 --- a/resources/views/admin/airlines/fields.blade.php +++ b/resources/views/admin/airlines/fields.blade.php @@ -1,3 +1,4 @@ +
{!! Form::label('icao', 'Code:') !!} @@ -31,6 +32,9 @@
- {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} - Cancel +
+ {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} + Cancel +
+
diff --git a/resources/views/admin/airports/edit.blade.php b/resources/views/admin/airports/edit.blade.php index 81b15933..4da113dd 100644 --- a/resources/views/admin/airports/edit.blade.php +++ b/resources/views/admin/airports/edit.blade.php @@ -1,23 +1,12 @@ @extends('admin.app') - +@section('title', "Edit \"$airport->name\"") @section('content') -
-

- Editing {{ $airport->name }} -

-
+
@include('adminlte-templates::common.errors') -
-
-
- {!! Form::model($airport, ['route' => ['admin.airports.update', $airport->id], 'method' => 'patch']) !!} - - @include('admin.airports.fields') - - {!! Form::close() !!} -
-
-
+ {!! Form::model($airport, ['route' => ['admin.airports.update', $airport->id], 'method' => 'patch']) !!} + @include('admin.airports.fields') + {!! Form::close() !!}
+
@endsection diff --git a/resources/views/admin/airports/fields.blade.php b/resources/views/admin/airports/fields.blade.php index 1282f7d3..3b04bb67 100644 --- a/resources/views/admin/airports/fields.blade.php +++ b/resources/views/admin/airports/fields.blade.php @@ -1,3 +1,4 @@ +
{!! Form::label('icao', 'ICAO:') !!} @@ -26,6 +27,9 @@
+
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} Cancel +
+
diff --git a/resources/views/admin/app.blade.php b/resources/views/admin/app.blade.php index 1ee2927e..5289b508 100644 --- a/resources/views/admin/app.blade.php +++ b/resources/views/admin/app.blade.php @@ -118,7 +118,6 @@ - @@ -175,13 +174,11 @@ var removeItem = function (obj, item) { $(document).ready(function () { - $(".select2").select2({ - debug: true - }); + $(".select2").select2(); - $('input.icheck').iCheck({ - checkboxClass: 'icheckbox_flat', - radioClass: 'iradio_flat' + $('input').iCheck({ + checkboxClass: 'icheckbox_flat-orange', + radioClass: 'iradio_flat-orange' }); var storage = getStorage("phpvms.admin"); diff --git a/resources/views/admin/fares/edit.blade.php b/resources/views/admin/fares/edit.blade.php index 2def9841..dd2cf0c6 100644 --- a/resources/views/admin/fares/edit.blade.php +++ b/resources/views/admin/fares/edit.blade.php @@ -1,23 +1,13 @@ @extends('admin.app') +@section('title', "Edit \"$fare->name\"") @section('content') -
-

- Fare -

-
-
+
+
@include('adminlte-templates::common.errors') -
-
-
- {!! Form::model($fare, ['route' => ['admin.fares.update', $fare->id], 'method' => 'patch']) !!} - - @include('admin.fares.fields') - - {!! Form::close() !!} -
-
-
-
+ {!! Form::model($fare, ['route' => ['admin.fares.update', $fare->id], 'method' => 'patch']) !!} + @include('admin.fares.fields') + {!! Form::close() !!} +
+
@endsection diff --git a/resources/views/admin/fares/fields.blade.php b/resources/views/admin/fares/fields.blade.php index f9cdc908..16adae19 100644 --- a/resources/views/admin/fares/fields.blade.php +++ b/resources/views/admin/fares/fields.blade.php @@ -1,4 +1,4 @@ - +
{!! Form::label('code', 'Code:') !!} {!! Form::text('code', null, ['class' => 'form-control']) !!} @@ -30,18 +30,19 @@
-
-
- -
+
+ {!! Form::label('active', 'Active:') !!} +
- {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} - Cancel +
+ {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} + Cancel +
+
diff --git a/resources/views/admin/flights/edit.blade.php b/resources/views/admin/flights/edit.blade.php index 42bfbfc7..b30573fd 100644 --- a/resources/views/admin/flights/edit.blade.php +++ b/resources/views/admin/flights/edit.blade.php @@ -2,7 +2,7 @@ @section('title', 'Edit Flight') @section('content') -
+
@include('adminlte-templates::common.errors')
{!! Form::model($flight, ['route' => ['admin.flights.update', $flight->id], 'method' => 'patch']) !!} @@ -12,14 +12,14 @@

custom fields

-
+
@include('admin.flights.flight_fields')

assigned subfleets

-
+
@include('admin.flights.subfleets')
diff --git a/resources/views/admin/ranks/edit.blade.php b/resources/views/admin/ranks/edit.blade.php index 3615bf49..7421c06c 100644 --- a/resources/views/admin/ranks/edit.blade.php +++ b/resources/views/admin/ranks/edit.blade.php @@ -1,36 +1,25 @@ @extends('admin.app') - +@section('title', "Edit \"$rank->name\"") @section('content') -
-

Edit "{!! $rank->name !!}"

-
+
@include('adminlte-templates::common.errors') -
-
-
- {!! Form::model($rank, ['route' => ['admin.ranks.update', $rank->id], 'method' => 'patch']) !!} - - @include('admin.ranks.fields') - - {!! Form::close() !!} -
-
-
- -
-
-
-
-

subfleets

-
- @include('admin.ranks.subfleets') -
-
-
-
-
+ {!! Form::model($rank, ['route' => ['admin.ranks.update', $rank->id], 'method' => 'patch']) !!} + @include('admin.ranks.fields') + {!! Form::close() !!}
+
+ +
+
+

subfleets

+
+
+
+ @include('admin.ranks.subfleets') +
+
+
@endsection @section('scripts')