Commit 2f3a32bd authored by Maik Messerschmidt's avatar Maik Messerschmidt
Browse files

Added pagination of inputs and delete-route.

parent f4cfca3a
......@@ -17,7 +17,7 @@ class InputController extends Controller
*/
public function index()
{
return view('inputs.index', ["inputs" => Input::without('data')->get()]);
return view('inputs.index', ["inputs" => Input::without('data')->paginate(10)]);
}
/**
......@@ -105,8 +105,8 @@ class InputController extends Controller
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
public function destroy(Input $input) {
$input->delete();
return back();
}
}
@extends('layouts.app')
@section('content')
<table class="table">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">uid</th>
<th scope="col">uploaded on</th>
<th scope="col">listed</th>
<th scope="col">uses</th>
<th scope="col">max uses</th>
<th scope="col">listed</th>
<th scope="col">use count increments</th>
<th scope="col"><!-- actions column --></th>
</tr>
......@@ -18,9 +18,9 @@
<tr>
<td>{{ $input->id }}</td>
<td>{{ $input->created_at }}</td>
<td>{{ $input->listed ? "yes" : "no" }}</td>
<td>{{ $input->uses }}</td>
<td>{{ $input->max_uses ?? '∞'}}</td>
<td>{{ $input->listed ? "yes" : "no" }}</td>
<td>{{ $input->increments }}</td>
<td>
<a href="{{ route('inputs.show', $input) }}"
......@@ -28,9 +28,9 @@
<i class="fa fa-eye"></i>
</a>
<a href="_blank" class="confirm-delete" title="Remove these results"
<a href="_blank" class="confirm-delete" title="Remove this entry"
data-form-id="remove-form-{{$input->id}}"
data-message="Do you really want to delete this result?">
data-message="Do you really want to delete this input?">
<i class="fa fa-remove"></i>
</a>
......@@ -48,6 +48,10 @@
</tbody>
</table>
<div class="d-flex justify-content-center">
{{ $inputs->links() }}
</div>
<a href="{{ route('inputs.create')}}">Create a new entry</a>
@endsection
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