aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/archive/index.php35
-rw-r--r--views/styles.css15
2 files changed, 41 insertions, 9 deletions
diff --git a/views/archive/index.php b/views/archive/index.php
index bf296b5..11b4189 100644
--- a/views/archive/index.php
+++ b/views/archive/index.php
@@ -2,6 +2,7 @@
$exists = null;
$page = null;
$user = null;
+ $archives = null;
try {
list($exists, $url) = doesWebsiteExist($url);
@@ -9,25 +10,41 @@
$page = Database\Webpage::fromDB($url);
$user = Database\Cookie::fromDB($TOKEN);
+ $archives = $page->allArchives();
}
catch(Exception $e) {
}
?>
<?php if ($page !== null): ?>
- <iframe src="<?= "/archives/{$page->WID}/index.php" ?>" scrolling="no" sandbox></iframe>
+ <h1 id="page-header"><?= $page->URL ?></h1>
- <p></p>
- <form action="/archive/create" method="POST">
- <input type="hidden" name="url" value="<?= $url ?>">
- <input type="submit" value="Archive Now!">
- </form>
- <!-- Button to add to list -->
- <!-- Button to delete -->
+ <p id="page-info">
+ Archived <b><?= count($archives) ?></b> times,
+ between
+ <b><?php echo end($archives)->Date; reset($archives); ?></b>
+ and
+ <b><?= current($archives)->Date ?></b>
+ </p>
+
+ <section id="page-buttons">
+ <span class="flex-expand"></span>
+ <form action="/archive/create" method="POST">
+ <input type="hidden" name="url" value="<?= $url ?>">
+ <input type="submit" value="Archive Now!" class="standalone-button">
+ </form>
+ <form action="/list/add" method="GET">
+ <input type="hidden" name="wid" value="<?= current($archives)->WID ?>">
+ <input type="submit" value="Add to a list!" class="standalone-button">
+ </form>
+ <span class="flex-expand"></span>
+ </section>
+
+ <iframe src="<?= "/archives/{$page->WID}/index.php" ?>" scrolling="no" sandbox></iframe>
<h2>Archives by date:</h2>
<?php
- foreach ($page->allArchives() as $page) {
+ foreach ($archives as $page) {
include __DIR__ . '/item.php';
}
include_once __DIR__ . '/item_show.php';
diff --git a/views/styles.css b/views/styles.css
index cd151d0..07564ea 100644
--- a/views/styles.css
+++ b/views/styles.css
@@ -514,3 +514,18 @@ hr.new-section {
#user-nav button:hover {
filter: none;
}
+
+/* Archives */
+#page-header {
+ margin-bottom: 2em;
+}
+
+#page-info {
+ text-align: center;
+}
+
+#page-buttons {
+ display: flex;
+ margin: 1em 0 2em 0;
+ gap: 1em;
+}