diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-08 20:50:15 +0000 | 
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-08 20:50:15 +0000 | 
| commit | 4a40b41f386af23da54cd35b8abac1f27c8e5ef7 (patch) | |
| tree | e618372a6f5446adc9e3770607cbb5fb04377900 /src/templates | |
| parent | 745664a1bf36cce13f3439698275b0b147efde3b (diff) | |
Filter by tag
Diffstat (limited to 'src/templates')
| -rw-r--r-- | src/templates/index.php | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/src/templates/index.php b/src/templates/index.php index c046e6c..796bc26 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -15,11 +15,16 @@              <?php } ?>              <a href="/create">Add Bookmark</a>              <h2>Tags</h2> -            <a href="/">All</a> +            <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> | <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> +                    <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>  | 
