#23 refactoring for ranks
This commit is contained in:
@@ -1,25 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Requests\CreateRankingRequest;
|
||||
use App\Http\Requests\UpdateRankingRequest;
|
||||
use App\Repositories\RankingRepository;
|
||||
use App\Repositories\RankRepository;
|
||||
use App\Http\Controllers\AppBaseController as InfyOmBaseController;
|
||||
use Illuminate\Http\Request;
|
||||
use Flash;
|
||||
use Prettus\Repository\Criteria\RequestCriteria;
|
||||
use Response;
|
||||
|
||||
class RankingController extends InfyOmBaseController
|
||||
class RankController extends BaseController
|
||||
{
|
||||
/** @var RankingRepository */
|
||||
private $rankingRepository;
|
||||
/** @var RankRepository */
|
||||
private $rankRepository;
|
||||
|
||||
public function __construct(RankingRepository $rankingRepo)
|
||||
public function __construct(RankRepository $rankingRepo)
|
||||
{
|
||||
$this->rankingRepository = $rankingRepo;
|
||||
$this->rankRepository = $rankingRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,11 +29,11 @@ class RankingController extends InfyOmBaseController
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->rankingRepository->pushCriteria(new RequestCriteria($request));
|
||||
$rankings = $this->rankingRepository->all();
|
||||
$this->rankRepository->pushCriteria(new RequestCriteria($request));
|
||||
$ranks = $this->rankRepository->all();
|
||||
|
||||
return view('admin.rankings.index')
|
||||
->with('rankings', $rankings);
|
||||
return view('admin.ranks.index')
|
||||
->with('ranks', $ranks);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +43,7 @@ class RankingController extends InfyOmBaseController
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin.rankings.create');
|
||||
return view('admin.ranks.create');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,12 +56,11 @@ class RankingController extends InfyOmBaseController
|
||||
public function store(CreateRankingRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$ranking = $this->rankingRepository->create($input);
|
||||
$rank = $this->rankRepository->create($input);
|
||||
|
||||
Flash::success('Ranking saved successfully.');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,15 +72,14 @@ class RankingController extends InfyOmBaseController
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$ranking = $this->rankingRepository->findWithoutFail($id);
|
||||
$rank = $this->rankRepository->findWithoutFail($id);
|
||||
|
||||
if (empty($ranking)) {
|
||||
if (empty($rank)) {
|
||||
Flash::error('Ranking not found');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
return view('admin.rankings.show')->with('ranking', $ranking);
|
||||
return view('admin.ranks.show')->with('rank', $rank);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,15 +91,14 @@ class RankingController extends InfyOmBaseController
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$ranking = $this->rankingRepository->findWithoutFail($id);
|
||||
$rank = $this->rankRepository->findWithoutFail($id);
|
||||
|
||||
if (empty($ranking)) {
|
||||
if (empty($rank)) {
|
||||
Flash::error('Ranking not found');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
return view('admin.rankings.edit')->with('ranking', $ranking);
|
||||
return view('admin.ranks.edit')->with('rank', $rank);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,19 +111,18 @@ class RankingController extends InfyOmBaseController
|
||||
*/
|
||||
public function update($id, UpdateRankingRequest $request)
|
||||
{
|
||||
$ranking = $this->rankingRepository->findWithoutFail($id);
|
||||
$rank = $this->rankRepository->findWithoutFail($id);
|
||||
|
||||
if (empty($ranking)) {
|
||||
if (empty($rank)) {
|
||||
Flash::error('Ranking not found');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
$ranking = $this->rankingRepository->update($request->all(), $id);
|
||||
$rank = $this->rankRepository->update($request->all(), $id);
|
||||
|
||||
Flash::success('Ranking updated successfully.');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,18 +134,17 @@ class RankingController extends InfyOmBaseController
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$ranking = $this->rankingRepository->findWithoutFail($id);
|
||||
$rank = $this->rankRepository->findWithoutFail($id);
|
||||
|
||||
if (empty($ranking)) {
|
||||
if (empty($rank)) {
|
||||
Flash::error('Ranking not found');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
$this->rankingRepository->delete($id);
|
||||
$this->rankRepository->delete($id);
|
||||
|
||||
Flash::success('Ranking deleted successfully.');
|
||||
|
||||
return redirect(route('admin.rankings.index'));
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Ranking;
|
||||
use App\Models\Rank;
|
||||
|
||||
class CreateRankingRequest extends Request
|
||||
{
|
||||
@@ -25,6 +25,6 @@ class CreateRankingRequest extends Request
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Ranking::$rules;
|
||||
return Rank::$rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Ranking;
|
||||
use App\Models\Rank;
|
||||
|
||||
class UpdateRankingRequest extends Request
|
||||
{
|
||||
@@ -25,6 +25,6 @@ class UpdateRankingRequest extends Request
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Ranking::$rules;
|
||||
return Rank::$rules;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ use Eloquent as Model;
|
||||
* Class Ranking
|
||||
* @package App\Models
|
||||
*/
|
||||
class Ranking extends Model
|
||||
class Rank extends Model
|
||||
{
|
||||
|
||||
public $table = 'rankings';
|
||||
public $table = 'ranks';
|
||||
|
||||
public $fillable = [
|
||||
'name',
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Ranking;
|
||||
use App\Models\Rank;
|
||||
use InfyOm\Generator\Common\BaseRepository;
|
||||
|
||||
class RankingRepository extends BaseRepository
|
||||
class RankRepository extends BaseRepository
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $fieldSearchable = [
|
||||
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -19,6 +19,6 @@ class RankingRepository extends BaseRepository
|
||||
**/
|
||||
public function model()
|
||||
{
|
||||
return Ranking::class;
|
||||
return Rank::class;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ class CreateUsersTable extends Migration
|
||||
$table->string('email')->unique();
|
||||
$table->string('password');
|
||||
$table->integer('airline_id')->nullable()->unsigned();
|
||||
$table->integer('rank_id')->nullable()->unsigned();
|
||||
$table->integer('home_airport_id')->nullable()->unsigned();
|
||||
$table->integer('curr_airport_id')->nullable()->unsigned();
|
||||
$table->bigInteger('last_pirep_id')->nullable()->unsigned();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateRankingsTable extends Migration
|
||||
class CreateRanksTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -13,7 +13,7 @@ class CreateRankingsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('rankings', function (Blueprint $table) {
|
||||
Schema::create('ranks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('hours')->default(0);
|
||||
@@ -22,6 +22,14 @@ class CreateRankingsTable extends Migration
|
||||
$table->boolean('auto_promote')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('flight_rank', function(Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('flight_id')->unsigned();
|
||||
$table->integer('rank_id')->unsigned();
|
||||
$table->double('manual_pay', 19, 2)->default(0.0)->unsigned();
|
||||
$table->double('acars_pay', 19, 2)->default(0.0)->unsigned();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,6 +39,7 @@ class CreateRankingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('rankings');
|
||||
Schema::drop('ranks');
|
||||
Schema::drop('flight_rank');
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class DevelopmentSeeder extends Seeder
|
||||
return Carbon::now('UTC')->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
protected function seed_from_yaml(): void
|
||||
protected function seed_from_yaml():
|
||||
{
|
||||
$time_fields = ['created_at', 'updated_at'];
|
||||
|
||||
|
||||
@@ -16,3 +16,4 @@
|
||||
<li><a href="{!! url('/admin/airports') !!}"><i class="fa fa-globe"></i> airports</a></li>
|
||||
{{--<li><a href="{!! url('/admin/aircraftclasses') !!}"><i class="fa fa-tag"></i> aircraft classes</a></li>--}}
|
||||
<li><a href="#"><i class="fa fa-user-circle-o" aria-hidden="true"></i> users</a></li>
|
||||
<li><a href="{!! url('/admin/ranks') !!}"><i class="fa fa-user-circle-o" aria-hidden="true"></i> ranks</a></li>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
$MODEL_NAME_HUMAN$
|
||||
</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="box box-primary">
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
{!! Form::open(['route' => 'admin.rankings.store']) !!}
|
||||
|
||||
@include('admin.rankings.fields')
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -1,35 +0,0 @@
|
||||
<!-- Name Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
{!! Form::text('name', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Hours Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('hours', 'Hours:') !!}
|
||||
{!! Form::text('hours', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Auto Approve Acars Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('auto_approve_acars', 'Auto Approve Acars:') !!}
|
||||
{!! Form::text('auto_approve_acars', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Auto Approve Manual Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('auto_approve_manual', 'Auto Approve Manual:') !!}
|
||||
{!! Form::text('auto_approve_manual', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Auto Promote Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('auto_promote', 'Auto Promote:') !!}
|
||||
{!! Form::text('auto_promote', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Submit Field -->
|
||||
<div class="form-group col-sm-12">
|
||||
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
||||
<a href="{!! route('admin.rankings.index') !!}" class="btn btn-default">Cancel</a>
|
||||
</div>
|
||||
@@ -1,23 +0,0 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1 class="pull-left">$MODEL_NAME_PLURAL_HUMAN$</h1>
|
||||
<h1 class="pull-right">
|
||||
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.rankings.create') !!}">Add New</a>
|
||||
</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
<div class="clearfix"></div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
@include('admin.rankings.table')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<table class="table table-responsive" id="rankings-table">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Hours</th>
|
||||
<th>Auto Approve Acars</th>
|
||||
<th>Auto Approve Manual</th>
|
||||
<th>Auto Promote</th>
|
||||
<th colspan="3">Action</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($rankings as $ranking)
|
||||
<tr>
|
||||
<td>{!! $ranking->name !!}</td>
|
||||
<td>{!! $ranking->hours !!}</td>
|
||||
<td>{!! $ranking->auto_approve_acars !!}</td>
|
||||
<td>{!! $ranking->auto_approve_manual !!}</td>
|
||||
<td>{!! $ranking->auto_promote !!}</td>
|
||||
<td>
|
||||
{!! Form::open(['route' => ['admin.rankings.destroy', $ranking->$PRIMARY_KEY_NAME$], 'method' => 'delete']) !!}
|
||||
<div class='btn-group'>
|
||||
<a href="{!! route('admin.rankings.show', [$ranking->$PRIMARY_KEY_NAME$]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
|
||||
<a href="{!! route('admin.rankings.edit', [$ranking->$PRIMARY_KEY_NAME$]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
18
resources/views/admin/ranks/create.blade.php
Normal file
18
resources/views/admin/ranks/create.blade.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<section class="content-header">
|
||||
<h1>Rank</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="box box-primary">
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
{!! Form::open(['route' => 'admin.ranks.store', 'class' => 'add_rank']) !!}
|
||||
|
||||
@include('admin.ranks.fields')
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,23 +1,21 @@
|
||||
@extends('layouts.app')
|
||||
@extends('admin.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
$MODEL_NAME_HUMAN$
|
||||
</h1>
|
||||
<h1>{!! $rank->name !!}</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
{!! Form::model($ranking, ['route' => ['admin.rankings.update', $ranking->$PRIMARY_KEY_NAME$], 'method' => 'patch']) !!}
|
||||
{!! Form::model($ranking, ['route' => ['admin.ranks.update', $rank->id], 'method' => 'patch']) !!}
|
||||
|
||||
@include('admin.rankings.fields')
|
||||
@include('admin.ranks.fields')
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
49
resources/views/admin/ranks/fields.blade.php
Normal file
49
resources/views/admin/ranks/fields.blade.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<!-- Name Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
{!! Form::text('name', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Hours Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('hours', 'Hours:') !!}
|
||||
{!! Form::text('hours', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Auto Approve Acars Field -->
|
||||
<div class="form-group col-sm-4 text-center">
|
||||
<div class="checkbox">
|
||||
<label class="checkbox-inline">
|
||||
{!! Form::hidden('auto_approve_acars', false) !!}
|
||||
{!! Form::checkbox('auto_approve_acars', '1', true) !!}
|
||||
{!! Form::label('auto_approve_acars', 'Auto Approve ACARS') !!}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Auto Approve Manual Field -->
|
||||
<div class="form-group col-sm-4 text-center">
|
||||
<div class="checkbox">
|
||||
<label class="checkbox-inline">
|
||||
{!! Form::hidden('auto_approve_manual', false) !!}
|
||||
{!! Form::checkbox('auto_approve_manual', '1', true) !!}
|
||||
{!! Form::label('auto_approve_manual', 'Auto Approve Manual') !!}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Auto Promote Field -->
|
||||
<div class="form-group col-sm-4 text-center">
|
||||
<div class="checkbox">
|
||||
<label class="checkbox-inline">
|
||||
{!! Form::hidden('auto_promote', false) !!}
|
||||
{!! Form::checkbox('auto_promote', '1', true) !!}
|
||||
{!! Form::label('auto_promote', 'Auto Promote') !!}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit Field -->
|
||||
<div class="form-group col-sm-12 text-right">
|
||||
{!! Form::submit('Add', ['class' => 'btn btn-primary']) !!}
|
||||
</div>
|
||||
52
resources/views/admin/ranks/index.blade.php
Normal file
52
resources/views/admin/ranks/index.blade.php
Normal file
@@ -0,0 +1,52 @@
|
||||
@extends('admin.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1 class="pull-left">Pilot Ranks</h1>
|
||||
<h1 class="pull-right">
|
||||
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.ranks.create') !!}">Add New</a>
|
||||
</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
<div class="clearfix"></div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
@include('admin.ranks.table')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="create_rank_wrapper">
|
||||
@include('admin.ranks.create')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
<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, '#create_rank_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -1,17 +1,14 @@
|
||||
@extends('layouts.app')
|
||||
@extends('admin.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
$MODEL_NAME_HUMAN$
|
||||
</h1>
|
||||
<h1>{!! $rank->name !!}</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row" style="padding-left: 20px">
|
||||
@include('admin.rankings.show_fields')
|
||||
<a href="{!! route('admin.rankings.index') !!}" class="btn btn-default">Back</a>
|
||||
@include('admin.ranks.show_fields')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,48 +1,48 @@
|
||||
<!-- Id Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('id', 'Id:') !!}
|
||||
<p>{!! $ranking->id !!}</p>
|
||||
<p>{!! $rank->id !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
<p>{!! $ranking->name !!}</p>
|
||||
<p>{!! $rank->name !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Hours Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('hours', 'Hours:') !!}
|
||||
<p>{!! $ranking->hours !!}</p>
|
||||
<p>{!! $rank->hours !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Auto Approve Acars Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('auto_approve_acars', 'Auto Approve Acars:') !!}
|
||||
<p>{!! $ranking->auto_approve_acars !!}</p>
|
||||
<p>{!! $rank->auto_approve_acars !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Auto Approve Manual Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('auto_approve_manual', 'Auto Approve Manual:') !!}
|
||||
<p>{!! $ranking->auto_approve_manual !!}</p>
|
||||
<p>{!! $rank->auto_approve_manual !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Auto Promote Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('auto_promote', 'Auto Promote:') !!}
|
||||
<p>{!! $ranking->auto_promote !!}</p>
|
||||
<p>{!! $rank->auto_promote !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Created At Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('created_at', 'Created At:') !!}
|
||||
<p>{!! $ranking->created_at !!}</p>
|
||||
<p>{!! $rank->created_at !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Updated At Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('updated_at', 'Updated At:') !!}
|
||||
<p>{!! $ranking->updated_at !!}</p>
|
||||
<p>{!! $rank->updated_at !!}</p>
|
||||
</div>
|
||||
|
||||
33
resources/views/admin/ranks/table.blade.php
Normal file
33
resources/views/admin/ranks/table.blade.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<table class="table table-responsive" id="ranks-table">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Hours</th>
|
||||
<th>Auto Approve Acars</th>
|
||||
<th>Auto Approve Manual</th>
|
||||
<th>Auto Promote</th>
|
||||
<th colspan="3">Action</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($ranks as $rank)
|
||||
<tr>
|
||||
<td>{!! $rank->name !!}</td>
|
||||
<td>{!! $rank->hours !!}</td>
|
||||
<td>{!! $rank->auto_approve_acars !!}</td>
|
||||
<td>{!! $rank->auto_approve_manual !!}</td>
|
||||
<td>{!! $rank->auto_promote !!}</td>
|
||||
<td>
|
||||
{!! Form::open(['route' => ['admin.ranks.destroy', $rank->id], 'method' => 'delete']) !!}
|
||||
<div class='btn-group'>
|
||||
<a href="{!! route('admin.ranks.show', [$rank->id]) !!}"
|
||||
class='btn btn-default btn-xs'><i
|
||||
class="glyphicon glyphicon-eye-open"></i></a>
|
||||
<a href="{!! route('admin.ranks.edit', [$rank->id]) !!}"
|
||||
class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -20,6 +20,9 @@ Route::group([
|
||||
Route::resource('flights', 'FlightController');
|
||||
Route::match(['get', 'post', 'put', 'delete'], 'flights/{id}/aircraft', 'FlightController@aircraft');
|
||||
|
||||
# rankings
|
||||
Route::resource('ranks', 'RankController');
|
||||
|
||||
# view/update settings
|
||||
Route::match(['get'], 'settings', 'SettingsController@index');
|
||||
Route::match(['post', 'put'], 'settings', 'SettingsController@update');
|
||||
|
||||
@@ -17,13 +17,3 @@ Route::group([
|
||||
Auth::routes();
|
||||
|
||||
require base_path('routes/admin.php');
|
||||
|
||||
|
||||
Route::get('admin/rankings', ['as'=> 'admin.rankings.index', 'uses' => 'RankingController@index']);
|
||||
Route::post('admin/rankings', ['as'=> 'admin.rankings.store', 'uses' => 'RankingController@store']);
|
||||
Route::get('admin/rankings/create', ['as'=> 'admin.rankings.create', 'uses' => 'RankingController@create']);
|
||||
Route::put('admin/rankings/{rankings}', ['as'=> 'admin.rankings.update', 'uses' => 'RankingController@update']);
|
||||
Route::patch('admin/rankings/{rankings}', ['as'=> 'admin.rankings.update', 'uses' => 'RankingController@update']);
|
||||
Route::delete('admin/rankings/{rankings}', ['as'=> 'admin.rankings.destroy', 'uses' => 'RankingController@destroy']);
|
||||
Route::get('admin/rankings/{rankings}', ['as'=> 'admin.rankings.show', 'uses' => 'RankingController@show']);
|
||||
Route::get('admin/rankings/{rankings}/edit', ['as'=> 'admin.rankings.edit', 'uses' => 'RankingController@edit']);
|
||||
|
||||
Reference in New Issue
Block a user