admin can add comments to PIREPs #70
This commit is contained in:
45
resources/views/admin/pireps/comments.blade.php
Normal file
45
resources/views/admin/pireps/comments.blade.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<div id="pirep_comments_wrapper" class="col-12">
|
||||
<table class="table table-responsive" id="pireps-comments-table">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($pirep->comments as $comment)
|
||||
<tr>
|
||||
<td width="1%" nowrap="" style="vertical-align: text-top">
|
||||
<a href="{!! route('admin.users.show', [$comment->user_id]) !!}">
|
||||
{!! $comment->user->name !!}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{!! $comment->comment !!}</p>
|
||||
<p class="small">{!! show_datetime($comment->created_at) !!}</p>
|
||||
</td>
|
||||
<td align="right">
|
||||
{!! Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
|
||||
'method' => 'delete', 'class' => 'pjax_form form-inline']) !!}
|
||||
{!! Form::hidden('comment_id', $comment->id) !!}
|
||||
{!! Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
|
||||
'class' => 'btn btn-danger btn-small']) !!}
|
||||
{!! Form::close() !!}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="input-group input-group-lg pull-right">
|
||||
{!! Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
|
||||
'method' => 'post', 'class' => 'pjax_form form-inline']) !!}
|
||||
{!! Form::input('text', 'comment', null, ['class' => 'form-control input-sm']) !!}
|
||||
{!! Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
|
||||
'class' => 'btn btn-success btn-small']) !!}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,3 +22,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -19,4 +19,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.script')
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.script')
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -17,6 +17,16 @@ function changeStatus(values) {
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).on('submit', 'form.pjax_form', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#pirep_comments_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function () {
|
||||
$(".select2").select2();
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pirep_submit_status', function (event) {
|
||||
console.log(event);
|
||||
|
||||
@@ -29,9 +39,6 @@ $(document).ready(function() {
|
||||
console.log(values);
|
||||
console.log('Changing PIREP ' + values.pirep_id + ' to state ' + values.new_status);
|
||||
|
||||
//var destContainer = '#pirep_' + pirep_id + '_container';
|
||||
//$.pjax.submit(event, destContainer, { push: false, maxCacheLength: 0 });
|
||||
|
||||
changeStatus(values);
|
||||
});
|
||||
});
|
||||
@@ -14,13 +14,22 @@
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>custom fields</h4>
|
||||
@include('admin.pireps.field_values')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>comments</h4>
|
||||
@include('admin.pireps.comments')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.pireps.map')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.scripts');
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.ranks.scripts')
|
||||
|
||||
@@ -21,19 +21,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".select2_dropdown").select2();
|
||||
|
||||
$(document).on('submit', 'form.pjax_form', function(event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#rank_subfleet_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function() {
|
||||
$(".select2_dropdown").select2();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@include('admin.ranks.scripts')
|
||||
|
||||
@@ -13,13 +13,4 @@
|
||||
@include('admin.ranks.table')
|
||||
</div>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(document).on('submit', 'form.add_rank', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#ranks_table_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@include('admin.ranks.scripts')
|
||||
|
||||
21
resources/views/admin/ranks/scripts.blade.php
Normal file
21
resources/views/admin/ranks/scripts.blade.php
Normal file
@@ -0,0 +1,21 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".select2").select2();
|
||||
|
||||
$(document).on('submit', 'form.add_rank', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#ranks_table_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pjax_form', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#rank_subfleet_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function () {
|
||||
$(".select2").select2();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -14,3 +14,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.ranks.scripts')
|
||||
|
||||
@@ -31,14 +31,14 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="input-group input-group-lg pull-right">
|
||||
{!! Form::open(['url' => '/admin/ranks/'.$rank->id.'/subfleets',
|
||||
{!! Form::open(['url' => url('/admin/ranks/'.$rank->id.'/subfleets'),
|
||||
'method' => 'post',
|
||||
'class' => 'pjax_form form-inline'
|
||||
])
|
||||
!!}
|
||||
{!! Form::select('subfleet_id', $avail_subfleets, null, [
|
||||
'placeholder' => 'Select Subfleet',
|
||||
'class' => 'select2_dropdown form-control input-lg'])
|
||||
'class' => 'select2 form-control input-lg'])
|
||||
!!}
|
||||
{!! Form::button('<i class="fa fa-plus"></i> Add',
|
||||
['type' => 'submit',
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
@extends('admin.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
Airlines
|
||||
</h1>
|
||||
</section>
|
||||
<div class="card">
|
||||
<div class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row" style="padding-left: 20px">
|
||||
@include('admin.airlines.show_fields')
|
||||
<a href="{!! route('admin.airlines.index') !!}" class="btn btn-default">Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('admin.users.fields')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
<!-- Code Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('icao', 'ICAO:') !!}
|
||||
<p>{!! $airlines->icao !!}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{!! Form::label('iata', 'IATA:') !!}
|
||||
<p>{!! $airlines->iata !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('name', 'Name:') !!}
|
||||
<p>{!! $airlines->name !!}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{!! Form::label('logo', 'Logo URL:') !!}
|
||||
<p>{!! $airlines->logo !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Active Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('active', 'Active:') !!}
|
||||
<p>{!! $airlines->active !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Created At Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('created_at', 'Created At:') !!}
|
||||
<p>{!! $airlines->created_at !!}</p>
|
||||
</div>
|
||||
|
||||
<!-- Updated At Field -->
|
||||
<div class="form-group">
|
||||
{!! Form::label('updated_at', 'Updated At:') !!}
|
||||
<p>{!! $airlines->updated_at !!}</p>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<tbody>
|
||||
@foreach($users as $user)
|
||||
<tr>
|
||||
<td>{!! $user->name !!}</td>
|
||||
<td><a href="{!! route('admin.users.show', [$user->id]) !!}">{!! $user->name !!}</a></td>
|
||||
<td>{!! $user->email !!}</td>
|
||||
<td>{!! show_date($user->created_at) !!}</td>
|
||||
<td class="text-center">
|
||||
|
||||
Reference in New Issue
Block a user