phpvms/resources/views/admin/flights/edit.blade.php

80 lines
2.3 KiB
PHP
Raw Normal View History

@extends('admin.app')
@section('content')
<section class="content-header">
<h1>Edit {!! $flight->airline->code !!}{!! $flight->flight_number !!}</h1>
</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>
<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>
</div>
@endsection
2017-07-02 10:06:55 +08:00
@section('scripts')
<script>
$(document).ready(function () {
2017-07-02 10:06:55 +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
$(".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-02 10:06:55 +08:00
</script>
@endsection