2017-07-12 06:44:12 +08:00
|
|
|
<div id="flight_fields_wrapper">
|
2018-01-07 22:58:57 +08:00
|
|
|
<h3>custom fields</h3><br />
|
2017-07-12 06:44:12 +08:00
|
|
|
<table class="table table-responsive" id="flight-fields-table">
|
2018-03-21 02:06:06 +08:00
|
|
|
@if(count($flight->field_values))
|
2017-07-12 06:44:12 +08:00
|
|
|
<thead>
|
|
|
|
<th>Name</th>
|
2018-03-21 02:06:06 +08:00
|
|
|
<th>Value</th>
|
|
|
|
<th></th>
|
2017-07-12 06:44:12 +08:00
|
|
|
</thead>
|
2018-02-27 09:23:22 +08:00
|
|
|
@endif
|
2017-07-12 06:44:12 +08:00
|
|
|
<tbody>
|
2018-03-21 02:47:47 +08:00
|
|
|
@foreach($flight_fields as $field)
|
|
|
|
@php
|
|
|
|
$val_field = $flight->field_values->where('name', $field->name)->first();
|
|
|
|
@endphp
|
2017-07-12 06:44:12 +08:00
|
|
|
<tr>
|
2018-03-13 06:58:12 +08:00
|
|
|
<td>{{ $field->name }}</td>
|
2017-07-12 06:44:12 +08:00
|
|
|
<td>
|
2018-03-21 02:47:47 +08:00
|
|
|
<a class="inline" href="#" data-pk="{{ $val_field['id'] ?? '' }}" data-name="{{ $field->name }}">
|
|
|
|
{{ $val_field['value'] ?? '' }}
|
|
|
|
</a>
|
2017-07-12 06:44:12 +08:00
|
|
|
</td>
|
|
|
|
<td style="width: 10%; text-align: center;" class="form-inline">
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::open(['url' => '/admin/flights/'.$flight->id.'/fields',
|
2017-07-12 06:44:12 +08:00
|
|
|
'method' => 'delete',
|
2018-01-07 22:58:57 +08:00
|
|
|
'class' => 'pjax_form pjax_flight_fields'
|
2018-03-13 06:58:12 +08:00
|
|
|
]) }}
|
2018-03-21 02:47:47 +08:00
|
|
|
{{ Form::hidden('field_id', $val_field['id'] ?? null) }}
|
2017-07-12 06:44:12 +08:00
|
|
|
<div class='btn-group'>
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::button('<i class="fa fa-times"></i>',
|
2018-03-21 02:47:47 +08:00
|
|
|
['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon',
|
|
|
|
'onclick' => "return confirm('Are you sure?')"]) }}
|
2017-07-12 06:44:12 +08:00
|
|
|
</div>
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::close() }}
|
2017-07-12 06:44:12 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<hr/>
|
2018-01-07 22:58:57 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="text-right">
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::open([
|
2018-01-07 22:58:57 +08:00
|
|
|
'url' => '/admin/flights/'.$flight->id.'/fields',
|
|
|
|
'method' => 'post',
|
|
|
|
'class' => 'pjax_form form-inline pjax_flight_fields'
|
|
|
|
])
|
2018-03-13 06:58:12 +08:00
|
|
|
}}
|
2017-07-12 06:44:12 +08:00
|
|
|
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::label('name', 'Name:') }}
|
|
|
|
{{ Form::text('name', null, ['class' => 'form-control']) }}
|
2018-01-07 22:58:57 +08:00
|
|
|
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::label('value', 'Value:') }}
|
|
|
|
{{ Form::text('value', null, ['class' => 'form-control']) }}
|
2018-01-07 22:58:57 +08:00
|
|
|
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::button('<i class="glyphicon glyphicon-plus"></i> add',
|
2018-01-07 22:58:57 +08:00
|
|
|
['type' => 'submit',
|
2018-03-13 06:58:12 +08:00
|
|
|
'class' => 'btn btn-success btn-s']) }}
|
2018-02-07 00:18:22 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('name') }}</p>
|
2018-02-07 00:59:31 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('value') }}</p>
|
2018-03-13 06:58:12 +08:00
|
|
|
{{ Form::close() }}
|
2018-01-07 22:58:57 +08:00
|
|
|
</div>
|
2017-07-12 06:44:12 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|