Omit sidebar for non-logged in users

main
Yasen Pramatarov 2025-02-10 19:18:15 +02:00
parent 64d19f61f2
commit d2a9280d7d
3 changed files with 9 additions and 3 deletions

View File

@ -12,13 +12,17 @@
</div>
<script src="static/js/sidebar.js"></script>
<?php if (isset($currentUser) && $page !== 'logout') { ?>
<script src="static/js/sidebar.js"></script>
<?php } ?>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script>
// dismissible messages
document.addEventListener('DOMContentLoaded', function() {

View File

@ -10,6 +10,7 @@
<link rel="stylesheet" type="text/css" href="<?= htmlspecialchars($app_root) ?>static/css/main.css">
<link rel="stylesheet" type="text/css" href="<?= htmlspecialchars($app_root) ?>static/css/messages.css">
<script src="<?= htmlspecialchars($app_root) ?>static/js/messages.js"></script>
<?php if (isset($currentUser)) { ?>
<script>
// restore sidebar state before the page is rendered
(function () {
@ -19,6 +20,7 @@
}
})();
</script>
<?php } ?>
<?php if ($page === 'logs') { ?>
<link rel="stylesheet" type="text/css" href="<?= htmlspecialchars($app_root) ?>static/css/logs.css">
<?php } ?>

View File

@ -180,6 +180,7 @@ if ($page == 'logout') {
include '../app/templates/page-header.php';
include '../app/templates/page-menu.php';
include '../app/pages/login.php';
include '../app/templates/page-footer.php';
} else {
@ -223,9 +224,8 @@ if ($page == 'logout') {
// the page is not in allowed urls, loading "not found" page
include '../app/templates/error-notfound.php';
}
include '../app/templates/page-footer.php';
}
// end with the footer
include '../app/templates/page-footer.php';
// flush the output buffer and show the page
ob_end_flush();