Type Ratings | New Feature (#1360)

* Type Ratings

Adding "Type Rating" definition and assignment possibility to v7 core.

* Update ProfileController.php

* StyleFix 1

* Update settings.yml

Change description text as requested
This commit is contained in:
B.Fatih KOZ
2021-11-30 22:36:17 +03:00
committed by GitHub
parent 66d83c0ce6
commit 52e716d6ee
35 changed files with 1275 additions and 181 deletions

View File

@@ -16,6 +16,12 @@
</div>
</div>
<div class="card border-blue-bottom">
<div class="content">
@include('admin.subfleets.type_ratings')
</div>
</div>
<div class="card border-blue-bottom">
<div class="content">
@include('admin.subfleets.fares')

View File

@@ -114,6 +114,12 @@
$.pjax.submit(event, '#subfleet_ranks_wrapper', {push: false});
});
$(document).on('submit', 'form.modify_typerating', function (event) {
event.preventDefault();
console.log(event);
$.pjax.submit(event, '#subfleet_typeratings_wrapper', {push: false});
});
$(document).on('submit', 'form.modify_expense', function (event) {
event.preventDefault();
console.log(event);

View File

@@ -0,0 +1,45 @@
<div id="subfleet_typeratings_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="header">
<h3>type ratings</h3>
@component('admin.components.info')
These type ratings are allowed to fly aircraft in this subfleet.
@endcomponent
</div>
<br/>
<table id="subfleet_ranks" class="table table-hover">
@if(count($subfleet->typeratings))
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th></th>
</tr>
</thead>
@endif
<tbody>
@foreach($subfleet->typeratings as $tr)
<tr>
<td class="sorting_1">{{ $tr->type }}</td>
<td>{{ $tr->name }}</td>
<td style="text-align: right; width:3%;">
{{ Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/typeratings', 'method' => 'delete', 'class' => 'modify_typerating']) }}
{{ Form::hidden('typerating_id', $tr->id) }}
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon']) }}
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
<hr/>
<div class="row">
<div class="col-xs-12">
<div class="text-right">
{{ Form::open(['url' => '/admin/subfleets/'.$subfleet->id.'/typeratings', 'method' => 'post', 'class' => 'modify_typerating form-inline']) }}
{{ Form::select('typerating_id', $avail_ratings, null, ['placeholder' => 'Select Type Rating', 'class' => 'ac-fare-dropdown form-control input-lg select2']) }}
{{ Form::button('<i class="glyphicon glyphicon-plus"></i> add', ['type' => 'submit', 'class' => 'btn btn-success btn-s']) }}
{{ Form::close() }}
</div>
</div>
</div>
</div>