Add highscores, faq and credits
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\ShitUser;
|
use App\Models\ShitUser;
|
||||||
|
use App\Models\User;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use DB;
|
use DB;
|
||||||
@@ -46,7 +47,12 @@ class ShitController extends Controller
|
|||||||
public function highscores() {
|
public function highscores() {
|
||||||
|
|
||||||
$allshits = ShitUser::groupBy('user_id')->select('user_id', DB::raw('count (*) as total'))->get();
|
$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,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
22
shit-show/resources/views/credits.blade.php
Normal file
22
shit-show/resources/views/credits.blade.php
Normal 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>
|
22
shit-show/resources/views/faq.blade.php
Normal file
22
shit-show/resources/views/faq.blade.php
Normal 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>
|
@@ -9,30 +9,17 @@
|
|||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">#</th>
|
<th scope="col">Person</th>
|
||||||
<th scope="col">First</th>
|
<th scope="col">Anzahl Stuhlgänge</th>
|
||||||
<th scope="col">Last</th>
|
|
||||||
<th scope="col">Handle</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@foreach($users as $user)
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">1</th>
|
<th scope="row">{{ $user->name }}</th>
|
||||||
<td>Mark</td>
|
<td>{{ $allshits->where('user_id', $user->id)->first()->total }} </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>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@@ -15,10 +15,13 @@
|
|||||||
|
|
||||||
<!-- Scripts -->
|
<!-- Scripts -->
|
||||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@include('layouts.navigation')
|
||||||
<div class="font-sans text-gray-900 antialiased">
|
<div class="font-sans text-gray-900 antialiased">
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</div>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -6,13 +6,10 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
|
<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="/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="/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">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>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,10 +7,9 @@
|
|||||||
|
|
||||||
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
|
<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-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">Preise</a></li>
|
||||||
<li><a href="/" class="nav-link px-2 text-white">FAQ</a></li>
|
<li><a href="/faq" 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="/credits" class="nav-link px-2 text-white">Credits</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -27,4 +27,13 @@ Route::post('/increment', [ShitController::class, 'increment'])->middleware(['au
|
|||||||
Route::get('/ownstats', [ShitController::class, 'ownStats'])->middleware(['auth']);
|
Route::get('/ownstats', [ShitController::class, 'ownStats'])->middleware(['auth']);
|
||||||
Route::get('/highscores', [ShitController::class, 'highscores'])->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';
|
require __DIR__.'/auth.php';
|
||||||
|
Reference in New Issue
Block a user