diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-26 14:04:11 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-01-26 14:04:11 +0200 |
| commit | bfa238c056f31f36c00faad1c5995cbb8af3bd26 (patch) | |
| tree | e35d6b33fff3e79ae905d7dad699134553a1292d /views/home/index.php | |
| parent | c36f74386bcbb19c13915fe3796cb757aa7d1845 (diff) | |
| download | nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar.gz nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.zip | |
feat!: Rework all views to be used with the router
Diffstat (limited to 'views/home/index.php')
| -rw-r--r-- | views/home/index.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/views/home/index.php b/views/home/index.php index f567744..abc872b 100644 --- a/views/home/index.php +++ b/views/home/index.php @@ -1,12 +1,8 @@ -<?php - $title = 'Home'; - include '../meta.php'; -?> - <section class="highlight separate-margin"> <h2>Explore the archives or add a new page</h2> - <form action="/archive/index.php" method="GET" class="font-125 flex-row width-100 center-margin"> - <input type="text" name="page_url" placeholder="Enter a URL" class="flex-expand"> + + <form action="/archive" method="GET" class="font-125 flex-row width-100 center-margin"> + <input type="text" name="url" placeholder="Enter a URL" class="flex-expand"> <input type="submit" value="Search"> </form> </section> @@ -16,7 +12,7 @@ <h1>Most popular archives</h1> <?php foreach(Database\Webpage::mostVisited(10) as $page): ?> - <section class="card" onclick="open_archive('<?= $page->URL ?>')"> + <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> @@ -29,16 +25,20 @@ <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; ?> + <h1>...</h1> <div class="card-blank-afterspace"></div> <script type="text/javascript"> -function open_archive(url) { - window.location.href = '/archive/index.php?page_url=' + url; -} + function goto_archive(uri) { + window.location.href = '/archive/?url=' + uri; + } </script> - -<?php end_page(); ?> |
