88 lines
3.2 KiB
PHP
88 lines
3.2 KiB
PHP
<?php
|
||
require_once(__DIR__ . "/../app/template.php");
|
||
|
||
if ($templateParameters["render"] === FALSE) {
|
||
return;
|
||
}
|
||
?>
|
||
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title><?=htmlspecialchars($templateParameters["title"]);?> – Stafett for livet</title>
|
||
|
||
<link rel="stylesheet" href="<?=$templateUrlPrefix;?>style/main.css">
|
||
<link rel="icon" href="<?=$templateUrlPrefix;?>img/cropped-kf-propell-ikon-32x32.png" sizes="32x32">
|
||
<body>
|
||
|
||
<header>
|
||
<div class="navbar-top">
|
||
<div class="inner">
|
||
<a href="<?=$templateUrlPrefix;?>" style="display: block; max-width: max-content;">
|
||
<img style="display: block; height: 32px;" src="<?=$templateUrlPrefix;?>img/cropped-kf-propell-ikon-32x32.png" alt="">
|
||
<div style="margin-left: 44px;">
|
||
<div style="font-size: 24px; margin-top: -38px;">Stafett for livet</div>
|
||
<div style="font-size: 10px; margin-top: -6px;"><b>KREFT</b>FORENINGEN</div>
|
||
</div>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<?php if ((isset($_SESSION['logged_in'])) && ($_SESSION['logged_in'] === TRUE)) : ?>
|
||
<div class="login-statusbar">
|
||
<div class="inner">
|
||
<a href="<?=$templateUrlPrefix;?>logout.php" style="float: right;">Logg ut</a>
|
||
<div>Inlogget som: <?=htmlspecialchars($_SESSION['username'])?></div>
|
||
</div>
|
||
</div>
|
||
<?php endif; ?>
|
||
|
||
<div class="grid-container">
|
||
|
||
<div>
|
||
<nav class="nav-links">
|
||
<ul>
|
||
<li><a href="<?=$templateUrlPrefix;?>">Forside</a></li>
|
||
<li><a href="<?=$templateUrlPrefix;?>login.php">Logg inn</a></li>
|
||
<li><a href="<?=$templateUrlPrefix;?>example.php">Eksempel</a></li>
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
|
||
<div>
|
||
<?php
|
||
// is my implementation of alerts janky? maybe...
|
||
if ((isset($_SESSION['alert'])) && (count($_SESSION['alert']) > 0)) {
|
||
foreach ($_SESSION['alert'] as $alert) {
|
||
switch ($alert[0]) {
|
||
case 'success':
|
||
$prefix = 'Suksess:';
|
||
break;
|
||
|
||
case 'info':
|
||
$prefix = 'Info:';
|
||
break;
|
||
|
||
case 'warning':
|
||
$prefix = 'Advarsel:';
|
||
break;
|
||
|
||
case 'danger':
|
||
$prefix = 'Error:';
|
||
break;
|
||
|
||
default:
|
||
$alert[0] = 'danger';
|
||
$prefix = 'Ukjent:';
|
||
break;
|
||
}
|
||
echo('<div class="alert alert-'.$alert[0].'"><b>'.$prefix.'</b> '.$alert[1].'</div>');
|
||
}
|
||
$_SESSION['alert'] = [];
|
||
}
|
||
?>
|
||
<main>
|