Commit 39d522b5 authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Added ability to reset the status of an experiment.

parent 5662ebff
......@@ -137,6 +137,16 @@ class ExperimentController extends Controller
//
}
/**
* Reset the status of an experiment to unused.
*/
public function reset(Experiment $experiment) {
$experiment->status = Experiment::STATUS_UNUSED;
$experiment->save();
return back();
}
/**
* Remove the specified resource from storage.
*
......
......@@ -18,11 +18,28 @@
<td>{{ $experiment->updated_at }}</td>
<td>
<a href="{{ route('experiments.show', $experiment) }}"
class="mx-1"
title="Show this input data">
<i class="fa fa-eye"></i>
</a>
<a href="_blank" title="Reset the status of this input to 'unused'"
class="mx-1"
onclick="event.preventDefault(); document.getElementById('reset-form-{{$experiment->id}}').submit();">
<i class="fa fa-refresh"></i>
</a>
{{ Form::open([
'url' => route('experiments.reset', $experiment),
'method' => 'post',
'style' => 'display: none',
'id' => "reset-form-{$experiment->id}"
]) }}
{{ Form::submit('send') }}
{{ Form::close() }}
<a href="_blank" title="Remove this input data"
class="mx-1"
onclick="event.preventDefault(); document.getElementById('remove-form-{{$experiment->id}}').submit();">
<i class="fa fa-remove"></i>
</a>
......
......@@ -18,6 +18,8 @@ Route::get('/home', 'HomeController@index')->name('home');
Route::middleware(['web', 'auth'])->group(function() {
Route::delete('/admin/experiments/delete-all', 'ExperimentController@destroyAll')
->name('experiments.destroyAll');
Route::post('/admin/experiments/reset/{experiment}', 'ExperimentController@reset')
->name('experiments.reset');
Route::resource('/admin/experiments', 'ExperimentController');
Route::get('/admin/results/show-json/{result}', 'ResultController@showJson')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment