Add highscores, faq and credits

This commit is contained in:
2021-12-26 18:05:58 +01:00
parent 7629e8bfce
commit 3b61a5d7a8
8 changed files with 72 additions and 27 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\ShitUser;
use App\Models\User;
use Auth;
use Carbon\Carbon;
use DB;
@@ -46,7 +47,12 @@ class ShitController extends Controller
public function highscores() {
$allshits = ShitUser::groupBy('user_id')->select('user_id', DB::raw('count (*) as total'))->get();
dd($allshits);
$users = User::all()->sortBy('name');
return view('highscores')->with([
'allshits' => $allshits,
'users' => $users,
]);
}
}

View File

@@ -0,0 +1,22 @@
<x-guest-layout>
<!--<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{-- __('Dashboard') --}}
</h2>
</x-slot>-->
<div class="p-5 mb-4 bg-light rounded-3">
<div class="h-100 p-5 bg-light border rounded-3">
<h2>Danksagung</h2>
<p>Einen riesen Dank für Ideen und Anregungen geht an die Rüsselbande.</p>
</div>
<br>
<div class="h-100 p-5 bg-light border rounded-3">
<h2>Sourcecode:</h2>
<p>Link zum <a href="https://git.schoffit.net/structix/shit-show">Git-Repository</a></p>
</div>
</div>
</x-guest-layout>

View File

@@ -0,0 +1,22 @@
<x-guest-layout>
<!--<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{-- __('Dashboard') --}}
</h2>
</x-slot>-->
<div class="p-5 mb-4 bg-light rounded-3">
<div class="h-100 p-5 bg-light border rounded-3">
<h2>Frage: Was ist ein goldener Schiss?</h2>
<p>Ein goldener Schiss ist auch unter Phantom-Schiss bekannt. Drei goldene Schisse hintereinander ergeben einen Platin-Schiss.</p>
</div>
<br>
<div class="h-100 p-5 bg-light border rounded-3">
<h2>Frage: Mein Schiss wird nicht gewertet, was kann ich tun?</h2>
<p>Um Flüchtigkeitsfehler vorzubeugen, kann ein weiterer Schiss erst nach 10 Minuten eingetragen werden. Bei akutem Durchfall muss dann leider auf eine Strichliste zurück gegriffen werden.</p>
</div>
</div>
</x-guest-layout>

View File

@@ -9,30 +9,17 @@
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
<th scope="col">Person</th>
<th scope="col">Anzahl Stuhlgänge</th>
</tr>
</thead>
<tbody>
@foreach($users as $user)
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
<th scope="row">{{ $user->name }}</th>
<td>{{ $allshits->where('user_id', $user->id)->first()->total }} </td>
</tr>
@endforeach
</tbody>
</table>

View File

@@ -15,10 +15,13 @@
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
</head>
<body>
@include('layouts.navigation')
<div class="font-sans text-gray-900 antialiased">
{{ $slot }}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -6,13 +6,10 @@
</a>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="/" class="nav-link px-2 text-secondary">Shit-Show</a></li>
<li><a href="/dashboard" class="nav-link px-2 text-white">Dashboard</a></li>
<li><a href="/ownstats" class="nav-link px-2 text-white">Eigene Statistik</a></li>
<li><a href="/" class="nav-link px-2 text-white">Highscores</a></li>
<li><a href="/highscores" class="nav-link px-2 text-white">Highscores</a></li>
<li><a href="/" class="nav-link px-2 text-white">Preise</a></li>
<li><a href="/" class="nav-link px-2 text-white">FAQ</a></li>
<li><a href="/" class="nav-link px-2 text-white">Credits</a></li>
</ul>

View File

@@ -7,10 +7,9 @@
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="/" class="nav-link px-2 text-secondary">Shit-Show</a></li>
<li><a href="/" class="nav-link px-2 text-white">Highscores</a></li>
<li><a href="/" class="nav-link px-2 text-white">Preise</a></li>
<li><a href="/" class="nav-link px-2 text-white">FAQ</a></li>
<li><a href="/" class="nav-link px-2 text-white">Credits</a></li>
<li><a href="/faq" class="nav-link px-2 text-white">FAQ</a></li>
<li><a href="/credits" class="nav-link px-2 text-white">Credits</a></li>
</ul>

View File

@@ -27,4 +27,13 @@ Route::post('/increment', [ShitController::class, 'increment'])->middleware(['au
Route::get('/ownstats', [ShitController::class, 'ownStats'])->middleware(['auth']);
Route::get('/highscores', [ShitController::class, 'highscores'])->middleware(['auth']);
Route::get('/faq', function () {
return view('faq');
});
Route::get('/credits', function () {
return view('credits');
});
require __DIR__.'/auth.php';