aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-01-26 22:55:10 +0200
committerSyndamia <kamen@syndamia.com>2025-02-01 08:45:43 +0200
commit6eeb984a2cee866592cee9a55a0fe8864cb07464 (patch)
tree0278abfe8d680baf47fa1b6434d0c175d150177a /views
parent91400817d94a69a7fd47ca75c05bd85673635d30 (diff)
downloadnowayforward_human-6eeb984a2cee866592cee9a55a0fe8864cb07464.tar
nowayforward_human-6eeb984a2cee866592cee9a55a0fe8864cb07464.tar.gz
nowayforward_human-6eeb984a2cee866592cee9a55a0fe8864cb07464.zip
feat: Separate topbar files
Diffstat (limited to 'views')
-rw-r--r--views/archive/topbar.css44
-rw-r--r--views/archive/topbar.php34
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>