workflow controller
This commit is contained in:
parent
6068889e68
commit
7c6654398d
|
@ -6,6 +6,7 @@ use App\Models\Dataset;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\License;
|
use App\Models\License;
|
||||||
use App\Models\Title;
|
use App\Models\Title;
|
||||||
|
use App\Models\Description;
|
||||||
use App\Http\Requests\DocumentRequest;
|
use App\Http\Requests\DocumentRequest;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
@ -26,7 +27,7 @@ class DatasetController extends Controller
|
||||||
$builder = Dataset::query();
|
$builder = Dataset::query();
|
||||||
//$registers = array();
|
//$registers = array();
|
||||||
|
|
||||||
$filter = $request->input('search');
|
$filter = $request->input('filter');
|
||||||
|
|
||||||
if (null !== ($request->input('state'))) {
|
if (null !== ($request->input('state'))) {
|
||||||
$state = $request->input('state');
|
$state = $request->input('state');
|
||||||
|
@ -52,7 +53,7 @@ class DatasetController extends Controller
|
||||||
//$perPage = $request->get('perPage', 20);
|
//$perPage = $request->get('perPage', 20);
|
||||||
$documents = $builder
|
$documents = $builder
|
||||||
->paginate(8);
|
->paginate(8);
|
||||||
return view('settings.document.document', compact('documents'));
|
return view('settings.document.document', compact('documents', 'state', 'filter'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,7 +181,7 @@ class DatasetController extends Controller
|
||||||
$abstracts = $request->input('abstracts');
|
$abstracts = $request->input('abstracts');
|
||||||
if (is_array($abstracts) && count($abstracts) > 0) {
|
if (is_array($abstracts) && count($abstracts) > 0) {
|
||||||
foreach ($abstracts as $key => $formAbstract) {
|
foreach ($abstracts as $key => $formAbstract) {
|
||||||
$abstract = Title::findOrFail($key);
|
$abstract = Description::findOrFail($key);
|
||||||
$abstract->value = $formAbstract['value'];
|
$abstract->value = $formAbstract['value'];
|
||||||
$abstract->language = $formAbstract['language'];
|
$abstract->language = $formAbstract['language'];
|
||||||
$abstract->save();
|
$abstract->save();
|
||||||
|
|
60
app/Http/Controllers/Settings/WorkflowController.php
Normal file
60
app/Http/Controllers/Settings/WorkflowController.php
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
namespace App\Http\Controllers\Settings;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
// use App\Http\Requests\ProjectRequest;
|
||||||
|
// use App\Models\Project;
|
||||||
|
// use Illuminate\Http\RedirectResponse;
|
||||||
|
// use Illuminate\Http\Request;
|
||||||
|
use App\Models\Dataset;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
|
class WorkflowController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$builder = Dataset::query();
|
||||||
|
$datasets = $builder
|
||||||
|
//->where('server_state', 'inprogress')
|
||||||
|
->whereIn('server_state', ['unpublished'])
|
||||||
|
->get();
|
||||||
|
return view('workflow.index', compact('datasets'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function changestate($id, $targetState)
|
||||||
|
{
|
||||||
|
// $docId = $this->getRequest()->getParam('docId');
|
||||||
|
// $targetState = $this->getRequest()->getParam('targetState');
|
||||||
|
|
||||||
|
//$document = $this->_documentsHelper->getDocumentForId($docId);
|
||||||
|
$dataset = Dataset::findOrFail($id);
|
||||||
|
|
||||||
|
// Check if valid target state
|
||||||
|
// if (!$this->_workflowHelper->isValidState($targetState)) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
try {
|
||||||
|
//$this->_workflowHelper->changeState($document, $targetState);
|
||||||
|
$dataset->setServerState($targetState);
|
||||||
|
|
||||||
|
// if ($targetState == 'published') {
|
||||||
|
// $this->_sendNotification($document, $form);
|
||||||
|
// }
|
||||||
|
$dataset->save();
|
||||||
|
session()->flash('flash_message', 'You have puplished 1 dataset!');
|
||||||
|
return redirect()->route('settings.review.index');
|
||||||
|
} catch (Exception $e) {
|
||||||
|
//return $this->_redirectTo('index', array('failure' => $e->getMessage()), 'documents', 'admin');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ class RedirectIfAuthenticated
|
||||||
public function handle($request, Closure $next, $guard = null)
|
public function handle($request, Closure $next, $guard = null)
|
||||||
{
|
{
|
||||||
if (Auth::guard($guard)->check()) {
|
if (Auth::guard($guard)->check()) {
|
||||||
return redirect('/');
|
return redirect('/home');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
7
app/Library/Util/SolrIndexIndexer.php
Normal file
7
app/Library/Util/SolrIndexIndexer.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
namespace App\Library\Util;
|
||||||
|
|
||||||
|
class SolrIndexIndexer
|
||||||
|
{
|
||||||
|
protected $data;
|
||||||
|
}
|
|
@ -165,7 +165,7 @@ trait DatasetExtension
|
||||||
* @param string $name Name of the requested field.
|
* @param string $name Name of the requested field.
|
||||||
* @return Field The requested field instance. If no such instance can be found, null is returned.
|
* @return Field The requested field instance. If no such instance can be found, null is returned.
|
||||||
*/
|
*/
|
||||||
protected function getField($name)
|
public function getField($name)
|
||||||
{
|
{
|
||||||
if (isset($this->fields[$name])) {
|
if (isset($this->fields[$name])) {
|
||||||
return $this->fields[$name];
|
return $this->fields[$name];
|
||||||
|
|
|
@ -213,6 +213,12 @@ class Dataset extends Model
|
||||||
->server_date_published;
|
->server_date_published;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setServerState($targetType)
|
||||||
|
{
|
||||||
|
$this->attributes['server_state'] = $targetType;
|
||||||
|
//$this->server_state = $targetType;
|
||||||
|
}
|
||||||
|
|
||||||
public function hasProject()
|
public function hasProject()
|
||||||
{
|
{
|
||||||
return $this->project()->exists();
|
return $this->project()->exists();
|
||||||
|
|
90
app/Observers/DatasetObserver.php
Normal file
90
app/Observers/DatasetObserver.php
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Observers;
|
||||||
|
|
||||||
|
//php artisan make:observer DatasetObserver --model=Models\Dataset
|
||||||
|
use App\Models\Dataset;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
|
class DatasetObserver
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle the dataset "created" event.
|
||||||
|
*
|
||||||
|
* @param \App\Models\Dataset $dataset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function created(Dataset $dataset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the dataset "updated" event.
|
||||||
|
*
|
||||||
|
* @param \App\Models\Dataset $dataset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function updated(Dataset $dataset)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// only index Opus_Document instances
|
||||||
|
if (false === ($dataset instanceof Dataset)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// if ($dataset->getServerState() !== 'published') {
|
||||||
|
// if ($model->getServerState() !== 'temporary') {
|
||||||
|
// $this->removeDocumentFromIndexById($model->getId());
|
||||||
|
// }
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
$this->addDatasetToIndex($dataset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the dataset "deleted" event.
|
||||||
|
*
|
||||||
|
* @param \App\Models\Dataset $dataset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function deleted(Dataset $dataset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the dataset "restored" event.
|
||||||
|
*
|
||||||
|
* @param \App\Models\Dataset $dataset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function restored(Dataset $dataset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the dataset "force deleted" event.
|
||||||
|
*
|
||||||
|
* @param \App\Models\Dataset $dataset
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function forceDeleted(Dataset $dataset)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to add dataset to index.
|
||||||
|
*
|
||||||
|
* @param Opus_Document $document
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function addDatasetToIndex(Dataset $dataset)
|
||||||
|
{
|
||||||
|
$datasetId = $dataset->id;
|
||||||
|
Log::debug(__METHOD__ . ': ' . 'Adding index job for document ' . $datasetId . '.');
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use App\Models\Dataset;
|
||||||
|
use App\Observers\DatasetObserver;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
@ -12,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
//
|
Dataset::observe(DatasetObserver::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,9 +28,9 @@ class AppServiceProvider extends ServiceProvider
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
// $this->app->bind(
|
||||||
'Illuminate\Contracts\Auth\Registrar'
|
// 'Illuminate\Contracts\Auth\Registrar'
|
||||||
// 'App\Services\Registrar'
|
// // 'App\Services\Registrar'
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
30
app/Providers/AuthServiceProvider.php
Normal file
30
app/Providers/AuthServiceProvider.php
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Gate;
|
||||||
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
|
class AuthServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The policy mappings for the application.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $policies = [
|
||||||
|
'App\Model' => 'App\Policies\ModelPolicy',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register any authentication / authorization services.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
$this->registerPolicies();
|
||||||
|
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,7 +69,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||||
protected function mapApiRoutes()
|
protected function mapApiRoutes()
|
||||||
{
|
{
|
||||||
Route::middleware('api')
|
Route::middleware('api')
|
||||||
->namespace($this->namespace)
|
->namespace($this->namespace)
|
||||||
->group(base_path('routes/api.php'));
|
->group(base_path('routes/api.php'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0.0",
|
"php": "^7.1.3",
|
||||||
"davejamesmiller/laravel-breadcrumbs": "4.x",
|
"davejamesmiller/laravel-breadcrumbs": "5.x",
|
||||||
"dimsav/laravel-translatable": "8.*",
|
"dimsav/laravel-translatable": "9.*",
|
||||||
"felixkiss/uniquewith-validator": "^3.1",
|
"felixkiss/uniquewith-validator": "^3.1",
|
||||||
"fideloper/proxy": "~3.3",
|
"fideloper/proxy": "^4.0",
|
||||||
"hieu-le/active": "^3.5",
|
"hieu-le/active": "^3.5",
|
||||||
"laravel/framework": "5.5.*",
|
"laravel/framework": "5.6.*",
|
||||||
"laravel/tinker": "~1.0",
|
"laravel/tinker": "^1.0",
|
||||||
"laravelcollective/html": "^5.5.0",
|
"laravelcollective/html": "^5.6",
|
||||||
"mcamara/laravel-localization": "^1.3",
|
"mcamara/laravel-localization": "^1.3",
|
||||||
"solarium/solarium": "^3.8",
|
"solarium/solarium": "^3.8",
|
||||||
"yajra/laravel-datatables-oracle": "^8.8",
|
"yajra/laravel-datatables-oracle": "^8.8",
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fzaninotto/faker": "^1.8",
|
"fzaninotto/faker": "^1.8",
|
||||||
"phpunit/phpunit": "~6.0",
|
"phpunit/phpunit": "^7.0",
|
||||||
"squizlabs/php_codesniffer": "^3.3"
|
"squizlabs/php_codesniffer": "^3.3"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
838
composer.lock
generated
838
composer.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -122,6 +122,7 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'log' => 'single',
|
'log' => 'single',
|
||||||
|
//debug, info, notice, warning, error, critical, alert, emergency.
|
||||||
'log_level' => env('APP_LOG_LEVEL', 'debug'),
|
'log_level' => env('APP_LOG_LEVEL', 'debug'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -176,6 +177,7 @@ return [
|
||||||
* Application Service Providers...
|
* Application Service Providers...
|
||||||
*/
|
*/
|
||||||
'App\Providers\AppServiceProvider',
|
'App\Providers\AppServiceProvider',
|
||||||
|
App\Providers\AuthServiceProvider::class,
|
||||||
// App\Providers\BroadcastServiceProvider::class,
|
// App\Providers\BroadcastServiceProvider::class,
|
||||||
'App\Providers\ConfigServiceProvider',
|
'App\Providers\ConfigServiceProvider',
|
||||||
'App\Providers\EventServiceProvider',
|
'App\Providers\EventServiceProvider',
|
||||||
|
@ -203,6 +205,7 @@ return [
|
||||||
'Artisan' => 'Illuminate\Support\Facades\Artisan',
|
'Artisan' => 'Illuminate\Support\Facades\Artisan',
|
||||||
'Auth' => 'Illuminate\Support\Facades\Auth',
|
'Auth' => 'Illuminate\Support\Facades\Auth',
|
||||||
'Blade' => 'Illuminate\Support\Facades\Blade',
|
'Blade' => 'Illuminate\Support\Facades\Blade',
|
||||||
|
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
|
||||||
'Bus' => 'Illuminate\Support\Facades\Bus',
|
'Bus' => 'Illuminate\Support\Facades\Bus',
|
||||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||||
'Config' => 'Illuminate\Support\Facades\Config',
|
'Config' => 'Illuminate\Support\Facades\Config',
|
||||||
|
@ -212,12 +215,14 @@ return [
|
||||||
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
|
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
|
||||||
'Event' => 'Illuminate\Support\Facades\Event',
|
'Event' => 'Illuminate\Support\Facades\Event',
|
||||||
'File' => 'Illuminate\Support\Facades\File',
|
'File' => 'Illuminate\Support\Facades\File',
|
||||||
|
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||||
'Hash' => 'Illuminate\Support\Facades\Hash',
|
'Hash' => 'Illuminate\Support\Facades\Hash',
|
||||||
'Input' => 'Illuminate\Support\Facades\Input',
|
'Input' => 'Illuminate\Support\Facades\Input',
|
||||||
'Inspiring' => 'Illuminate\Foundation\Inspiring',
|
// 'Inspiring' => 'Illuminate\Foundation\Inspiring',
|
||||||
'Lang' => 'Illuminate\Support\Facades\Lang',
|
'Lang' => 'Illuminate\Support\Facades\Lang',
|
||||||
'Log' => 'Illuminate\Support\Facades\Log',
|
'Log' => 'Illuminate\Support\Facades\Log',
|
||||||
'Mail' => 'Illuminate\Support\Facades\Mail',
|
'Mail' => 'Illuminate\Support\Facades\Mail',
|
||||||
|
'Notification' => Illuminate\Support\Facades\Notification::class,
|
||||||
'Password' => 'Illuminate\Support\Facades\Password',
|
'Password' => 'Illuminate\Support\Facades\Password',
|
||||||
'Queue' => 'Illuminate\Support\Facades\Queue',
|
'Queue' => 'Illuminate\Support\Facades\Queue',
|
||||||
'Redirect' => 'Illuminate\Support\Facades\Redirect',
|
'Redirect' => 'Illuminate\Support\Facades\Redirect',
|
||||||
|
|
|
@ -26,8 +26,13 @@
|
||||||
</rewrite>
|
</rewrite>
|
||||||
<defaultDocument>
|
<defaultDocument>
|
||||||
<files>
|
<files>
|
||||||
<remove value="index.php" />
|
<clear />
|
||||||
<add value="index.php" />
|
<add value="index.php" />
|
||||||
|
<add value="Default.htm" />
|
||||||
|
<add value="Default.asp" />
|
||||||
|
<add value="index.htm" />
|
||||||
|
<add value="index.html" />
|
||||||
|
<add value="iisstart.htm" />
|
||||||
</files>
|
</files>
|
||||||
</defaultDocument>
|
</defaultDocument>
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
<div class="sidebar-simplesearch pure-u-1">
|
<div class="sidebar-simplesearch pure-u-1">
|
||||||
{!! Form::open(array('route' => 'settings.document','method' => 'GET', 'class'=>'pure-form')) !!}
|
{!! Form::open(array('route' => 'settings.document','method' => 'GET', 'class'=>'pure-form')) !!}
|
||||||
<p>
|
<p>
|
||||||
{!! Form::text('search', null, array('class'=>'pure-u-1 pure-u-md-1-2', 'placeholder'=>'filter for the title...')) !!}
|
{!! Form::text('filter', (isset($filter)) ? $filter : '', array('class'=>'pure-u-1 pure-u-md-1-2', 'placeholder'=>'filter for the title...')) !!}
|
||||||
|
|
||||||
<div class="select pure-u-1 pure-u-md-1-2">
|
<div class="select pure-u-1 pure-u-md-1-2">
|
||||||
{!! Form::select('state', Config::get('enums.server_states'), 'published', ['class' => 'pure-u-1', 'onchange' => "this.form.submit()"]) !!}
|
{!! Form::select('state', Config::get('enums.server_states'), (isset($state)) ? $state : 'published', ['class' => 'pure-u-1', 'onchange' => "this.form.submit()"]) !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pure-u-1 pure-u-md-1-2">
|
<div class="pure-u-1 pure-u-md-1-2">
|
||||||
|
|
|
@ -95,8 +95,8 @@
|
||||||
<li class="pure-menu-item {{ Route::is('publish.dataset.create') ? 'active' : '' }}">
|
<li class="pure-menu-item {{ Route::is('publish.dataset.create') ? 'active' : '' }}">
|
||||||
<a class="pure-menu-link" href="{{ URL::route('publish.dataset.create') }}"><i class="fa fa-upload"></i> Create</a>
|
<a class="pure-menu-link" href="{{ URL::route('publish.dataset.create') }}"><i class="fa fa-upload"></i> Create</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="pure-menu-item {{ Route::is('publish.dataset.index') ? 'active' : '' }}">
|
<li class="pure-menu-item {{ Route::is('settings.review') ? 'active' : '' }}">
|
||||||
<a class="pure-menu-link" href="{{ URL::route('publish.dataset.index') }}"><i class="fa fa-upload"></i> Publish created datasets</a>
|
<a class="pure-menu-link" href="{{ URL::route('settings.review.index') }}"><i class="fa fa-upload"></i> Release unpublished datasets</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
50
resources/views/workflow/index.blade.php
Normal file
50
resources/views/workflow/index.blade.php
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
@extends('settings.layouts.app')
|
||||||
|
@section('content')
|
||||||
|
<div class="header">
|
||||||
|
<h3 class="header-title">
|
||||||
|
<i class="fa fa-file"></i> Datasets to be processed
|
||||||
|
</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>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach($datasets as $dataset)
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
@if ($dataset->titles()->first())
|
||||||
|
{{ $dataset->titles()->first()->value }}
|
||||||
|
@else
|
||||||
|
no title
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $dataset->id }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $dataset->server_state }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@if ($dataset->server_state == "unpublished")
|
||||||
|
<a href="{{ URL::route('settings.review.changestate',['id' => $dataset->id, 'targetState' => 'published']) }}" class="pure-button button-small is-success">Publish</a>
|
||||||
|
{{-- <a href="" class="pure-button button-small is-success">Restrict</a> --}}
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@stop
|
|
@ -119,6 +119,13 @@ Route::group(
|
||||||
]);
|
]);
|
||||||
// //For DataTables
|
// //For DataTables
|
||||||
Route::get('pages/get', ['uses' => 'PagesTableController@get'])->name('page.get');
|
Route::get('pages/get', ['uses' => 'PagesTableController@get'])->name('page.get');
|
||||||
|
|
||||||
|
Route::get('review', [
|
||||||
|
'as' => 'review.index', 'uses' => 'WorkflowController@index',
|
||||||
|
]);
|
||||||
|
Route::get('review/changestate/{id}/changestate/{targetState}', [
|
||||||
|
'as' => 'review.changestate', 'uses' => 'WorkflowController@changestate',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user