#11 inline editing for pivot values for price/cost/capacity on fares

This commit is contained in:
Nabeel Shahzad
2017-06-13 15:11:11 -05:00
parent 4b137460e3
commit 15ed2bd846
7 changed files with 90 additions and 20 deletions

View File

@@ -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">&nbsp;&nbsp;</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});