2017-06-18 06:25:36 +08:00
|
|
|
@extends('admin.app')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<section class="content-header">
|
2017-07-12 06:44:12 +08:00
|
|
|
<h1>Edit {!! $flight->airline->code !!}{!! $flight->flight_number !!}</h1>
|
2017-06-18 06:25:36 +08:00
|
|
|
</section>
|
|
|
|
<div class="content">
|
|
|
|
@include('adminlte-templates::common.errors')
|
|
|
|
<div class="box box-primary">
|
|
|
|
<div class="box-body">
|
|
|
|
<div class="row">
|
|
|
|
{!! Form::model($flight, ['route' => ['admin.flights.update', $flight->id], 'method' => 'patch']) !!}
|
|
|
|
|
|
|
|
@include('admin.flights.fields')
|
|
|
|
|
|
|
|
{!! Form::close() !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-12 06:44:12 +08:00
|
|
|
|
|
|
|
<div class="box box-primary">
|
|
|
|
<div class="box-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<h3>custom fields</h3>
|
|
|
|
<div class="box-body">
|
|
|
|
@include('admin.flights.flight_fields')
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-07-02 10:06:55 +08:00
|
|
|
<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>
|
2017-06-18 06:25:36 +08:00
|
|
|
</div>
|
|
|
|
@endsection
|
2017-07-02 10:06:55 +08:00
|
|
|
@section('scripts')
|
|
|
|
<script>
|
2017-07-12 06:44:12 +08:00
|
|
|
$(document).ready(function () {
|
2017-07-02 10:06:55 +08:00
|
|
|
|
2017-07-12 06:44:12 +08:00
|
|
|
$('#flight_fields_wrapper a.inline').editable({
|
|
|
|
type: 'text',
|
|
|
|
mode: 'inline',
|
|
|
|
emptytext: '0',
|
|
|
|
url: '/admin/flights/{!! $flight->id !!}/fields',
|
|
|
|
ajaxOptions: {'type': 'put'},
|
|
|
|
params: function(params) {
|
|
|
|
return {
|
|
|
|
field_id: params.pk,
|
|
|
|
name: params.name,
|
|
|
|
value: params.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2017-07-02 10:06:55 +08:00
|
|
|
|
2017-07-12 06:44:12 +08:00
|
|
|
$(".select2_dropdown").select2();
|
|
|
|
|
|
|
|
$(document).on('submit', 'form.pjax_form', function (event) {
|
|
|
|
event.preventDefault();
|
|
|
|
$.pjax.submit(event, '#flight_fields_wrapper', {push: false});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('pjax:complete', function() {
|
|
|
|
$(".select2_dropdown").select2();
|
2017-07-02 10:06:55 +08:00
|
|
|
});
|
2017-07-12 06:44:12 +08:00
|
|
|
});
|
2017-07-02 10:06:55 +08:00
|
|
|
</script>
|
|
|
|
@endsection
|