\#21 PIREP scaffolding

This commit is contained in:
Nabeel Shahzad
2017-06-28 19:54:05 -05:00
parent 43effce37c
commit 477b99de29
25 changed files with 1061 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1>Add PIREP Field</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.pirepfields.store']) !!}
@include('admin.pirep_fields.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,19 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1>Edit "{!! $field->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($field, ['route' => ['admin.pirepfields.update', $field->id], 'method' => 'patch']) !!}
@include('admin.pirep_fields.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,17 @@
<!-- Name Field -->
<div class="form-group col-sm-6">
{!! Form::label('name', 'Name:') !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
</div>
<!-- Required Field -->
<div class="form-group col-sm-6">
{!! Form::label('required', 'Required:') !!}
{!! Form::text('required', 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.pirepfields.index') !!}" class="btn btn-default">Cancel</a>
</div>

View File

@@ -0,0 +1,23 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1 class="pull-left">PIREP Fields</h1>
<h1 class="pull-right">
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.pirepfields.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.pirep_fields.table')
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,17 @@
@extends('layouts.app')
@section('content')
<section class="content-header">
<h1>{!! $pirepFields->name !!}</h1>
</section>
<div class="content">
<div class="box box-primary">
<div class="box-body">
<div class="row" style="padding-left: 20px">
@include('admin.pirep_fields.show_fields')
<a href="{!! route('admin.pirepfields.index') !!}" class="btn btn-default">Back</a>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,30 @@
<!-- Id Field -->
<div class="form-group">
{!! Form::label('id', 'Id:') !!}
<p>{!! $field->id !!}</p>
</div>
<!-- Name Field -->
<div class="form-group">
{!! Form::label('name', 'Name:') !!}
<p>{!! $field->name !!}</p>
</div>
<!-- Required Field -->
<div class="form-group">
{!! Form::label('required', 'Required:') !!}
<p>{!! $field->required !!}</p>
</div>
<!-- Created At Field -->
<div class="form-group">
{!! Form::label('created_at', 'Created At:') !!}
<p>{!! $field->created_at !!}</p>
</div>
<!-- Updated At Field -->
<div class="form-group">
{!! Form::label('updated_at', 'Updated At:') !!}
<p>{!! $field->updated_at !!}</p>
</div>

View File

@@ -0,0 +1,24 @@
<table class="table table-responsive" id="pirepFields-table">
<thead>
<th>Name</th>
<th>Required</th>
<th colspan="3">Action</th>
</thead>
<tbody>
@foreach($fields as $field)
<tr>
<td>{!! $field->name !!}</td>
<td>{!! $field->required !!}</td>
<td>
{!! Form::open(['route' => ['admin.pirepfields.destroy', $field->id], 'method' => 'delete']) !!}
<div class='btn-group'>
{{--<a href="{!! route('admin.pirepfields.show', [$field->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
<a href="{!! route('admin.pirepfields.edit', [$field->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>

View File

@@ -0,0 +1,24 @@
@extends('admin.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.pireps.store']) !!}
@include('admin.pireps.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,23 @@
@extends('admin.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::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) !!}
@include('admin.pireps.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,47 @@
<!-- Flight Id Field -->
<div class="form-group col-sm-6">
{!! Form::label('flight_id', 'Flight ID:') !!}
{!! Form::text('flight_id', null, ['class' => 'form-control']) !!}
</div>
<!-- Aircraft Id Field -->
<div class="form-group col-sm-6">
{!! Form::label('aircraft_id', 'Aircraft ID:') !!}
{!! Form::text('aircraft_id', null, ['class' => 'form-control']) !!}
</div>
<!-- Flight Time Field -->
<div class="form-group col-sm-6">
{!! Form::label('flight_time', 'Flight Time:') !!}
{!! Form::text('flight_time', null, ['class' => 'form-control']) !!}
</div>
<!-- Level Field -->
<div class="form-group col-sm-6">
{!! Form::label('level', 'Flight Level:') !!}
{!! Form::text('level', null, ['class' => 'form-control']) !!}
</div>
<!-- Route Field -->
<div class="form-group col-sm-6">
{!! Form::label('route', 'Route:') !!}
{!! Form::text('route', null, ['class' => 'form-control']) !!}
</div>
<!-- Notes Field -->
<div class="form-group col-sm-6">
{!! Form::label('notes', 'Notes:') !!}
{!! Form::text('notes', null, ['class' => 'form-control']) !!}
</div>
<!-- Raw Data Field -->
<div class="form-group col-sm-6">
{!! Form::label('raw_data', 'Raw Data:') !!}
{!! Form::text('raw_data', 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.pireps.index') !!}" class="btn btn-default">Cancel</a>
</div>

View File

@@ -0,0 +1,23 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1 class="pull-left">PIREPs</h1>
<h1 class="pull-right">
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.pireps.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.pireps.table')
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,17 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1>PIREP</h1>
</section>
<div class="content">
<div class="box box-primary">
<div class="box-body">
<div class="row" style="padding-left: 20px">
@include('admin.pireps.show_fields')
<a href="{!! route('admin.pireps.index') !!}" class="btn btn-default">Back</a>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,66 @@
<!-- Id Field -->
<div class="form-group">
{!! Form::label('id', 'Id:') !!}
<p>{!! $pirep->id !!}</p>
</div>
<!-- User Id Field -->
<div class="form-group">
{!! Form::label('user_id', 'User Id:') !!}
<p>{!! $pirep->user_id !!}</p>
</div>
<!-- Flight Id Field -->
<div class="form-group">
{!! Form::label('flight_id', 'Flight Id:') !!}
<p>{!! $pirep->flight_id !!}</p>
</div>
<!-- Aircraft Id Field -->
<div class="form-group">
{!! Form::label('aircraft_id', 'Aircraft Id:') !!}
<p>{!! $pirep->aircraft_id !!}</p>
</div>
<!-- Flight Time Field -->
<div class="form-group">
{!! Form::label('flight_time', 'Flight Time:') !!}
<p>{!! $pirep->flight_time !!}</p>
</div>
<!-- Level Field -->
<div class="form-group">
{!! Form::label('level', 'Level:') !!}
<p>{!! $pirep->level !!}</p>
</div>
<!-- Route Field -->
<div class="form-group">
{!! Form::label('route', 'Route:') !!}
<p>{!! $pirep->route !!}</p>
</div>
<!-- Notes Field -->
<div class="form-group">
{!! Form::label('notes', 'Notes:') !!}
<p>{!! $pirep->notes !!}</p>
</div>
<!-- Raw Data Field -->
<div class="form-group">
{!! Form::label('raw_data', 'Raw Data:') !!}
<p>{!! $pirep->raw_data !!}</p>
</div>
<!-- Created At Field -->
<div class="form-group">
{!! Form::label('created_at', 'Created At:') !!}
<p>{!! $pirep->created_at !!}</p>
</div>
<!-- Updated At Field -->
<div class="form-group">
{!! Form::label('updated_at', 'Updated At:') !!}
<p>{!! $pirep->updated_at !!}</p>
</div>

View File

@@ -0,0 +1,36 @@
<table class="table table-responsive" id="pireps-table">
<thead>
<th>User Id</th>
<th>Flight Id</th>
<th>Aircraft Id</th>
<th>Flight Time</th>
<th>Level</th>
<th>Route</th>
<th>Notes</th>
<th>Raw Data</th>
<th colspan="3">Action</th>
</thead>
<tbody>
@foreach($pireps as $pirep)
<tr>
<td>{!! $pirep->user_id !!}</td>
<td>{!! $pirep->flight_id !!}</td>
<td>{!! $pirep->aircraft_id !!}</td>
<td>{!! $pirep->flight_time !!}</td>
<td>{!! $pirep->level !!}</td>
<td>{!! $pirep->route !!}</td>
<td>{!! $pirep->notes !!}</td>
<td>{!! $pirep->raw_data !!}</td>
<td>
{!! Form::open(['route' => ['admin.pireps.destroy', $pirep->id], 'method' => 'delete']) !!}
<div class='btn-group'>
<a href="{!! route('admin.pireps.show', [$pirep->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
<a href="{!! route('admin.pireps.edit', [$pirep->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>