-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Init Commit * Pair programming Co-authored-by: PhilPinsdorf * Added Random Generator Frontend * Removed Scaleup Animation because it is not used * Fix darkmode * lint code * Fixed Font * Add scoresystem * Fixed AvatarCard * Fixed Transition Component * Fixed single-file component element order * Added Name for Display Route * Set new Location for AvatarCard * Fixed isFetchingRandomGenerator * Fixed Naming * Fixed Transiotin, Audio and added Riser * Adjust display of name * Regenerate components file * Lint code and fix typo --------- Co-authored-by: Phil Pinsdorf <[email protected]>
- Loading branch information
1 parent
9e03851
commit c22520c
Showing
15 changed files
with
406 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
app/Http/Controllers/DashboardAdminScoreSystemController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\State; | ||
use Illuminate\Http\JsonResponse; | ||
use Illuminate\Support\Facades\Request; | ||
use Inertia\Inertia; | ||
use Inertia\Response; | ||
|
||
class DashboardAdminScoreSystemController extends Controller | ||
{ | ||
/** | ||
* Display the dashboard admin score system page | ||
*/ | ||
public function index(): Response | ||
{ | ||
// check if a state exists or we need to create a new one | ||
$state = State::where('key', 'scoreSystem')->first(); | ||
if (! $state) { | ||
$state = new State(); | ||
$state->key = 'scoreSystem'; | ||
} | ||
|
||
return Inertia::render('Dashboard/Admin/ScoreSystem/Index', [ | ||
'state' => json_decode($state->value), | ||
]); | ||
} | ||
|
||
/** | ||
* Execute the dashboard admin score system submit action | ||
*/ | ||
public function indexExecuteSubmit(): JsonResponse | ||
{ | ||
// validate the request | ||
$request = Request::validate([ | ||
'teams.*.name' => ['required', 'string'], | ||
'teams.*.score' => ['required', 'string'], | ||
]); | ||
|
||
// check if a state exists or we need to create a new one | ||
$state = State::where('key', 'scoreSystem')->first(); | ||
if (! $state) { | ||
$state = new State(); | ||
$state->key = 'scoreSystem'; | ||
} | ||
|
||
// update the state | ||
$state->value = json_encode([ | ||
'teams' => $request['teams'], | ||
]); | ||
|
||
// save the state | ||
$state->save(); | ||
|
||
// return success | ||
return response()->json([ | ||
'success' => true, | ||
]); | ||
} | ||
|
||
/* | ||
* Display the dashboard admin score system display page | ||
*/ | ||
public function display(): Response | ||
{ | ||
return Inertia::render('Dashboard/Admin/ScoreSystem/Display'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<div | ||
class="flex h-screen flex-col overflow-hidden bg-slate-950 bg-[url('/images/random-generator/background/comic-yellow.jpg')] bg-cover" | ||
> | ||
<div class="flex-grow"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.