diff options
Diffstat (limited to 'views')
| -rw-r--r-- | views/archive/topbar.css | 44 | ||||
| -rw-r--r-- | views/archive/topbar.php | 34 |
2 files changed, 78 insertions, 0 deletions
diff --git a/views/archive/topbar.css b/views/archive/topbar.css new file mode 100644 index 0000000..21b72d8 --- /dev/null +++ b/views/archive/topbar.css @@ -0,0 +1,44 @@ +.navbar { + display: flex; + justify-content: space-between; + align-items: center; + background-color: #343a40; + color: #ffffff; + padding: 10px; + border-bottom: 1px solid #ccc; + width: 100%; + position: fixed; + top: 0; + left: 0; + z-index: 1000; +} + +.navbar-info { + display: flex; + justify-content: center; + flex-grow: 1; +} + +.navbar-info span { + margin-right: 15px; +} + +.navbar-links { + display: flex; + gap: 20px; +} + +.navbar a { + text-decoration: none; + color: #007bff; +} + +.navbar a:hover { + text-decoration: underline; + color: #66b3ff; +} + +/* Add some margin to the body to prevent content from being hidden behind the navbar */ +body { + margin-top: 60px; +} diff --git a/views/archive/topbar.php b/views/archive/topbar.php new file mode 100644 index 0000000..f521fcb --- /dev/null +++ b/views/archive/topbar.php @@ -0,0 +1,34 @@ +<!-- Dirty hack to escape all PHP dom sanitization and checks --> +</script> + +<?php + require_once "../../models/database.php"; + require_once "../../models/webpage.php"; + require_once "../../models/user.php"; + + $currentPageId = basename(__DIR__); + $currentPage = Database\Webpage::fromDBwid($currentPageId); + $requesterUsername = Database\User::fromDBuid($currentPage->RequesterUID); + + $previousPageId = Database\Webpage::getPreviousPageId($currentPage->URL, $currentPage->Date); + $nextPageId = Database\Webpage::getNextPageId($currentPage->URL, $currentPage->Date); +?> + +<div class="navbar"> + <div class="navbar-info"> + <span>Title: <?= $currentPage->Title ?></span> + <span>Url: <?= $currentPage->URL ?></span> + <span>Date of archival: <?= $currentPage->Date ?></span> + <span>Visits: <?= $currentPage->Visits ?></span> + <span>Requested by: <?= $requesterUsername->Username ?></span> + </div> + + <div class="navbar-links"> + <? if ($previousPageId != 0): ?> + <a href="<?= "../$previousPageId/index.php" ?>">Previous version</a> + <? endif; ?> + <? if ($nextPageId != 0): ?> + <a href="<?= "../$nextPageId/index.php" ?>">Next version</a> + <? endif; ?> + </div> +</div> |
