From e3d481caa18a229c6792f903fef3cf07b0e56a2f Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 11 Jan 2024 20:47:41 +0100 Subject: [PATCH] PhotoPage: update and refactor tagging script slightly --- public/css/default.css | 15 +++---- templates/PhotoPage.php | 86 +++++++++++++++++++++++------------------ 2 files changed, 54 insertions(+), 47 deletions(-) diff --git a/public/css/default.css b/public/css/default.css index 84e02f1..b8b7105 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -526,20 +526,15 @@ a#previous_photo:hover, a#next_photo:hover { #sub_photo h2, #sub_photo h3 { margin-bottom: 1rem; } -#sub_photo #tag_list { +#sub_photo .tag-list { list-style: none; margin: 1em 0; padding: 0; } -#sub_photo #tag_list li { - display: inline; - padding-right: 0.75em; -} -#tag_list .delete-tag { - opacity: 0.25; -} -#tag_list .delete-tag:hover { - opacity: 1.0; +#sub_photo .tag-list > li { + display: inline-block; + margin-bottom: 0.75em; + margin-right: 0.75em; } .photo_meta { diff --git a/templates/PhotoPage.php b/templates/PhotoPage.php index f68acf5..83c9ebe 100644 --- a/templates/PhotoPage.php +++ b/templates/PhotoPage.php @@ -120,9 +120,12 @@ class PhotoPage extends Template private function printTags($header, $tagKind, $allowLinkingNewTags) { + static $nextTagListId = 1; + $tagListId = 'tagList' . ($nextTagListId++); + echo '

', $header, '

-