PhotoPage: simplify tag html nodes

This commit is contained in:
Aaron van Geffen 2024-01-11 21:53:44 +01:00
parent 9922cd0833
commit 949a45ff8f
2 changed files with 18 additions and 19 deletions

View File

@ -536,7 +536,9 @@ a#previous_photo:hover, a#next_photo:hover {
margin-bottom: 0.75em; margin-bottom: 0.75em;
margin-right: 0.75em; margin-right: 0.75em;
} }
#sub_photo .tag-list .input-group-text {
color: inherit;
}
#photo_exif_box dt { #photo_exif_box dt {
font-weight: bold; font-weight: bold;

View File

@ -170,21 +170,21 @@ class PhotoPage extends Template
echo ' echo '
<li id="tag-', $tag->id_tag, '"> <li id="tag-', $tag->id_tag, '">
<a href="', $tag->getUrl(), '" title="View all posts tagged ', $tag->tag, '"> <div class="input-group">
<div class="input-group"> <a class="input-group-text" href="', $tag->getUrl(), '" title="View all posts tagged ', $tag->tag, '">
<span class="input-group-text">', $tag->tag, '</span>'; ', $tag->tag, '
</a>';
if ($tag->kind === 'Person') if ($tag->kind === 'Person')
{ {
echo ' echo '
<a class="delete-tag btn btn-danger px-1" title="Unlink this tag from this photo" href="#" data-id="', $tag->id_tag, '"> <a class="delete-tag btn btn-danger px-1" title="Unlink this tag from this photo" href="#" data-id="', $tag->id_tag, '">
<i class="bi bi-x"></i> <i class="bi bi-x"></i>
</a>'; </a>';
} }
echo ' echo '
</div> </div>
</a>
</li>'; </li>';
} }
@ -238,19 +238,16 @@ class PhotoPage extends Template
const newListItem = document.createElement("li"); const newListItem = document.createElement("li");
newListItem.id = "tag-" + item.id_tag; newListItem.id = "tag-" + item.id_tag;
const newLink = document.createElement("a");
newLink.href = item.url;
newLink.title = "View all posts tagged " + item.label;
newListItem.appendChild(newLink);
const newInputGroup = document.createElement("div"); const newInputGroup = document.createElement("div");
newInputGroup.className = "input-group"; newInputGroup.className = "input-group";
newLink.appendChild(newInputGroup); newListItem.appendChild(newInputGroup);
const newLabel = document.createElement("span"); const newLink = document.createElement("a");
newLabel.className = "input-group-text"; newLink.className = "input-group-text";
newLabel.textContent = item.label; newLink.href = item.url;
newInputGroup.appendChild(newLabel); newLink.title = "View all posts tagged " + item.label;
newLink.textContent = item.label;
newInputGroup.appendChild(newLink);
const removeLink = document.createElement("a"); const removeLink = document.createElement("a");
removeLink.className = "delete-tag btn btn-danger px-1"; removeLink.className = "delete-tag btn btn-danger px-1";