publication workflow: review

This commit is contained in:
Arno Kaimbacher 2019-04-11 18:52:10 +02:00
parent 5df9b0beef
commit ad982a1ac5
26 changed files with 724 additions and 161 deletions

View file

@ -0,0 +1,137 @@
<fieldset id="fieldset-General">
<legend>General</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('type', 'Type..') !!}
<div class="select pure-u-23-24">
{!! Form::select('type', Lang::get('doctypes'), null, ['id' => 'type', 'placeholder' => '-- select type --']) !!}
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('server_state', 'Status..') !!}
{{-- {!! Form::select('server_state', Config::get('enums.server_states'), null, ['id' => 'server_state', 'placeholder' => '-- select server state --']) !!} --}}
{!! Form::text('server_state', null, ['class'=>'pure-u-23-24','readonly']) !!}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('project_id', 'Project..') !!}
<div class="select pure-u-23-24">
{!! Form::select('project_id', $projects, null, ['id' => 'project_id', 'placeholder' => '--no project--']) !!}
</div>
<small id="projectHelp" class="pure-form-message-inline">project is optional</small>
</div>
{{-- <div class="pure-control-group">
{!! Form::label('shelf_id', 'Shelf..') !!}
{!! Form::select('shelf_id', $shelves, null, ['id' => 'shelf_id']) !!}
</div> --}}
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('embargo_date', 'Embargo Date') !!}
{!! Form::date('embargo_date', null, ['placeholder' => date('y-m-d'), 'class' => 'pure-u-23-24']) !!}
<small id="projectHelp" class="pure-form-message-inline">embargo_date is optional</small>
</div>
</div>
</fieldset>
<fieldset id="fieldset-titles">
<legend>Title</legend>
<div class="pure-g">
@foreach($dataset->titles as $key => $title)
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('title', 'Title ' .($key+1).':') }}
<!-- Notice this is an array now: -->
{{ Form::text('titles['.$title->id.'][value]', $title->value, ['class' => 'pure-u-23-24']) }}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('language', 'Language..') }}
<div class="select pure-u-23-24">
{{ Form::select('titles['.$title->id.'][language]', $languages, $title->language, ['placeholder' => '--no language--']) }}
</div>
</div>
@endforeach
</div>
</fieldset>
<fieldset id="fieldset-abstracts">
<legend>Abstract</legend>
<div class="pure-g">
@foreach($dataset->abstracts as $key => $abstract)
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('abstract', 'Abstract ' .($key+1).':') }}
<!-- Notice this is an array now: -->
{{ Form::textarea('abstracts['.$abstract->id.'][value]', $abstract->value, ['class' => 'pure-u-23-24', 'size' => '70x6']) }}
</div>
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{{ Form::label('language', 'Language..') }}
<div class="select pure-u-23-24">
{{ Form::select('abstracts['.$abstract->id.'][language]', $languages, $abstract->language, ['placeholder' => '--no language--']) }}
</div>
</div>
@endforeach
</div>
</fieldset>
<fieldset id="fieldset-licenses">
<legend>Licenses</legend>
{{-- <div class="form-group">
{!! Form::label('licenses[]', 'Licenses..') !!}
{!! Form::select('licenses[]', $options, array_pluck($dataset->licenses, 'id'), ['multiple' ]) !!}
</div> --}}
<div class="pure-control-group checkboxlist">
@foreach ($options as $license)
<label for={{"license". $license->id }} class="pure-checkbox">
<input name="licenses[]" value={{ $license->id }} {{ (in_array($license->id, $checkeds)) ? 'checked=checked' : '' }} type="checkbox" class="form-check-input">
{{ $license->name_long }}
</label>
<!--{!! Form::checkbox('licenses[]', $license->id, in_array($license->id, $checkeds) ? true : false) !!}
{!! Form::label('license' . $license->id, $license->name_long) !!}-->
@endforeach
</div>
</fieldset>
<fieldset id="fieldset-abstracts">
<legend>Files</legend>
<table id="items" class="pure-table pure-table-horizontal">
<thead>
<tr>
<th>Path Name</th>
<th>Label</th>
</tr>
</thead>
<tbody>
@foreach($dataset->files as $key => $file)
<tr>
<td>
@if($file->exists() === true)
<a href="{{ route('settings.file.download', ['id' => $file->id]) }}"> {{ $file->path_name }} </a>
@else
<span class="alert">missing file: {{ $file->path_name }}</span>
@endif
</td>
<td> {{ $file->label }} </td>
</tr>
@endforeach
</tbody>
</table>
</fieldset>
<br />
<div class="pure-controls">
<button type="submit" class="pure-button button-small">
<i class="fa fa-save"></i>
<span>{!! $submitButtonText !!}</span>
</button>
</div>

