From ec4ffbdcee7f031e49f118f3c7e3fb4fbc6bc703 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Thu, 16 May 2019 18:19:52 +0200 Subject: [PATCH] =?UTF-8?q?-=20reject=20form=20f=C3=BCr=20reviewer=20-=20e?= =?UTF-8?q?ditor=20sees=20submission=20date=20in=20index=20table=20-=202?= =?UTF-8?q?=20new=20routes:=20reject=20und=20rejectUpdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Publish/ReviewController.php | 14 +++++ .../views/workflow/editor/index.blade.php | 9 ++- .../views/workflow/review/index.blade.php | 4 ++ .../views/workflow/review/reject.blade.php | 57 +++++++++++++++++++ routes/web.php | 8 +++ 5 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 resources/views/workflow/review/reject.blade.php diff --git a/app/Http/Controllers/Publish/ReviewController.php b/app/Http/Controllers/Publish/ReviewController.php index 9d43810..a783788 100644 --- a/app/Http/Controllers/Publish/ReviewController.php +++ b/app/Http/Controllers/Publish/ReviewController.php @@ -128,6 +128,20 @@ class ReviewController extends Controller throw new GeneralException(trans('exceptions.publish.review.update_error')); } + /** + * Reject dataset back to editor + * + * @param int $id + * @return \Illuminate\View\View + */ + public function reject($id): View + { + $dataset = Dataset::with('user:id,login')->findOrFail($id); + return view('workflow.review.reject', [ + 'dataset' => $dataset, + ]); + } + //snakeToCamel private static function convertColumnToFieldname($columnname) { diff --git a/resources/views/workflow/editor/index.blade.php b/resources/views/workflow/editor/index.blade.php index 657d665..cb871d5 100644 --- a/resources/views/workflow/editor/index.blade.php +++ b/resources/views/workflow/editor/index.blade.php @@ -14,7 +14,8 @@ Dataset Title ID Server State - Editor + Editor + Date of submission @@ -49,7 +50,11 @@ @elseif ($dataset->server_state == "editor_accepted") in approvement by {{ optional($dataset->editor)->login }} @endif - + + @if ($dataset->server_state == 'released') + {{ $dataset->server_date_modified }} + @endif + @if ($dataset->server_state == "released") diff --git a/resources/views/workflow/review/index.blade.php b/resources/views/workflow/review/index.blade.php index a844576..4027937 100644 --- a/resources/views/workflow/review/index.blade.php +++ b/resources/views/workflow/review/index.blade.php @@ -53,6 +53,10 @@ Review + + + Reject + @endif {{-- diff --git a/resources/views/workflow/review/reject.blade.php b/resources/views/workflow/review/reject.blade.php new file mode 100644 index 0000000..50eef3b --- /dev/null +++ b/resources/views/workflow/review/reject.blade.php @@ -0,0 +1,57 @@ +@extends('settings.layouts.app') +@section('content') +
+

+ Reject approved dataset +

+
+ +
+ +
+
+ + + BACK + +
+
+ + {!! Form::model($dataset, [ 'method' => 'POST', 'route' => ['publish.workflow.review.rejectUpdate', $dataset->id], 'id' => 'rejectForm', + 'class' => 'pure-form', 'enctype' => 'multipart/form-data', 'v-on:submit.prevent' => 'checkForm']) !!} +
+ General +
+ +
+ {!! Form::label('owner', 'reject note:') !!} + {!! Form::text('reject_reviewer_note', null, ['id' => 'reject_reviewer_note', 'class'=>'pure-u-23-24', + 'placeholder' => '-- reject note for editor --', + 'v-model' => 'dataset.reject_reviewer_note', "v-validate" => "'required|min:10|max:255'"]) !!} + * + + + +
+
+
+ +
+
+ {{-- --}} + ..to do: write code for setting state 'rejected_reviewer' in database +
+ + {!! Form::close() !!} +
+
+ +
+ +@stop + +@section('after-scripts') +@stop \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 51a7e65..5816a63 100644 --- a/routes/web.php +++ b/routes/web.php @@ -115,6 +115,14 @@ Route::group( 'middleware' => ['permission:dataset-review'], 'as' => 'workflow.review.reviewUpdate', 'uses' => 'ReviewController@reviewUpdate', ]); + Route::get('workflow/review/reject/{id}', [ + 'middleware' => ['permission:dataset-review-reject'], + 'as' => 'workflow.review.reject', 'uses' => 'ReviewController@reject', + ]); + Route::post('workflow/review/reject/{id}', [ + 'middleware' => ['permission:dataset-review-reject'], + 'as' => 'workflow.review.rejectUpdate', 'uses' => 'ReviewController@rejectUpdate', + ]); //publisher Route::get('workflow/publish/index', [