#11 inline editing for pivot values for price/cost/capacity on fares
This commit is contained in:
@@ -18,17 +18,17 @@
|
||||
<th class="sorting" tabindex="0" aria-controls="aircraft_fares"
|
||||
rowspan="1" colspan="1"
|
||||
aria-label="capacity: activate to sort column ascending">
|
||||
capacity
|
||||
capacity (default)
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="aircraft_fares"
|
||||
rowspan="1" colspan="1"
|
||||
aria-label="price: activate to sort column ascending">
|
||||
price
|
||||
price (default)
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="aircraft_fares"
|
||||
rowspan="1" colspan="1"
|
||||
aria-label="cost: activate to sort column ascending">
|
||||
cost
|
||||
cost (default)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -38,9 +38,13 @@
|
||||
<tr role="row" class="@if ($loop->iteration%2) even @else odd @endif">
|
||||
<td class="sorting_1">{!! $atf->name !!}</td>
|
||||
<td>{!! $atf->code !!}</td>
|
||||
<td>{!! $atf->capacity !!}</td>
|
||||
<td>{!! $atf->price !!}</td>
|
||||
<td>{!! $atf->cost !!}</td>
|
||||
<td><a href="#" data-pk="{!! $atf->id !!}" data-name="capacity">{!! $atf->pivot->capacity !!}</a>
|
||||
<span class="small background-color-grey-light">({!! $atf->capacity !!})</span>
|
||||
</td>
|
||||
<td><a href="#" data-pk="{!! $atf->id !!}" data-name="price">{!! $atf->pivot->price !!}</a>
|
||||
<span class="small background-color-grey-light">({!! $atf->price !!})</span></td>
|
||||
<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>
|
||||
<td style="text-align: right; width:3%;">
|
||||
<div class='btn-group'>
|
||||
{!! Form::open(['url' => '/admin/aircraft/'.$aircraft->id.'/fares', 'method' => 'delete', 'class' => 'rm_fare']) !!}
|
||||
|
||||
@@ -10,9 +10,13 @@
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<hr/>
|
||||
<h3 class="box-header">fares</h3>
|
||||
<h3>fares</h3>
|
||||
<div class="box-body">
|
||||
<div class="callout callout-info">
|
||||
<i class="icon fa fa-info"> </i>
|
||||
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')
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,6 +29,22 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".ac-fare-dropdown").select2();
|
||||
$('#aircraft_fares a').editable({
|
||||
type: 'text',
|
||||
mode: 'inline',
|
||||
emptytext: 'default',
|
||||
url: '/admin/aircraft/{!! $aircraft->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});
|
||||
|
||||
@@ -179,6 +179,8 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/js/select2.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/iCheck/1.0.2/icheck.min.js"></script>
|
||||
<script src="/vendor/pjax/jquery.pjax.js"></script>
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet"/>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/js/bootstrap-editable.min.js"></script>
|
||||
|
||||
<!-- AdminLTE App -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/admin-lte/2.3.3/js/app.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user