Initial Commit
The initial public commit of MVGL website code.
This commit is contained in:
commit
b39ecf1638
2043 changed files with 215154 additions and 0 deletions
56
resources/views/pages/admin/games/index.blade.php
Normal file
56
resources/views/pages/admin/games/index.blade.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
@php
|
||||
use App\Models\Game;
|
||||
use App\Models\Platform;
|
||||
@endphp
|
||||
|
||||
{{-- Check to see if the user is logged in. --}}
|
||||
@if (Auth::check())
|
||||
{{-- Check role of user. --}}
|
||||
@if (
|
||||
Auth::user()->role_id != 1 &&
|
||||
Auth::user()->role_id != 2 &&
|
||||
Auth::user()->role_id != 3
|
||||
)
|
||||
{{-- Redirect to home page. --}}
|
||||
<script>window.location = "/";</script>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<x-base-layout>
|
||||
<!--begin::Row-->
|
||||
<div class="row gy-5 g-xl-8">
|
||||
<!--begin::Col-->
|
||||
<div class="col-xxl-8">
|
||||
<div class="card shadow-sm mb-2">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Games</h3>
|
||||
<div class="card-toolbar">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="admSearch" id="admSearch" placeholder="Game ID" aria-label="" aria-describedby="">
|
||||
<button class="input-group-text fw-light" id="searchBtn">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('searchBtn').onclick = function() {
|
||||
var gameId = document.getElementById("admSearch").value;
|
||||
location.href = "/admin/game/" + gameId + "/edit";
|
||||
};
|
||||
</script>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@php
|
||||
$games = Game::take(100)->orderBy('id', 'desc')->get();
|
||||
@endphp
|
||||
|
||||
<ul>
|
||||
@foreach ($games as $game)
|
||||
<li><a href="{{ route('admin.game.edit', $game->id) }}">{{ $game->id }} - {{ $game->name }} ({{ $game->platform()->get()[0]->name }})</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end::Col-->
|
||||
</div>
|
||||
<!--end::Row-->
|
||||
</x-base-layout>
|
Loading…
Add table
Add a link
Reference in a new issue