#57 skeleton for flights page

This commit is contained in:
Nabeel Shahzad 2017-08-02 15:12:26 -05:00
parent 0ad5639bb9
commit 07ce5e9a1a
5 changed files with 217 additions and 0 deletions

View File

@ -0,0 +1,37 @@
<?php
namespace App\Http\Controllers\Frontend;
use Illuminate\Http\Request;
use App\Repositories\FlightRepository;
use App\Http\Controllers\AppBaseController;
class FlightController extends AppBaseController
{
private $flightRepo;
public function __construct(FlightRepository $flightRepo)
{
$this->flightRepo = $flightRepo;
}
public function index(Request $request)
{
$flights = $this->flightRepo->findByField('active', true);
return $this->view('flights.index', [
'flights' => $flights,
]);
}
public function show($id)
{
}
public function update()
{
}
}

View File

@ -0,0 +1,12 @@
@extends('layouts.default.app')
@section('content')
<div class="row">
@include('flash::message')
<div class="col-sm-12">
<h2 class="description">flights</h2>
@include('layouts.default.flights.table')
</div>
</div>
@endsection

View File

@ -0,0 +1,45 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1 class="pull-left">{!! $flight->airline->code !!}{!! $flight->flight_number !!}</h1>
<h1 class="pull-right">
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px"
href="{!! route('admin.flights.edit', $flight->id) !!}">Edit</a>
</h1>
</section>
<section class="content">
<div class="clearfix"></div>
<div class="row">
@include('admin.flights.show_fields')
</div>
<div class="box box-primary">
<div class="box-body">
<div class="row">
<div class="col-xs-12">
<h3>assigned subfleets</h3>
<div class="box-body">
@include('admin.flights.subfleets')
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('scripts')
<script>
$(document).ready(function () {
$(".select2_dropdown").select2();
$(document).on('submit', 'form.pjax_form', function (event) {
event.preventDefault();
$.pjax.submit(event, '#subfleet_flight_wrapper', {push: false});
});
$(document).on('pjax:complete', function() {
$(".select2_dropdown").select2();
});
});
</script>
@endsection

View File

@ -0,0 +1,81 @@
<div class="form-group col-sm-6">
<div class="box box-solid">
<div class="box-header with-border">
{{--<i class="fa fa-text-width"></i>--}}
<h3 class="box-title">{!! Form::label('dpt_airport_id', 'Dep ICAO') !!}</h3>
</div>
<div class="box-body"><p class="lead">
{!! $flight->dpt_airport->icao !!} - {!! $flight->dpt_airport->name !!}
</p></div>
</div>
</div>
<div class="form-group col-sm-6">
<div class="box box-solid">
<div class="box-header with-border">
{{--<i class="fa fa-text-width"></i>--}}
<h3 class="box-title">{!! Form::label('arr_airport_id', 'Arrival ICAO') !!}</h3>
</div>
<div class="box-body"><p class="lead">
{!! $flight->arr_airport->icao !!} - {!! $flight->arr_airport->name !!}
</p>
</div>
</div>
</div>
<div class="form-group col-sm-12">
<div class="box box-primary">
<div class="box-body">
<!-- Route Code Field -->
<div class="form-group">
{!! Form::label('route_code', 'Route Code:') !!}
{!! $flight->route_code !!}
</div>
<!-- Route Leg Field -->
<div class="form-group">
{!! Form::label('route_leg', 'Route Leg:') !!}
{!! $flight->route_leg !!}
</div>
<!-- Alt Airport Id Field -->
@if($flight->alt_airport_id)
<div class="form-group">
{!! Form::label('alt_airport_id', 'Alt Airport Id:') !!}
<p>{!! $flight->alt_airport->icao !!}</p>
</div>
@endif
<!-- Route Field -->
<div class="form-group">
{!! Form::label('route', 'Route:') !!}
<p>{!! $flight->route !!}</p>
</div>
<!-- Dpt Time Field -->
<div class="form-group">
{!! Form::label('dpt_time', 'Departure Time:') !!}
{!! $flight->dpt_time !!}
</div>
<!-- Arr Time Field -->
<div class="form-group">
{!! Form::label('arr_time', 'Arrival Time:') !!}
{!! $flight->arr_time !!}
</div>
<!-- Notes Field -->
<div class="form-group">
{!! Form::label('notes', 'Notes:') !!}
<p>{!! $flight->notes !!}</p>
</div>
<!-- Active Field -->
<div class="form-group">
{!! Form::label('active', 'Active:') !!}
<p>{!! $flight->active !!}</p>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,42 @@
@foreach($flights as $flight)
<div class="card">
<div class="card-block" style="min-height: 0px">
<div class="row">
<div class="col-sm-1">
<a href="{!! route('frontend.flights.show', [$flight->id]) !!}">
{!! $flight->airline->code !!}{!! $flight->flight_number !!}
@if($flight->route_code)
(C: {!! $flight->route_code !!} L: {!! $flight->route_leg !!})
@endif
</a>
</div>
<div class="col-sm-11">
<div class="row">
<div class="col-sm-4">
<span class="title">DEP&nbsp;</span>
{!! $flight->dpt_airport->icao !!}&nbsp;
<span class="description">{!! $flight->dpt_time !!}</span>
</div>
<div class="col-sm-4">
<span class="title">ARR&nbsp;</span>
{!! $flight->arr_airport->icao !!}&nbsp;
<span class="description">{!! $flight->arr_time !!}</span>
@if($flight->alt_airport)
<span class="description">Alt: {!! $flight->alt_airport->icao !!}
)</span>
@endif
</div>
<div class="col-sm-4">
</div>
<div class="col-sm-12">
<span class="description">ROUTE&nbsp;</span>
{!! $flight->route !!}
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach