diff --git a/controllers/ViewPhoto.php b/controllers/ViewPhoto.php index 6c15130f..cff5ed6c 100644 --- a/controllers/ViewPhoto.php +++ b/controllers/ViewPhoto.php @@ -98,8 +98,19 @@ class ViewPhoto extends HTMLController } // We are! - $photo->linkTags([(int) $_POST['id_tag']]); - echo json_encode(['success' => true]); - exit; + if (!isset($_POST['delete'])) + { + $photo->linkTags([(int) $_POST['id_tag']]); + echo json_encode(['success' => true]); + exit; + } + + // ... deleting, that is. + else + { + $photo->unlinkTags([(int) $_POST['id_tag']]); + echo json_encode(['success' => true]); + exit; + } } } diff --git a/public/css/default.css b/public/css/default.css index 9fbf28ec..861d2577 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -588,14 +588,16 @@ a#previous_photo:hover, a#next_photo:hover { } #sub_photo #tag_list li { display: inline; + padding-right: 0.75em; } -#sub_photo #tag_list li:after { - content: ', '; +#tag_list .delete-tag { + opacity: 0.25; } -#sub_photo #tag_list li:last-child:after { - content: ''; +#tag_list .delete-tag:hover { + opacity: 1.0; } + #photo_exif_box { background: #fff; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); diff --git a/templates/PhotoPage.php b/templates/PhotoPage.php index f959ca9f..a8300c65 100644 --- a/templates/PhotoPage.php +++ b/templates/PhotoPage.php @@ -148,8 +148,14 @@ class PhotoPage extends SubTemplate foreach ($this->photo->getTags() as $tag) { echo ' -
  • - +
  • + '; + + if ($tag->kind === 'Person') + echo ' + '; + + echo '
  • '; } @@ -168,6 +174,28 @@ class PhotoPage extends SubTemplate