updated subfleet admin design

This commit is contained in:
Nabeel Shahzad
2017-11-22 11:52:02 -06:00
parent 321f2e94f5
commit 5e990164ee
12 changed files with 131 additions and 103 deletions
Generated
+5 -3
View File
@@ -5,7 +5,6 @@
<path value="$PROJECT_DIR$/vendor/infyomlabs/adminlte-templates" /> <path value="$PROJECT_DIR$/vendor/infyomlabs/adminlte-templates" />
<path value="$PROJECT_DIR$/vendor/infyomlabs/laravel-generator" /> <path value="$PROJECT_DIR$/vendor/infyomlabs/laravel-generator" />
<path value="$PROJECT_DIR$/vendor/psr/log" /> <path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/infyomlabs/swagger-generator" />
<path value="$PROJECT_DIR$/vendor/symfony/yaml" /> <path value="$PROJECT_DIR$/vendor/symfony/yaml" />
<path value="$PROJECT_DIR$/vendor/composer" /> <path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/symfony/css-selector" /> <path value="$PROJECT_DIR$/vendor/symfony/css-selector" />
@@ -28,7 +27,6 @@
<path value="$PROJECT_DIR$/vendor/sebastian/version" /> <path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" /> <path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/laravelcollective/html" /> <path value="$PROJECT_DIR$/vendor/laravelcollective/html" />
<path value="$PROJECT_DIR$/vendor/zircote/swagger-php" />
<path value="$PROJECT_DIR$/vendor/erusev/parsedown" /> <path value="$PROJECT_DIR$/vendor/erusev/parsedown" />
<path value="$PROJECT_DIR$/vendor/prettus/laravel-validation" /> <path value="$PROJECT_DIR$/vendor/prettus/laravel-validation" />
<path value="$PROJECT_DIR$/vendor/prettus/l5-repository" /> <path value="$PROJECT_DIR$/vendor/prettus/l5-repository" />
@@ -58,7 +56,6 @@
<path value="$PROJECT_DIR$/vendor/symfony/process" /> <path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/symfony/routing" /> <path value="$PROJECT_DIR$/vendor/symfony/routing" />
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" /> <path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
<path value="$PROJECT_DIR$/vendor/jlapp/swaggervel" />
<path value="$PROJECT_DIR$/vendor/mockery/mockery" /> <path value="$PROJECT_DIR$/vendor/mockery/mockery" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" /> <path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/swiftmailer/swiftmailer" /> <path value="$PROJECT_DIR$/vendor/swiftmailer/swiftmailer" />
@@ -120,6 +117,11 @@
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" /> <path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/psr/container" /> <path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" /> <path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
</include_path> </include_path>
</component> </component>
<component name="PhpProjectServersManager"> <component name="PhpProjectServersManager">
@@ -20,6 +20,23 @@ class SubfleetController extends BaseController
/** @var SubfleetRepository */ /** @var SubfleetRepository */
private $subfleetRepo, $fareRepo; private $subfleetRepo, $fareRepo;
/**
* SubfleetController constructor.
*
* @param SubfleetRepository $subfleetRepo
* @param FareRepository $fareRepo
*/
public function __construct(
SubfleetRepository $subfleetRepo,
FareRepository $fareRepo
) {
$this->subfleetRepo = $subfleetRepo;
$this->fareRepo = $fareRepo;
}
/**
* @return array
*/
protected function getFuelTypes() protected function getFuelTypes()
{ {
$retval = []; $retval = [];
@@ -30,6 +47,9 @@ class SubfleetController extends BaseController
return $retval; return $retval;
} }
/**
* Get all the fares that haven't been assigned to a given subfleet
*/
protected function getAvailFares($subfleet) protected function getAvailFares($subfleet)
{ {
$retval = []; $retval = [];
@@ -45,15 +65,6 @@ class SubfleetController extends BaseController
return $retval; return $retval;
} }
public function __construct(
SubfleetRepository $subfleetRepo,
FareRepository $fareRepo
)
{
$this->subfleetRepo = $subfleetRepo;
$this->fareRepo = $fareRepo;
}
/** /**
* Display a listing of the Subfleet. * Display a listing of the Subfleet.
* *
@@ -214,7 +225,8 @@ class SubfleetController extends BaseController
$subfleet = $this->subfleetRepo->findWithoutFail($id); $subfleet = $this->subfleetRepo->findWithoutFail($id);
if (empty($subfleet)) { if (empty($subfleet)) {
return view('admin.aircraft.fares', ['fares' => []]); return $this->return_fares_view($subfleet);
//return view('admin.aircraft.fares', ['fares' => []]);
} }
$fare_svc = app('App\Services\FareService'); $fare_svc = app('App\Services\FareService');
+3 -3
View File
@@ -37,14 +37,14 @@
"dg/rss-php": "1.2", "dg/rss-php": "1.2",
"makinacorpus/php-bloom": "dev-master", "makinacorpus/php-bloom": "dev-master",
"hashids/hashids": "2.0.*", "hashids/hashids": "2.0.*",
"maatwebsite/excel": "2.1.*" "maatwebsite/excel": "2.1.*",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.3.*"
}, },
"require-dev": { "require-dev": {
"fzaninotto/faker": "~1.4", "fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*", "mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6.0", "phpunit/phpunit": "~6.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"laravel/homestead": "v6.2.2", "laravel/homestead": "v6.2.2",
"scriptfusion/phpunit-immediate-exception-printer": "^1", "scriptfusion/phpunit-immediate-exception-printer": "^1",
"filp/whoops": "~2.0" "filp/whoops": "~2.0"
+17
View File
@@ -14,12 +14,15 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/dompdf/dompdf" /> <excludeFolder url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" /> <excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ellipsesynergie/api-response" /> <excludeFolder url="file://$MODULE_DIR$/vendor/ellipsesynergie/api-response" />
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hashids/hashids" /> <excludeFolder url="file://$MODULE_DIR$/vendor/hashids/hashids" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" /> <excludeFolder url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/fractal" /> <excludeFolder url="file://$MODULE_DIR$/vendor/league/fractal" />
<excludeFolder url="file://$MODULE_DIR$/vendor/maatwebsite/excel" /> <excludeFolder url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
<excludeFolder url="file://$MODULE_DIR$/vendor/makinacorpus/php-bloom" /> <excludeFolder url="file://$MODULE_DIR$/vendor/makinacorpus/php-bloom" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" /> <excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" /> <excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" /> <excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-http/httplug" /> <excludeFolder url="file://$MODULE_DIR$/vendor/php-http/httplug" />
@@ -28,10 +31,12 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" /> <excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" /> <excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/scriptfusion/phpunit-immediate-exception-printer" /> <excludeFolder url="file://$MODULE_DIR$/vendor/scriptfusion/phpunit-immediate-exception-printer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/fractalistic" /> <excludeFolder url="file://$MODULE_DIR$/vendor/spatie/fractalistic" />
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" /> <excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" /> <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" /> <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" /> <excludeFolder url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" /> <excludeFolder url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" />
</content> </content>
@@ -49,12 +54,15 @@
<root url="file://$MODULE_DIR$/vendor/dompdf/dompdf" /> <root url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
<root url="file://$MODULE_DIR$/vendor/egulias/email-validator" /> <root url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<root url="file://$MODULE_DIR$/vendor/ellipsesynergie/api-response" /> <root url="file://$MODULE_DIR$/vendor/ellipsesynergie/api-response" />
<root url="file://$MODULE_DIR$/vendor/filp/whoops" />
<root url="file://$MODULE_DIR$/vendor/hashids/hashids" /> <root url="file://$MODULE_DIR$/vendor/hashids/hashids" />
<root url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" /> <root url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
<root url="file://$MODULE_DIR$/vendor/league/fractal" /> <root url="file://$MODULE_DIR$/vendor/league/fractal" />
<root url="file://$MODULE_DIR$/vendor/maatwebsite/excel" /> <root url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
<root url="file://$MODULE_DIR$/vendor/makinacorpus/php-bloom" /> <root url="file://$MODULE_DIR$/vendor/makinacorpus/php-bloom" />
<root url="file://$MODULE_DIR$/vendor/nikic/php-parser" /> <root url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<root url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<root url="file://$MODULE_DIR$/vendor/phar-io/version" />
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" /> <root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" /> <root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
<root url="file://$MODULE_DIR$/vendor/php-http/httplug" /> <root url="file://$MODULE_DIR$/vendor/php-http/httplug" />
@@ -63,10 +71,12 @@
<root url="file://$MODULE_DIR$/vendor/psr/container" /> <root url="file://$MODULE_DIR$/vendor/psr/container" />
<root url="file://$MODULE_DIR$/vendor/psr/simple-cache" /> <root url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<root url="file://$MODULE_DIR$/vendor/scriptfusion/phpunit-immediate-exception-printer" /> <root url="file://$MODULE_DIR$/vendor/scriptfusion/phpunit-immediate-exception-printer" />
<root url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<root url="file://$MODULE_DIR$/vendor/spatie/fractalistic" /> <root url="file://$MODULE_DIR$/vendor/spatie/fractalistic" />
<root url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" /> <root url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" />
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" /> <root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" /> <root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
<root url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" /> <root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
<root url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" /> <root url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" />
</CLASSES> </CLASSES>
@@ -82,12 +92,15 @@
<root url="file://$MODULE_DIR$/vendor/dompdf/dompdf" /> <root url="file://$MODULE_DIR$/vendor/dompdf/dompdf" />
<root url="file://$MODULE_DIR$/vendor/egulias/email-validator" /> <root url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<root url="file://$MODULE_DIR$/vendor/ellipsesynergie/api-response" /> <root url="file://$MODULE_DIR$/vendor/ellipsesynergie/api-response" />
<root url="file://$MODULE_DIR$/vendor/filp/whoops" />
<root url="file://$MODULE_DIR$/vendor/hashids/hashids" /> <root url="file://$MODULE_DIR$/vendor/hashids/hashids" />
<root url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" /> <root url="file://$MODULE_DIR$/vendor/jeremeamia/SuperClosure" />
<root url="file://$MODULE_DIR$/vendor/league/fractal" /> <root url="file://$MODULE_DIR$/vendor/league/fractal" />
<root url="file://$MODULE_DIR$/vendor/maatwebsite/excel" /> <root url="file://$MODULE_DIR$/vendor/maatwebsite/excel" />
<root url="file://$MODULE_DIR$/vendor/makinacorpus/php-bloom" /> <root url="file://$MODULE_DIR$/vendor/makinacorpus/php-bloom" />
<root url="file://$MODULE_DIR$/vendor/nikic/php-parser" /> <root url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<root url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<root url="file://$MODULE_DIR$/vendor/phar-io/version" />
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" /> <root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" /> <root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
<root url="file://$MODULE_DIR$/vendor/php-http/httplug" /> <root url="file://$MODULE_DIR$/vendor/php-http/httplug" />
@@ -96,10 +109,12 @@
<root url="file://$MODULE_DIR$/vendor/psr/container" /> <root url="file://$MODULE_DIR$/vendor/psr/container" />
<root url="file://$MODULE_DIR$/vendor/psr/simple-cache" /> <root url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<root url="file://$MODULE_DIR$/vendor/scriptfusion/phpunit-immediate-exception-printer" /> <root url="file://$MODULE_DIR$/vendor/scriptfusion/phpunit-immediate-exception-printer" />
<root url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<root url="file://$MODULE_DIR$/vendor/spatie/fractalistic" /> <root url="file://$MODULE_DIR$/vendor/spatie/fractalistic" />
<root url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" /> <root url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" />
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" /> <root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" /> <root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
<root url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" /> <root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
<root url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" /> <root url="file://$MODULE_DIR$/vendor/yajra/laravel-datatables-oracle" />
</SOURCES> </SOURCES>
@@ -109,10 +124,12 @@
<library name="PHARS"> <library name="PHARS">
<CLASSES> <CLASSES>
<root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.0.phar/" /> <root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.0.phar/" />
<root url="phar://$MODULE_DIR$/vendor/phar-io/manifest/tests/_fixture/test.phar/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.0.phar/" /> <root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.0.phar/" />
<root url="phar://$MODULE_DIR$/vendor/phar-io/manifest/tests/_fixture/test.phar/" />
</SOURCES> </SOURCES>
</library> </library>
</orderEntry> </orderEntry>
+2
View File
@@ -101,11 +101,13 @@
<div class="content"> <div class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-12">
@include('flash::message') @include('flash::message')
@yield('content') @yield('content')
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
+10 -18
View File
@@ -1,39 +1,31 @@
@extends('admin.app') @extends('admin.app')
@section('title', "Edit $subfleet->name")
@section('content') @section('content')
<section class="content-header">
<h1>Edit {!! $subfleet->name !!}</h1>
</section>
<div class="content">
@include('adminlte-templates::common.errors') @include('adminlte-templates::common.errors')
<div class="box box-primary"> <div class="card border-blue-bottom">
<div class="box-body"> <div class="content">
<div class="row">
{!! Form::model($subfleet, ['route' => ['admin.subfleets.update', $subfleet->id], 'method' => 'patch']) !!} {!! Form::model($subfleet, ['route' => ['admin.subfleets.update', $subfleet->id], 'method' => 'patch']) !!}
@include('admin.subfleets.fields') @include('admin.subfleets.fields')
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
</div> <div class="card border-blue-bottom">
<div class="box box-primary"> <div class="header">
<div class="box-body">
<div class="row">
<div class="col-xs-12">
<h3>fares</h3> <h3>fares</h3>
<div class="box-body"> <p class="category">
<div class="callout callout-info">
<i class="icon fa fa-info">&nbsp;&nbsp;</i> <i class="icon fa fa-info">&nbsp;&nbsp;</i>
Fares assigned to the current subfleet. These can be overridden, Fares assigned to the current subfleet. These can be overridden,
otherwise, the value used is the default, which comes from the fare. otherwise, the value used is the default, which comes from the fare.
</p>
</div> </div>
<div class="content">
<div class="row">
<div class="col-xs-12">
@include('admin.subfleets.fares') @include('admin.subfleets.fares')
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
@endsection @endsection
@include('admin.subfleets.script') @include('admin.subfleets.script')
@@ -1,3 +1,4 @@
{{--<div class="row"> <div class="col-12">--}}
<div id="aircraft_fares_wrapper" class="dataTables_wrapper form-inline dt-bootstrap"> <div id="aircraft_fares_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<table id="aircraft_fares" <table id="aircraft_fares"
class="table table-bordered table-hover dataTable" class="table table-bordered table-hover dataTable"
@@ -46,14 +47,16 @@
<td><a href="#" data-pk="{!! $atf->id !!}" data-name="cost">{!! $atf->pivot->cost !!}</a> <td><a href="#" data-pk="{!! $atf->id !!}" data-name="cost">{!! $atf->pivot->cost !!}</a>
<span class="small background-color-grey-light">({!! $atf->cost!!})</span></td> <span class="small background-color-grey-light">({!! $atf->cost!!})</span></td>
<td style="text-align: right; width:3%;"> <td style="text-align: right; width:3%;">
<div class='btn-group'> {!! Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/fares',
{!! Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/fares', 'method' => 'delete', 'class' => 'rm_fare']) !!} 'method' => 'delete',
'class' => 'rm_fare'
])
!!}
{!! Form::hidden('fare_id', $atf->id) !!} {!! Form::hidden('fare_id', $atf->id) !!}
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>', {!! Form::button('<i class="fa fa-times"></i>',
['type' => 'submit', ['type' => 'submit',
'class' => 'btn btn-danger btn-s']) !!} 'class' => 'btn btn-sm btn-danger btn-icon']) !!}
{!! Form::close() !!} {!! Form::close() !!}
</div>
</td> </td>
</tr> </tr>
@endforeach @endforeach
@@ -82,3 +85,4 @@
</div> </div>
</div> </div>
</div> </div>
{{--</div></div>--}}
@@ -1,31 +1,28 @@
<!-- Airline Id Field --> <div class="row">
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('airline_id', 'Airline:') !!} {!! Form::label('airline_id', 'Airline:') !!}
{!! Form::select('airline_id', $airlines, null , ['class' => 'form-control select2']) !!} {!! Form::select('airline_id', $airlines, null , ['class' => 'form-control select2']) !!}
</div> </div>
<!-- Name Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('name', 'Name:') !!} {!! Form::label('name', 'Name:') !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!} {!! Form::text('name', null, ['class' => 'form-control']) !!}
</div> </div>
<!-- Type Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('type', 'Type:') !!} {!! Form::label('type', 'Type:') !!}
{!! Form::text('type', null, ['class' => 'form-control']) !!} {!! Form::text('type', null, ['class' => 'form-control']) !!}
</div> </div>
<!-- Fuel Type Field -->
<div class="form-group col-sm-6"> <div class="form-group col-sm-6">
{!! Form::label('fuel_type', 'Fuel Type:') !!} {!! Form::label('fuel_type', 'Fuel Type:') !!}
{!! Form::select('fuel_type', $fuel_types, null , ['class' => 'form-control select2']) !!} {!! Form::select('fuel_type', $fuel_types, null , ['class' => 'form-control select2']) !!}
</div> </div>
<!-- Submit Field -->
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<div class="pull-right"> <div class="pull-right">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!} {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.subfleets.index') !!}" class="btn btn-default">Cancel</a> <a href="{!! route('admin.subfleets.index') !!}" class="btn btn-default">Cancel</a>
</div> </div>
</div> </div>
</div>
@@ -1,23 +1,17 @@
@extends('admin.app') @extends('admin.app')
@section('title', 'Subfleets')
@section('actions')
<li>
<a href="{!! route('admin.subfleets.create') !!}">
<i class="ti-plus"></i>Add New</a>
</li>
@endsection
@section('content') @section('content')
<section class="content-header"> <div class="card">
<h1 class="pull-left">Subfleets</h1>
<h1 class="pull-right">
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.subfleets.create') !!}">Add New</a>
</h1>
</section>
<div class="content">
<div class="clearfix"></div>
@include('flash::message') @include('flash::message')
<div class="clearfix"></div>
<div class="box box-primary">
<div class="box-body">
@include('admin.subfleets.table') @include('admin.subfleets.table')
</div> </div>
</div>
</div>
@endsection @endsection
@@ -22,6 +22,10 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
$.pjax.submit(event, '#aircraft_fares_wrapper', {push: false}); $.pjax.submit(event, '#aircraft_fares_wrapper', {push: false});
}); });
$(document).on('pjax:complete', function() {
$(".select2").select2();
});
}); });
</script> </script>
@endsection @endsection
@@ -1,3 +1,4 @@
<div class="content table-responsive table-full-width">
<table class="table table-hover table-responsive" id="subfleets-table"> <table class="table table-hover table-responsive" id="subfleets-table">
<thead> <thead>
<th>Airline</th> <th>Airline</th>
@@ -25,14 +26,17 @@
</td> </td>
<td class="text-right"> <td class="text-right">
{!! Form::open(['route' => ['admin.subfleets.destroy', $subfleet->id], 'method' => 'delete']) !!} {!! Form::open(['route' => ['admin.subfleets.destroy', $subfleet->id], 'method' => 'delete']) !!}
<div class='btn-group'>
<a href="{!! route('admin.subfleets.show', [$subfleet->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a> <a href="{!! route('admin.subfleets.edit', [$subfleet->id]) !!}" class='btn btn-sm btn-success btn-icon'>
<a href="{!! route('admin.subfleets.edit', [$subfleet->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a> <i class="fa fa-pencil-square-o"></i></a>
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
</div> {!! Form::button('<i class="fa fa-times"></i>',
['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon',
'onclick' => "return confirm('Are you sure?')"]) !!}
{!! Form::close() !!} {!! Form::close() !!}
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div>
+1 -1
View File
@@ -21,7 +21,7 @@ class FlightTest extends TestCase
return $flight->id; return $flight->id;
} }
public function XtestGetFlight() public function testGetFlight()
{ {
$flight_id = $this->addFlight(); $flight_id = $this->addFlight();
$response = $this->json('GET', '/api/flight/'.$flight_id); $response = $this->json('GET', '/api/flight/'.$flight_id);