#32 Cleanup of subfleet edit and linked from the aircraft screen
This commit is contained in:
parent
9dc880d7d3
commit
ddc2ed4d89
@ -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,
|
||||
]);*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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,
|
||||
]);
|
||||
}
|
||||
|
@ -11,7 +11,9 @@
|
||||
<tr>
|
||||
<td>
|
||||
@if($ac->subfleet_id)
|
||||
<a href="{!! route('admin.subfleets.edit', [$ac->subfleet_id]) !!}">
|
||||
{!! $ac->subfleet->name !!}
|
||||
</a>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
|
@ -17,5 +17,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<h3>fares</h3>
|
||||
<div class="box-body">
|
||||
<div class="callout callout-info">
|
||||
<i class="icon fa fa-info"> </i>
|
||||
Fares assigned to the current subfleet. These can be overridden,
|
||||
otherwise, the value used is the default, which comes from the fare.
|
||||
</div>
|
||||
@include('admin.subfleets.fares')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.subfleets.script')
|
||||
|
@ -1,23 +1,25 @@
|
||||
<!-- Airline Id Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="form-group col-sm-4">
|
||||
{!! Form::label('airline_id', 'Airline Id:') !!}
|
||||
{!! Form::select('airline_id', $airlines, null , ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="form-group col-sm-4">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
{!! Form::text('name', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Type Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="form-group col-sm-4">
|
||||
{!! Form::label('type', 'Type:') !!}
|
||||
{!! Form::text('type', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Submit Field -->
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
||||
<a href="{!! route('admin.subfleets.index') !!}" class="btn btn-default">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|
27
resources/views/admin/subfleets/script.blade.php
Normal file
27
resources/views/admin/subfleets/script.blade.php
Normal file
@ -0,0 +1,27 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".ac-fare-dropdown").select2();
|
||||
$('#aircraft_fares a').editable({
|
||||
type: 'text',
|
||||
mode: 'inline',
|
||||
emptytext: 'default',
|
||||
url: '/admin/subfleets/{!! $subfleet->id !!}/fares',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: { 'type': 'put'},
|
||||
params: function(params) {
|
||||
return {
|
||||
fare_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.rm_fare', function(event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#aircraft_fares_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
@ -31,30 +31,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".ac-fare-dropdown").select2();
|
||||
$('#aircraft_fares a').editable({
|
||||
type: 'text',
|
||||
mode: 'inline',
|
||||
emptytext: 'default',
|
||||
url: '/admin/subfleets/{!! $subfleet->id !!}/fares',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: { 'type': 'put'},
|
||||
params: function(params) {
|
||||
return {
|
||||
fare_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.rm_fare', function(event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#aircraft_fares_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@include('admin.subfleets.script')
|
||||
|
Loading…
Reference in New Issue
Block a user