diff --git a/app/Http/Controllers/Admin/PirepController.php b/app/Http/Controllers/Admin/PirepController.php index adaddec2..c8ac642d 100644 --- a/app/Http/Controllers/Admin/PirepController.php +++ b/app/Http/Controllers/Admin/PirepController.php @@ -218,7 +218,7 @@ class PirepController extends BaseController } /** - * Change or update the PIREP status + * Change or update the PIREP status. Just return the new actionbar * @param Request $request * @return \Illuminate\View\View */ @@ -233,7 +233,7 @@ class PirepController extends BaseController } $pirep->refresh(); - return view('admin.pireps.pirep_card', ['pirep' => $pirep]); + return view('admin.pireps.actions', ['pirep' => $pirep]); } /** diff --git a/resources/views/admin/pireps/actions.blade.php b/resources/views/admin/pireps/actions.blade.php new file mode 100644 index 00000000..d69a4b67 --- /dev/null +++ b/resources/views/admin/pireps/actions.blade.php @@ -0,0 +1,39 @@ +
| + @if($pirep->state === PirepState::PENDING + || $pirep->state === PirepState::REJECTED) + {!! Form::open(['url' => route('admin.pirep.status', ['id'=>$pirep->id]), + 'method' => 'post', + 'name' => 'accept_'.$pirep->id, + 'id' => $pirep->id.'_accept', + 'pirep_id' => $pirep->id, + 'new_status' => PirepState::ACCEPTED, + 'class' => 'pirep_submit_status']) !!} + {!! Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-info']) !!} + {!! Form::close() !!} + @endif + | ++ | + @if($pirep->state === PirepState::PENDING + || $pirep->state === PirepState::ACCEPTED) + {!! Form::open(['url' => route('admin.pirep.status', ['id'=>$pirep->id]), + 'method' => 'post', + 'name' => 'reject_'.$pirep->id, + 'id' => $pirep->id.'_reject', + 'pirep_id' => $pirep->id, + 'new_status' => PirepState::REJECTED, + 'class' => 'pirep_submit_status']) !!} + {!! Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) !!} + {!! Form::close() !!} + @endif + | ++ | + + + | +
| - @if($pirep->state == PirepState::PENDING - || $pirep->state == PirepState::REJECTED) - {!! Form::open(['url' => route('admin.pirep.status', ['id'=>$pirep->id]), - 'method' => 'post', - 'name' => 'accept_'.$pirep->id, - 'id' => $pirep->id.'_accept', - 'pirep_id' => $pirep->id, - 'new_status' => PirepState::ACCEPTED, - 'class' => 'pirep_submit_status']) !!} - {!! Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-info']) !!} - {!! Form::close() !!} - @endif - | -- | - @if($pirep->state == PirepState::PENDING - || $pirep->state == PirepState::ACCEPTED) - {!! Form::open(['url' => route('admin.pirep.status', ['id'=>$pirep->id]), - 'method' => 'post', - 'name' => 'reject_'.$pirep->id, - 'id' => $pirep->id.'_reject', - 'pirep_id' => $pirep->id, - 'new_status' => PirepState::REJECTED, - 'class' => 'pirep_submit_status']) !!} - {!! Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) !!} - {!! Form::close() !!} - @endif - | -- | - - - | -