Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ARC-Support
public projects
lou-server
Commits
39d522b5
Commit
39d522b5
authored
Aug 06, 2021
by
Maik Messerschmidt
Browse files
Added ability to reset the status of an experiment.
parent
5662ebff
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/ExperimentController.php
View file @
39d522b5
...
...
@@ -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.
*
...
...
resources/views/experiments/index.blade.php
View file @
39d522b5
...
...
@@ -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
>
...
...
routes/web.php
View file @
39d522b5
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment