add airports table and #7 integrate permissions

This commit is contained in:
Nabeel Shahzad
2017-06-11 11:36:16 -05:00
parent 35f660d1d9
commit d3cf57a1d1
25 changed files with 640 additions and 60 deletions

View File

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

View File

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

View File

@@ -0,0 +1,31 @@
<!-- Icao Field -->
<div class="form-group col-sm-6">
{!! Form::label('icao', 'ICAO:') !!}
{!! Form::text('icao', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group col-sm-6">
{!! Form::label('name', 'Name:') !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group col-sm-6">
{!! Form::label('location', 'Location:') !!}
{!! Form::text('location', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group col-sm-6">
{!! Form::label('lat', 'Latitude:') !!}
{!! Form::number('lat', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group col-sm-6">
{!! Form::label('lon', 'Longitude:') !!}
{!! Form::number('lon', 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.airports.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">$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.airports.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.airports.table')
</div>
</div>
</div>
@endsection

View File

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

View File

@@ -0,0 +1,38 @@
<!-- Icao Field -->
<div class="form-group">
{!! Form::label('icao', 'ICAO:') !!}
<p>{!! $airport->icao !!}</p>
</div>
<div class="form-group">
{!! Form::label('name', 'Name:') !!}
<p>{!! $airport->name !!}</p>
</div>
<div class="form-group">
{!! Form::label('location', 'Location:') !!}
<p>{!! $airport->location !!}</p>
</div>
<div class="form-group">
{!! Form::label('lat', 'Latitude:') !!}
<p>{!! $airport->lat !!}</p>
</div>
<div class="form-group">
{!! Form::label('lon', 'Longitude:') !!}
<p>{!! $airport->lon !!}</p>
</div>
<!-- Created At Field -->
<div class="form-group">
{!! Form::label('created_at', 'Created At:') !!}
<p>{!! $airport->created_at !!}</p>
</div>
<!-- Updated At Field -->
<div class="form-group">
{!! Form::label('updated_at', 'Updated At:') !!}
<p>{!! $airport->updated_at !!}</p>
</div>

View File

@@ -0,0 +1,26 @@
<table class="table table-responsive" id="airports-table">
<thead>
<th>ICAO</th>
<th>Name</th>
<th>Location</th>
<th colspan="3">Action</th>
</thead>
<tbody>
@foreach($airports as $airport)
<tr>
<td>{!! $airport->icao !!}</td>
<td>{!! $airport->name !!}</td>
<td>{!! $airport->location !!} ({!! $airport->lat !!}x{!! $airport->lon !!})</td>
<td>
{!! Form::open(['route' => ['admin.airports.destroy', $airport->id], 'method' => 'delete']) !!}
<div class='btn-group'>
<a href="{!! route('admin.airports.show', [$airport->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
<a href="{!! route('admin.airports.edit', [$airport->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,20 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1 class="pull-left">Dashboard</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">
wassup
</div>
</div>
</div>
@endsection