Website Summary Files Commits Branches @commit @diff @stats
path: root / views / archive / index.php
diff options
context:
space:
mode:
Commitc4f387d21147b91e708345fc6f7405fb1a2b6271 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-02-01 10:18:06 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-02-01 10:28:22 +0200
Filesed7ced6b63636dfa01870d595b83c32a47c4bd67 /views/archive/index.php
nowayforward_human-c4f387d21147b91e708345fc6f7405fb1a2b6271.tar
nowayforward_human-c4f387d21147b91e708345fc6f7405fb1a2b6271.tar.gz
nowayforward_human-c4f387d21147b91e708345fc6f7405fb1a2b6271.zip
Parentfaabc462d3080cac67687f450135a078731fb3d1 (diff)
feat: Move single archive item code to a separate file
1 files changed, 5 insertions, 29 deletions
-rw-r--r--views/archive/index.php34
diff --git a/views/archive/index.php b/views/archive/index.php
index 846f910..f7c427f 100644
--- a/views/archive/index.php
+++ b/views/archive/index.php
@@ -24,36 +24,12 @@
<!-- Button to delete -->
<h2>Archives by date:</h2>
- <?php foreach ($page->allArchives() as $page): ?>
- <section class="item">
- <section>
- <div>
- <img src="<?= '/archives/' . $page->FaviconPath ?>" class="favicon">
- <a href="<?= '/archives/' . $page->WID . '/index.php' ?>"><?= $page->URL ?></a>
- <span class="float-right"><?= $page->Date ?></span>
- </div>
- <div class="details">
- <span>Visits: <?= $page->Visits ?></span>
- <span class="float-right"><?= Database\User::fromDBuid($page->RequesterUID)->Username ?></span>
- </div>
- </section>
- <section name="itemButton" hidden>
- <form action="/list/update" method="GET">
- <input type="hidden" name="wid" value="<?= $page->WID ?>">
- <input type="submit" value="+">
- </form>
- <span><!-- Delete (when admin) button --></span>
- </section>
- </section>
- <?php endforeach; ?>
- <script type="text/javascript">
- function showButtons() {
- for (buttonset of document.getElementsByName('itemButton')) {
- buttonset.hidden = false;
- }
+ <?php
+ foreach ($page->allArchives() as $page) {
+ include __DIR__ . '/item.php';
}
- authenticated(showButtons);
- </script>
+ include_once __DIR__ . '/item_show.php';
+ ?>
<?php elseif(!$exists): ?>
<h2>"<?= $url ?>" Does not exist!</h2>