diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-01 10:30:45 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-01 10:30:45 +0200 |
| commit | c8cdadfabea0120526a6e0366710f9256fc999b4 (patch) | |
| tree | b4acc126498e6dbf6187722409f7873b654d2a7a /views/home/index.php | |
| parent | c4f387d21147b91e708345fc6f7405fb1a2b6271 (diff) | |
| download | nowayforward_human-c8cdadfabea0120526a6e0366710f9256fc999b4.tar nowayforward_human-c8cdadfabea0120526a6e0366710f9256fc999b4.tar.gz nowayforward_human-c8cdadfabea0120526a6e0366710f9256fc999b4.zip | |
feat(views/home): Move single webpage card code to a separate file
Diffstat (limited to 'views/home/index.php')
| -rw-r--r-- | views/home/index.php | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/views/home/index.php b/views/home/index.php index e14e23a..036a79a 100644 --- a/views/home/index.php +++ b/views/home/index.php @@ -11,34 +11,13 @@ <h1>Most popular archives</h1> -<?php foreach(Database\Webpage::fromDBmostVisited(10) as $page): ?> - <section class="card" onclick="goto_archive('<?= $page->URL ?>')"> - <section class="quickinfo"> - <a href="<?= $page->URL ?>"><?= $page->URL ?></a> - <span class="float-right"><?= $page->Date ?></span> - </section> - <section class="title"> - <img src="<?= '/archives/' . $page->FaviconPath ?>"></span> - <span><?= $page->Title ?></span> - </section> - <section> - <strong>Visits: <?= $page->Visits ?></strong> - <strong><!-- Archives count --></strong> - </section> - <script type="text/javascript"> - function open_archive(url) { - window.location.href = '/archive/' + url; - } - </script> - </section> -<?php endforeach; ?> +<?php + foreach(Database\Webpage::fromDBmostVisited(10) as $page) { + $goto = "/archive/?url=$page->URL"; + include __DIR__ . '/card.php'; + } +?> <h1>...</h1> <div class="card-blank-afterspace"></div> - -<script type="text/javascript"> - function goto_archive(uri) { - window.location.href = '/archive/?url=' + uri; - } -</script> |
