Load subfleet page first, can add aircraft from there #217

This commit is contained in:
Nabeel Shahzad
2018-03-23 20:30:31 -05:00
parent 1eb7e5d59a
commit 0671742703
7 changed files with 49 additions and 18 deletions

View File

@@ -1,9 +1,15 @@
<div class="row">
<div class="col-sm-12">
@component('admin.components.info')
Subfleets are aircraft groups. The "type" is a short name. Airlines always
group aircraft together by feature, so 737s with winglets might have a type of
"B.738-WL". You can create as many as you want, you need at least one, though.
<div class="form-group col-sm-6">
{{ Form::label('name', 'Name:') }}
{{ Form::text('name', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('name') }}</p>
Read more about subfleets <a
href="http://docs.phpvms.net/concepts/basics#subfleets-and-aircraft"
target="_new">here</a>.
@endcomponent
</div>
<div class="form-group col-sm-6">
@@ -11,6 +17,13 @@
{{ Form::text('type', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('type') }}</p>
</div>
<div class="form-group col-sm-6">
{{ Form::label('name', 'Name:') }}
{{ Form::text('name', null, ['class' => 'form-control']) }}
<p class="text-danger">{{ $errors->first('name') }}</p>
</div>
</div>
<div class="row">

View File

@@ -4,7 +4,7 @@
@section('actions')
<li><a href="{{ route('admin.subfleets.export') }}"><i class="ti-plus"></i>Export to CSV</a>
<li><a href="{{ route('admin.subfleets.import') }}"><i class="ti-plus"></i>Import from CSV</a></li>
<li><a href="{{ route('admin.subfleets.create') }}"><i class="ti-plus"></i>Add New</a></li>
<li><a href="{{ route('admin.subfleets.create') }}"><i class="ti-plus"></i>Add New Subfleet</a></li>
@endsection
@section('content')

View File

@@ -4,19 +4,20 @@
<th>Name</th>
<th>Airline</th>
<th>Type</th>
<th>Aircraft</th>
<th></th>
</thead>
<tbody>
@foreach($subfleets as $subfleet)
<tr>
<td>
<a href="{{ route('admin.subfleets.edit', [$subfleet->id]) }}">
<a href="{{ route('admin.aircraft.index') }}?subfleet={{$subfleet->id}}">
{{ $subfleet->name }}
</a>
</td>
<td>{{ $subfleet->airline->name }}</td>
<td>{{ $subfleet->type }}</td>
<td>{{ $subfleet->aircraft->count() }}</td>
<td class="text-right">
{{ Form::open(['route' => ['admin.subfleets.destroy', $subfleet->id], 'method' => 'delete']) }}