#32 moved fares to subfleets

This commit is contained in:
Nabeel Shahzad
2017-06-24 11:09:27 -05:00
parent ca74afacd8
commit 3736e530bf
15 changed files with 216 additions and 144 deletions

View File

@@ -23,7 +23,7 @@
Fares assigned to the current aircraft. These can be overridden,
otherwise, the value used is the default, which comes from the fare.
</div>
@include('admin.aircraft.fares')
@include('admin.subfleets.fares')
</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
@extends('layouts.app')
@extends('admin.app')
@section('content')
<section class="content-header">

View File

@@ -34,7 +34,7 @@
</tr>
</thead>
<tbody>
@foreach($aircraft->fares as $atf)
@foreach($subfleet->fares as $atf)
<tr role="row" class="@if ($loop->iteration%2) even @else odd @endif">
<td class="sorting_1">{!! $atf->name !!}</td>
<td>{!! $atf->code !!}</td>
@@ -47,7 +47,7 @@
<span class="small background-color-grey-light">({!! $atf->cost!!})</span></td>
<td style="text-align: right; width:3%;">
<div class='btn-group'>
{!! Form::open(['url' => '/admin/aircraft/'.$aircraft->id.'/fares', 'method' => 'delete', 'class' => 'rm_fare']) !!}
{!! Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/fares', 'method' => 'delete', 'class' => 'rm_fare']) !!}
{!! Form::hidden('fare_id', $atf->id) !!}
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>',
['type' => 'submit',
@@ -63,7 +63,7 @@
<div class="row">
<div class="col-xs-12">
<div class="input-group input-group-lg pull-right">
{!! Form::open(['url' => '/admin/aircraft/'.$aircraft->id.'/fares',
{!! Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/fares',
'method' => 'post',
'class' => 'rm_fare form-inline'
])

View File

@@ -9,9 +9,52 @@
<div class="box-body">
<div class="row" style="padding-left: 20px">
@include('admin.subfleets.show_fields')
<a href="{!! route('admin.subfleets.index') !!}" class="btn btn-default">Back</a>
</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">&nbsp;&nbsp;</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
@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