View file

@ -0,0 +1,82 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
<i class="fa fa-share"></i> Accept released dataset
</h3>
</div>
<div class="header">
<h3 class="header-title">
Release your dataset for Editor
</h3>
</div>
<div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-1">
<div>
<a href="{{ route('publish.workflow.editor.index') }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i>
<span>BACK</span>
</a>
</div>
<div id="app1">
@php
// if ($dataset->editor->id == Auth::user()->id) {
// $userIsDesiredEditor = true;
// } else {
// $userIsDesiredEditor = false;
// $message = 'you are not the desired editor, but you can still accept the dataset';
// }
$message = 'If you are not the desired editor, you can still accept the dataset!!';
@endphp
{!! Form::model($dataset, [ 'method' => 'POST', 'route' => ['publish.workflow.acceptUpdate', $dataset->id], 'id' => 'acceptForm',
'class' => 'pure-form', 'enctype' => 'multipart/form-data', 'v-on:submit.prevent' => 'checkForm']) !!}
<fieldset id="fieldset-General">
<legend>General</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-1 pure-div">
{!! Form::label('editor_id', 'preferred editor:') !!}
{!! $dataset->preferred_editor !!}
<span class="help is-danger"> {!! $message !!}</span>
{{-- <span class="help is-danger" v-if="errors.has('editor_id')" v-text="errors.first('editor_id')"></span> --}}
</div>
<div class="pure-u-1 pure-u-md-1-1 pure-div">
{!! Form::label('owner', 'dataset owner:') !!}
{!! $dataset->user->login !!}
{{-- <span class="help is-danger" v-if="errors.has('editor_id')" v-text="errors.first('editor_id')"></span> --}}
</div>
<div class="pure-u-1 pure-u-md-1-1 pure-div">
{!! Form::label('title', 'dataset title:') !!}
@if ($dataset->titles()->first())
{{ $dataset->titles()->first()->value }}
@endif
</div>
</div>
</fieldset>
<br />
<div class="pure-controls">
<button type="submit" class="pure-button">
<i class="fa fa-share"></i>
<span>Accept</span>
</button>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@stop
@section('after-scripts')
@stop

View file

@ -0,0 +1,60 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
<i class="fa fa-share"></i> Approve corrected datasets
</h3>
</div>
<div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-1">
<div>
<a href="{{ route('publish.workflow.editor.index') }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i>
<span>BACK</span>
</a>
</div>
<div id="app1">
{!! Form::model($dataset, [ 'method' => 'POST', 'route' => ['publish.workflow.editor.approveUpdate', $dataset->id], 'id' => 'approveForm',
'class' => 'pure-form', 'enctype' => 'multipart/form-data', 'v-on:submit.prevent' => 'checkForm']) !!}
<fieldset id="fieldset-General">
<legend>General</legend>
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('reviewer_id', 'reviewer:') !!}
<div class="select pure-u-23-24">
{!! Form::select('reviewer_id', $reviewers, null, ['id' => 'reviewer_id', 'placeholder' => '-- select reviewer --', 'v-model' =>
'dataset.reviewer_id', "v-validate" => "'required'"]) !!}
</div>
<span class="help is-danger" v-if="errors.has('reviewer_id')" v-text="errors.first('reviewer_id')"></span>
</div>
</div>
</fieldset>
<br />
<div class="pure-controls">
<button :disabled="errors.any()" type="submit" class="pure-button">
<i class="fa fa-share"></i>
<span>Approve</span>
</button>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@stop
@section('after-scripts') {{--
<script type="text/javascript" src="{{ asset('js/lib.js') }}"></script> --}} {{--
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>--}} {{--
<script type="text/javascript" src="{{ resource_path('assets\js\datasetPublish.js') }}"></script> --}}
<script type="text/javascript" src="{{ asset('backend/publish/approveDataset.js') }}"></script>
@stop

