summaryrefslogtreecommitdiff
path: root/src/templates/index.php
blob: 796bc262029e184dea56625a495876e5b3da1e31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Bookmarks</title>
        <link rel="shortcut icon" href="/images/favicon.png">
        <link rel="stylesheet" href="/css/site.css">
    </head>
    <body>
        <section>
            <h1>Bookmarks</h1>
            <?php if ($message) { ?>
                <p class="message"><?php echo $message; ?></p>
            <?php } ?>
            <a href="/create">Add Bookmark</a>
            <h2>Tags</h2>
            <ul>
                <a href="/">All</a>
                <?php foreach($bookmarks->tags() as $tag) { ?>
                    <li><a href="/?tag=<?php echo htmlentities($tag); ?>"><?php echo $tag; ?></a></li>
                <?php } ?>
            </ul>
            <h2>Bookmarks</h2>
            <ol>
                <?php foreach ($bookmarks as $bookmark) { ?>
                    <li><a href="<?php echo htmlentities($bookmark->url); ?>"><?php echo (new DateTime($bookmark->addedAt))->format('Y-m-d'); ?> - <?php echo $bookmark->title != '' ? htmlentities($bookmark->title) : htmlentities($bookmark->url); ?></a> | <?php if ($bookmark->tag) { ?><a class="no-decoration tag" href="/?tag=<?php echo htmlentities($bookmark->tag); ?>"><?php echo htmlentities($bookmark->tag); ?></a> | <?php } ?><a class="no-decoration" href="/edit?id=<?php echo $bookmark->id; ?>">Edit</a> | <a class="no-decoration" href="/delete/confirm?id=<?php echo $bookmark->id; ?>">Delete</a></li>
                <?php } ?>
            </ol>
            <p>Copyright © 2021 David T. Sadler.</p>
        </section>
    </body>
</html>