fixed the remaining edit pages

This commit is contained in:
Nabeel Shahzad 2017-11-22 20:03:49 -06:00
parent 7c5486c9e8
commit 30737a7644
14 changed files with 99 additions and 151 deletions

View File

@ -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);
}
/**

View File

@ -1,23 +1,14 @@
@extends('admin.app')
@section('title', "Edit \"$aircraft->name\"")
@section('content')
<section class="content-header">
<h1>
Aircraft
</h1>
</section>
<div class="card border-blue-bottom">
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! 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() !!}
</div>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
@endsection

View File

@ -1,3 +1,4 @@
<div class="row">
<!-- Name Field -->
<div class="form-group col-sm-6">
{!! Form::label('name', 'Name:') !!}
@ -22,23 +23,19 @@
</div>
<!-- Active Field -->
<div class="form-group col-sm-6">
<div class="checkbox">
<label class="checkbox-inline">
{!! Form::hidden('active', false) !!}
{!! Form::checkbox('active', '1', true) !!}
{!! Form::label('active', 'Active') !!}
</label>
</div>
<div class="form-group col-12">
{!! Form::label('active', 'Active:') !!}
<label class="checkbox-inline">
{!! Form::hidden('active', 0, false) !!}
{!! Form::checkbox('active', 1, null) !!}
</label>
</div>
<!-- Submit Field -->
<div class="form-group col-sm-12">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.aircraft.index') !!}" class="btn btn-default">Cancel</a>
<div class="pull-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.aircraft.index') !!}" class="btn btn-default">Cancel</a>
</div>
</div>
</div>
<script>
jQuery('input#active').iCheck('check');
//$(document).ready(function() {
//})
</script>

View File

@ -1,23 +1,12 @@
@extends('admin.app')
@section('title', "Edit \"$airline->name\"")
@section('content')
<section class="content-header">
<h1>
Airlines
</h1>
</section>
<div class="card border-blue-bottom">
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! Form::model($airlines, ['route' => ['admin.airlines.update', $airlines->id], 'method' => 'patch']) !!}
@include('admin.airlines.fields')
{!! Form::close() !!}
</div>
</div>
</div>
{!! Form::model($airline, ['route' => ['admin.airlines.update', $airline->id], 'method' => 'patch']) !!}
@include('admin.airlines.fields')
{!! Form::close() !!}
</div>
</div>
@endsection

View File

@ -1,3 +1,4 @@
<div class="row">
<!-- Code Field -->
<div class="form-group col-sm-6">
{!! Form::label('icao', 'Code:') !!}
@ -31,6 +32,9 @@
<!-- Submit Field -->
<div class="form-group col-sm-12">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.airlines.index') !!}" class="btn btn-default">Cancel</a>
<div class="pull-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.airlines.index') !!}" class="btn btn-default">Cancel</a>
</div>
</div>
</div>

View File

@ -1,23 +1,12 @@
@extends('admin.app')
@section('title', "Edit \"$airport->name\"")
@section('content')
<section class="content-header">
<h1>
Editing {{ $airport->name }}
</h1>
</section>
<div class="card border-blue-bottom">
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! Form::model($airport, ['route' => ['admin.airports.update', $airport->id], 'method' => 'patch']) !!}
@include('admin.airports.fields')
{!! Form::close() !!}
</div>
</div>
</div>
{!! Form::model($airport, ['route' => ['admin.airports.update', $airport->id], 'method' => 'patch']) !!}
@include('admin.airports.fields')
{!! Form::close() !!}
</div>
</div>
@endsection

View File

@ -1,3 +1,4 @@
<div class="row">
<!-- Icao Field -->
<div class="form-group col-sm-6">
{!! Form::label('icao', 'ICAO:') !!}
@ -26,6 +27,9 @@
<!-- Submit Field -->
<div class="form-group col-sm-12">
<div class="pull-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.airports.index') !!}" class="btn btn-default">Cancel</a>
</div>
</div>
</div>

View File

@ -118,7 +118,6 @@
<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="/assets/admin/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/assets/admin/js/bootstrap-checkbox-radio.js"></script>
<script src="/assets/admin/js/chartist.min.js"></script>
<script src="/assets/admin/js/bootstrap-notify.js"></script>
<script src="/vendor/select2/dist/js/select2.js"></script>
@ -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");

View File

@ -1,23 +1,13 @@
@extends('admin.app')
@section('title', "Edit \"$fare->name\"")
@section('content')
<section class="content-header">
<h1>
Fare
</h1>
</section>
<div class="content">
<div class="card border-blue-bottom">
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! Form::model($fare, ['route' => ['admin.fares.update', $fare->id], 'method' => 'patch']) !!}
@include('admin.fares.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
{!! Form::model($fare, ['route' => ['admin.fares.update', $fare->id], 'method' => 'patch']) !!}
@include('admin.fares.fields')
{!! Form::close() !!}
</div>
</div>
@endsection

View File

@ -1,4 +1,4 @@
<div class="row">
<div class="form-group col-sm-6">
{!! Form::label('code', 'Code:') !!}
{!! Form::text('code', null, ['class' => 'form-control']) !!}
@ -30,18 +30,19 @@
</div>
<!-- Active Field -->
<div class="form-group col-sm-6">
<div class="checkbox">
<label class="checkbox-inline">
{!! Form::hidden('active', false) !!}
{!! Form::checkbox('active', '1', true) !!}
{!! Form::label('active', 'Active') !!}
</label>
</div>
<div class="form-group col-sm-12">
{!! Form::label('active', 'Active:') !!}
<label class="checkbox-inline">
{!! Form::hidden('active', 0, false) !!}
{!! Form::checkbox('active', 1, null) !!}
</label>
</div>
<!-- Submit Field -->
<div class="form-group col-sm-12">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.fares.index') !!}" class="btn btn-default">Cancel</a>
<div class="pull-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.fares.index') !!}" class="btn btn-default">Cancel</a>
</div>
</div>
</div>

View File

@ -2,7 +2,7 @@
@section('title', 'Edit Flight')
@section('content')
<div class="card">
<div class="card border-blue-bottom">
@include('adminlte-templates::common.errors')
<div class="content">
{!! Form::model($flight, ['route' => ['admin.flights.update', $flight->id], 'method' => 'patch']) !!}
@ -12,14 +12,14 @@
</div>
<h3>custom fields</h3>
<div class="card">
<div class="card border-blue-bottom">
<div class="content">
@include('admin.flights.flight_fields')
</div>
</div>
<h3>assigned subfleets</h3>
<div class="card">
<div class="card border-blue-bottom">
<div class="content">
@include('admin.flights.subfleets')
</div>

View File

@ -1,36 +1,25 @@
@extends('admin.app')
@section('title', "Edit \"$rank->name\"")
@section('content')
<section class="content-header">
<h1>Edit "{!! $rank->name !!}"</h1>
</section>
<div class="card border-blue-bottom">
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! Form::model($rank, ['route' => ['admin.ranks.update', $rank->id], 'method' => 'patch']) !!}
@include('admin.ranks.fields')
{!! Form::close() !!}
</div>
</div>
</div>
<div class="box box-primary">
<div class="box-body">
<div class="row">
<div class="col-xs-12">
<h3>subfleets</h3>
<div class="box-body">
@include('admin.ranks.subfleets')
</div>
</div>
</div>
</div>
</div>
{!! Form::model($rank, ['route' => ['admin.ranks.update', $rank->id], 'method' => 'patch']) !!}
@include('admin.ranks.fields')
{!! Form::close() !!}
</div>
</div>
<div class="card border-blue-bottom">
<div class="header">
<h3>subfleets</h3>
</div>
<div class="content">
<div class="row">
@include('admin.ranks.subfleets')
</div>
</div>
</div>
@endsection
@section('scripts')
<script>

View File

@ -1,3 +1,4 @@
<div class="row">
<!-- Name Field -->
<div class="form-group col-sm-6">
{!! Form::label('name', 'Name:') !!}
@ -45,5 +46,8 @@
<!-- Submit Field -->
<div class="form-group col-sm-12 text-right">
{!! Form::submit('Add', ['class' => 'btn btn-primary']) !!}
<div class="pull-right">
{!! Form::submit('Add', ['class' => 'btn btn-primary']) !!}
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<div id="rank_subfleet_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div id="rank_subfleet_wrapper" class="dataTables_wrapper form-inline dt-bootstrap col-lg-12">
<table class="table table-responsive" id="subfleets-table">
<thead>
<th>Airline</th>
@ -16,9 +16,9 @@
{!! Form::open(['url' => '/admin/ranks/'.$rank->id.'/subfleets', 'method' => 'delete', 'class' => 'pjax_form']) !!}
{!! Form::hidden('subfleet_id', $sf->id) !!}
<div class='btn-group'>
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>',
{!! Form::button('<i class="fa fa-times"></i>',
['type' => 'submit',
'class' => 'btn btn-danger btn-xs'])
'class' => 'btn btn-sm btn-danger btn-icon'])
!!}
</div>
{!! Form::close() !!}
@ -29,7 +29,7 @@
</table>
<hr />
<div class="row">
<div class="col-xs-12">
<div class="col-lg-12">
<div class="input-group input-group-lg pull-right">
{!! Form::open(['url' => '/admin/ranks/'.$rank->id.'/subfleets',
'method' => 'post',
@ -38,11 +38,9 @@
!!}
{!! Form::select('subfleet_id', $avail_subfleets, null, [
'placeholder' => 'Select Subfleet',
'class' => 'select2_dropdown form-control input-lg',
])
'class' => 'select2_dropdown form-control input-lg'])
!!}
{!! Form::button('<i class="glyphicon glyphicon-plus"></i> add',
{!! Form::button('<i class="fa fa-times"></i> add',
['type' => 'submit',
'class' => 'btn btn-success btn-s']) !!}
{!! Form::close() !!}
@ -50,8 +48,3 @@
</div>
</div>
</div>
<script>
$(document).ready(function () {
$(".select2_dropdown").select2();
});
</script>