View file

@ -0,0 +1,28 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
<span>Correct Dataset</span>
</h3>
</div>
<div class="pure-g box-content">
<div class="pure-u-1 pure-u-md-3-3">
<div>
<a href="{{ route('publish.workflow.editor.index') }}" class="pure-button button-small">
<i class="fa fa-chevron-left"></i>
<span>BACK</span>
</a>
</div>
<div>
{!! Form::model($dataset, ['method' => 'POST', 'route' => ['publish.workflow.editor.update', $dataset->id], 'class' => 'pure-form', 'enctype' => 'multipart/form-data' ]) !!}
@include('workflow/editor/_form', ['submitButtonText' => 'Edit Dataset', 'bookLabel' => 'Edit Dataset.'])
@include('errors._errors')
{!! Form::close() !!}
</div>
</div>
</div>
@stop

View file

@ -0,0 +1,83 @@
@extends('settings.layouts.app')
@section('content')
<div class="header">
<h3 class="header-title">
<i class="fa fa-file"></i> EDITOR PAGE: Approve released datasets
</h3>
</div>
<div class="pure-g box-content">
<div class="pure-u-1">
<table class="pure-table pure-table-horizontal">
<thead>
<th>Dataset Title</th>
<th>ID</th>
<th>Server State</th>
<th>Editor</th>
<th></th>
</thead>
<tbody>
@foreach($datasets as $dataset)
@php
//if userid changed from last iteration, store new userid and change color
// $lastid = $detail->payment->userid;
if ($dataset->server_state == 'editor_accepted') {
$rowclass = 'editor_accepted';
} elseif ($dataset->server_state == 'released') {
$rowclass = 'released';
}
@endphp
<tr class="{{ $rowclass }}">
<td>
@if ($dataset->titles()->first())
{{ $dataset->titles()->first()->value }}
@else
no title
@endif
</td>
<td>
{{ $dataset->id }}
</td>
<td>
{{ $dataset->server_state }}
</td>
@if ($dataset->server_state == "released")
{{-- <td>Preferred editor: {{ optional($dataset->editor)->login }} </td> --}}
<td>Preferred editor: {{ $dataset->preferred_editor }} </td>
@elseif ($dataset->server_state == "editor_accepted")
<td>in approvement by {{ optional($dataset->editor)->login }} </td>
@endif
<td>
@if ($dataset->server_state == "released")
<a href="{{ URL::route('publish.workflow.accept', $dataset->id) }}" class="pure-button">
<i class="fa fa-check"></i>
<span>Accept editor task</span>
</a>
@elseif ($dataset->server_state == "editor_accepted")
<a href="{{ URL::route('publish.workflow.editor.edit', $dataset->id) }}" class="pure-button">
<i class="fa fa-edit"></i>
<span>Improve/Edit</span>
</a>
<a href="{{ URL::route('publish.workflow.editor.approve', $dataset->id) }}" class="pure-button">
<i class="fa fa-share"></i>
<span>Approve</span>
</a>
@endif
</td>
{{-- <td>
@if ($dataset->server_state == "unpublished")
<a href="{{ URL::route('publish.review.changestate',['id' => $dataset->id, 'targetState' => 'published']) }}" class="pure-button button-small is-success">Publish</a>
@endif
</td> --}}
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@stop