Add the acars and manual payrates in the rank/subfleet forms

This commit is contained in:
Nabeel Shahzad
2018-02-26 19:14:10 -06:00
parent f6ec647eb6
commit cdd5fc749c
11 changed files with 95 additions and 20 deletions

View File

@@ -4,17 +4,18 @@
@component('admin.components.info')
Fares assigned to the current subfleet. These can be overridden,
otherwise, the value used is the default, which comes from the fare.
The pay can be set as a fixed amount, or a percentage of the default rate
@endcomponent
</div>
<br />
<table id="aircraft_fares" class="table table-hover">
<thead>
<tr>
<th>name</th>
<th style="text-align: center;">code</th>
<th style="text-align: center;">capacity (default)</th>
<th style="text-align: center;">price (default)</th>
<th style="text-align: center;">cost (default)</th>
<th>Name</th>
<th style="text-align: center;">Code</th>
<th style="text-align: center;">Capacity (default)</th>
<th style="text-align: center;">Price (default)</th>
<th style="text-align: center;">Cost (default)</th>
<th></th>
</tr>
</thead>

View File

@@ -2,14 +2,18 @@
<div class="header">
<h3>ranks</h3>
@component('admin.components.info')
These ranks are allowed to fly aircraft in this subfleet
These ranks are allowed to fly aircraft in this subfleet. The pay can be
set as a fixed amount, or a percentage of the rank's base payrate
@endcomponent
</div>
<br />
<table id="subfleet_ranks" class="table table-hover dataTable">
<thead>
<tr>
<th>name</th>
<th>Name</th>
<th style="text-align: center;">Base rate</th>
<th style="text-align: center;">ACARS pay</th>
<th style="text-align: center;">Manual pay</th>
<th></th>
</tr>
</thead>
@@ -17,6 +21,17 @@
@foreach($subfleet->ranks as $rank)
<tr>
<td class="sorting_1">{!! $rank->name !!}</td>
<td style="text-align: center;">{!! $rank->base_pay_rate ?: '-' !!}</td>
<td style="text-align: center;">
<a href="#" data-pk="{!! $rank->id !!}"
data-name="acars_pay">{!! $rank->pivot->acars_pay !!}</a>
</td>
<td style="text-align: center;">
<a href="#" data-pk="{!! $rank->id !!}"
data-name="manual_pay">{!! $rank->pivot->manual_pay !!}</a>
</td>
<td style="text-align: right; width:3%;">
{!! Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/ranks',
'method' => 'delete',

View File

@@ -4,7 +4,7 @@ function setEditable() {
$('#aircraft_fares a').editable({
type: 'text',
mode: 'inline',
emptytext: 'default',
emptytext: 'inherited',
url: '{!! url('/admin/subfleets/'.$subfleet->id.'/fares') !!}',
title: 'Enter override value',
ajaxOptions: {'type': 'put'},
@@ -16,6 +16,22 @@ function setEditable() {
}
}
});
$('#subfleet_ranks a').editable({
type: 'text',
mode: 'inline',
emptytext: 'inherited',
url: '{!! url('/admin/subfleets/'.$subfleet->id.'/ranks') !!}',
title: 'Enter override value',
ajaxOptions: {'type': 'put'},
params: function (params) {
return {
rank_id: params.pk,
name: params.name,
value: params.value
}
}
});
}
$(document).ready(function() {