#23 cleaned up rank data and templates
This commit is contained in:
parent
244d1ae7bd
commit
9dc880d7d3
@ -76,10 +76,11 @@ class RankController extends BaseController
|
||||
$model = $this->rankRepository->create($input);
|
||||
Flash::success('Ranking saved successfully.');
|
||||
|
||||
$ranks = $this->rankRepository->all();
|
||||
return redirect(route('admin.ranks.edit', ['id' => $model->id]));
|
||||
/*$ranks = $this->rankRepository->all();
|
||||
return view('admin.ranks.table', [
|
||||
'ranks' => $ranks,
|
||||
]);
|
||||
]);*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ class Airline extends Model
|
||||
* @var array
|
||||
*/
|
||||
public static $rules = [
|
||||
'code' => 'required|max:3',
|
||||
'code' => 'required|max:3|unique:airlines',
|
||||
'name' => 'required',
|
||||
];
|
||||
|
||||
|
@ -35,7 +35,7 @@ class Airport extends Model
|
||||
* @var array
|
||||
*/
|
||||
public static $rules = [
|
||||
'icao' => 'required'
|
||||
'icao' => 'required|unique:airports'
|
||||
];
|
||||
|
||||
public function save(array $options = [])
|
||||
|
@ -40,7 +40,8 @@ class Rank extends Model
|
||||
* @var array
|
||||
*/
|
||||
public static $rules = [
|
||||
'name' => 'unique',
|
||||
'name' => 'required|unique:ranks',
|
||||
'hours' => 'required',
|
||||
];
|
||||
|
||||
public function subfleets() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<section class="content-header">
|
||||
<h1>Rank</h1>
|
||||
</section>
|
||||
@extends('admin.app')
|
||||
@section('content')
|
||||
<section class="content-header"><h1>Rank</h1></section>
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="box box-primary">
|
||||
@ -8,11 +8,10 @@
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
{!! Form::open(['route' => 'admin.ranks.store', 'class' => 'add_rank', 'method'=>'POST']) !!}
|
||||
|
||||
@include('admin.ranks.fields')
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
@ -15,37 +15,18 @@
|
||||
<div class="clearfix"></div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
@include('admin.ranks.table')
|
||||
@include('admin.ranks.table')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@include('admin.ranks.create')
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
/*$(".ac-fare-dropdown").select2();
|
||||
$('#aircraft_fares a').editable({
|
||||
type: 'text',
|
||||
mode: 'inline',
|
||||
emptytext: 'default',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: {'type': 'put'},
|
||||
params: function (params) {
|
||||
return {
|
||||
rank_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});*/
|
||||
|
||||
$(document).on('submit', 'form.add_rank', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#ranks_table_wrapper', {push: false});
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$(document).on('submit', 'form.add_rank', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#ranks_table_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
Loading…
Reference in New Issue
Block a user