I rightly do not know what this all is
This commit is contained in:
parent
af6b2b752e
commit
287c1f67c5
78 changed files with 3484 additions and 3365 deletions
|
@ -1,35 +1,35 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Entities\Account\User;
|
||||
|
||||
/** @var User|null $activeUser */
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($activeUser !== null): ?>
|
||||
<div class="d-flex avatar justify-content-center">
|
||||
|
||||
<div class="avatar-icon h-100 position-relative me-2 ratio-1">
|
||||
<img src="<?= $activeUser->getProfilePictureUrl(); ?>" class="rounded-circle h-100" alt="User Profile Picture" />
|
||||
<div class="position-absolute bottom-0 end-0 ratio-1 d-flex align-items-center z-1 avatar-login-method">
|
||||
<i class="fa-brands <?= $activeUser->getLoginMethod()->getIconClass() ?>"></i>
|
||||
<span class="position-absolute w-100 h-100 bottom-0 end-0 ratio-1 bg-body rounded-circle z-n1 avatar-login-method-icon"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column">
|
||||
<span class="me-2 h-3">
|
||||
<?= $activeUser->getName() ?>
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
<?= $activeUser->getPermission()->getHumanReadableName() ?>
|
||||
</small>
|
||||
</div>
|
||||
<div class="h-100 d-flex align-items-center ms-2">
|
||||
<a href="/logout">
|
||||
<i class="fa-solid fa-arrow-right-to-bracket fa-xl text-danger"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Entities\Account\User;
|
||||
|
||||
/** @var User|null $activeUser */
|
||||
|
||||
?>
|
||||
|
||||
<?php if ($activeUser !== null): ?>
|
||||
<div class="d-flex avatar justify-content-center">
|
||||
|
||||
<div class="avatar-icon h-100 position-relative me-2 ratio-1">
|
||||
<img src="<?= $activeUser->getProfilePictureUrl(); ?>" class="rounded-circle h-100" alt="User Profile Picture" />
|
||||
<div class="position-absolute bottom-0 end-0 ratio-1 d-flex align-items-center z-1 avatar-login-method">
|
||||
<i class="fa-brands <?= $activeUser->getLoginMethod()->getIconClass() ?>"></i>
|
||||
<span class="position-absolute w-100 h-100 bottom-0 end-0 ratio-1 bg-body rounded-circle z-n1 avatar-login-method-icon"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column">
|
||||
<span class="me-2 h-3">
|
||||
<?= $activeUser->getName() ?>
|
||||
</span>
|
||||
<small class="text-muted">
|
||||
<?= $activeUser->getPermission()->getHumanReadableName() ?>
|
||||
</small>
|
||||
</div>
|
||||
<div class="h-100 d-flex align-items-center ms-2">
|
||||
<a href="/logout">
|
||||
<i class="fa-solid fa-arrow-right-to-bracket fa-xl text-danger"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
?>
|
||||
|
||||
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Templates\ResourceIndex;
|
||||
use League\Plates\Template\Template;
|
||||
|
||||
assert($this instanceof Template);
|
||||
/** @var ResourceIndex $resources */
|
||||
assert($resources instanceof ResourceIndex);
|
||||
|
||||
if (!isset($resourceEntry)) {
|
||||
throw new Exception("Resource entry not set");
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string $resourceEntry
|
||||
*/
|
||||
|
||||
$resource = $resources->getResource($resourceEntry);
|
||||
?>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Game Shop</title>
|
||||
|
||||
<?php foreach ($resource->js as $js): ?>
|
||||
<script src="/<?= $js ?>"></script>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($resource->css as $css): ?>
|
||||
<link rel="stylesheet" href="/<?= $css ?>">
|
||||
<?php endforeach; ?>
|
||||
</head>
|
||||
<body class="vh-100 d-flex flex-column">
|
||||
<?= $this->insert('layout/navbar') ?>
|
||||
|
||||
<main class="mt-2 position-relative flex-grow-1">
|
||||
<?= $this->section('content'); ?>
|
||||
</main>
|
||||
|
||||
<?= $this->section('modal') ?>
|
||||
|
||||
<div class="position-absolute bottom-0 start-50 opacity-25 text-center translate-middle-x">
|
||||
<span class="h1">PROTOTYPE / POC</span>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Templates\ResourceIndex;
|
||||
use League\Plates\Template\Template;
|
||||
|
||||
assert($this instanceof Template);
|
||||
/** @var ResourceIndex $resources */
|
||||
assert($resources instanceof ResourceIndex);
|
||||
|
||||
if (!isset($resourceEntry)) {
|
||||
throw new Exception("Resource entry not set");
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string $resourceEntry
|
||||
*/
|
||||
|
||||
$resource = $resources->getResource($resourceEntry);
|
||||
?>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Game Shop</title>
|
||||
|
||||
<?php foreach ($resource->js as $js): ?>
|
||||
<script src="/<?= $js ?>"></script>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($resource->css as $css): ?>
|
||||
<link rel="stylesheet" href="/<?= $css ?>">
|
||||
<?php endforeach; ?>
|
||||
</head>
|
||||
<body class="vh-100 d-flex flex-column">
|
||||
<?= $this->insert('layout/navbar') ?>
|
||||
|
||||
<main class="mt-2 position-relative flex-grow-1">
|
||||
<?= $this->section('content'); ?>
|
||||
</main>
|
||||
|
||||
<?= $this->section('modal') ?>
|
||||
|
||||
<div class="position-absolute bottom-0 start-50 opacity-25 text-center translate-middle-x">
|
||||
<span class="h1">PROTOTYPE / POC</span>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Entities\Account\User;
|
||||
use GamesShop\Login\UserPermission;
|
||||
use GamesShop\Templates\NavigationHeader;
|
||||
|
||||
$headers = [
|
||||
new NavigationHeader('My Keys', '/keys', UserPermission::PROVIDER),
|
||||
new NavigationHeader('Accounts', '/accounts', UserPermission::ADMIN)
|
||||
];
|
||||
|
||||
/** @var User|null $activeUser */
|
||||
$currentPermission = $activeUser === null ? UserPermission::NONE : $activeUser->getPermission();
|
||||
|
||||
?>
|
||||
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary main-navigation">
|
||||
<div class="container-fluid navigation-container">
|
||||
<a class="navbar-brand" href="/">Game Shop</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-content" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbar-content">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<?php foreach ($headers as $header):
|
||||
if (!$currentPermission->hasLevel($header->minimumPermission)) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<li class="nav-link">
|
||||
<a href="<?= $header->link ?>" class="nav-link"><?= $header->title ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?= $this->insert('layout/accountDisplay'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex mode-switch me-3">
|
||||
<button title="Use dark mode" id="dark" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-regular fa-moon"></i>
|
||||
</button>
|
||||
<button title="Use light mode" id="light" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-regular fa-sun"></i>
|
||||
</button>
|
||||
<button title="Use system preferred mode" id="system" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-solid fa-display"></i>
|
||||
</button>
|
||||
</div>
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use GamesShop\Entities\Account\User;
|
||||
use GamesShop\Login\UserPermission;
|
||||
use GamesShop\Templates\NavigationHeader;
|
||||
|
||||
$headers = [
|
||||
new NavigationHeader('My Keys', '/keys', UserPermission::PROVIDER),
|
||||
new NavigationHeader('Accounts', '/accounts', UserPermission::ADMIN)
|
||||
];
|
||||
|
||||
/** @var User|null $activeUser */
|
||||
$currentPermission = $activeUser === null ? UserPermission::NONE : $activeUser->getPermission();
|
||||
|
||||
?>
|
||||
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary main-navigation">
|
||||
<div class="container-fluid navigation-container">
|
||||
<a class="navbar-brand" href="/">Game Shop</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-content" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbar-content">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<?php foreach ($headers as $header):
|
||||
if (!$currentPermission->hasLevel($header->minimumPermission)) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<li class="nav-link">
|
||||
<a href="<?= $header->link ?>" class="nav-link"><?= $header->title ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?= $this->insert('layout/accountDisplay'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex mode-switch me-3">
|
||||
<button title="Use dark mode" id="dark" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-regular fa-moon"></i>
|
||||
</button>
|
||||
<button title="Use light mode" id="light" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-regular fa-sun"></i>
|
||||
</button>
|
||||
<button title="Use system preferred mode" id="system" class="btn btn-sm btn-default text-secondary">
|
||||
<i class="fa-solid fa-display"></i>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
Loading…
Add table
Add a link
Reference in a new issue