Start work on gate module and login/layout
This commit is contained in:
parent
506f1a44d1
commit
56524da0c6
|
@ -13,6 +13,17 @@ body {
|
|||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#container {
|
||||
padding: 1rem;
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 0.5rem;
|
||||
|
||||
|
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -11,8 +11,10 @@ $route = App::$req->uri(0);
|
|||
// redirect depending on installation status
|
||||
installRedirect($route);
|
||||
|
||||
// route to the relevant module
|
||||
if ($route == '/') return HomeModule::home();
|
||||
if ($route == 'install') return InstallModule::handle();
|
||||
if ($route == 'gate') return GateModule::handle();
|
||||
|
||||
// 404
|
||||
http_response_code(404);
|
||||
|
|
|
@ -2,5 +2,18 @@
|
|||
|
||||
class GateModule
|
||||
{
|
||||
private const GUEST = ['login', 'register'];
|
||||
|
||||
public static function handle()
|
||||
{
|
||||
$s = App::$req->uri(1) ?? ''; // second segment
|
||||
$m = App::$req->method; // request method
|
||||
|
||||
if ($s == '' || $s == 'login') return self::login();
|
||||
}
|
||||
|
||||
public static function login()
|
||||
{
|
||||
echo render('layout', ['title' => 'Login']);
|
||||
}
|
||||
}
|
0
server/templates/auth/login.php
Normal file
0
server/templates/auth/login.php
Normal file
34
server/templates/layout.php
Normal file
34
server/templates/layout.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= $title ?> | <?= App::$s['game_name'] ?></title>
|
||||
<link rel="stylesheet" href="/css/dragon.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<header>
|
||||
<?= render('partials/header', $data) ?>
|
||||
</header>
|
||||
|
||||
<div id="content">
|
||||
<aside id="left">
|
||||
left
|
||||
</aside>
|
||||
|
||||
<main>
|
||||
|
||||
</main>
|
||||
|
||||
<aside id="right">
|
||||
right
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<?= render('partials/footer', $data) ?>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
server/templates/partials/footer.php
Normal file
1
server/templates/partials/footer.php
Normal file
|
@ -0,0 +1 @@
|
|||
footer
|
1
server/templates/partials/header.php
Normal file
1
server/templates/partials/header.php
Normal file
|
@ -0,0 +1 @@
|
|||
<img src="/img/logos/logo.gif" alt="<?= App::$s['game_name'] ?>" class="logo" />
|
Loading…
Reference in New Issue
Block a user