PhotoPage: change how tags are displayed
This commit is contained in:
parent
507357ba59
commit
0b010be0b4
@ -39,8 +39,8 @@ class PhotoPage extends Template
|
||||
<div id="sub_photo" class="content-box">
|
||||
<h2 class="entry-title">', $this->photo->getTitle(), '</h2>';
|
||||
|
||||
$this->taggedPeople();
|
||||
$this->linkNewTags();
|
||||
$this->printTags('Album', 'Album', false);
|
||||
$this->printTags('Tagged People', 'Person', true);
|
||||
|
||||
echo '
|
||||
</div>
|
||||
@ -154,26 +154,40 @@ class PhotoPage extends Template
|
||||
</div>';
|
||||
}
|
||||
|
||||
private function taggedPeople()
|
||||
private function printTags($header, $tagKind, $allowLinkingNewTags)
|
||||
{
|
||||
echo '
|
||||
<h3>Tags</h3>
|
||||
<ul id="tag_list">';
|
||||
<h3>', $header, '</h3>
|
||||
<ul id="tag_list" class="d-flex">';
|
||||
|
||||
foreach ($this->photo->getTags() as $tag)
|
||||
{
|
||||
if ($tag->kind !== $tagKind)
|
||||
continue;
|
||||
|
||||
echo '
|
||||
<li id="tag-', $tag->id_tag, '">
|
||||
<a rel="tag" title="View all posts tagged ', $tag->tag, '" href="', $tag->getUrl(), '" class="entry-tag">', $tag->tag, '</a>';
|
||||
<a href="', $tag->getUrl(), '" title="View all posts tagged ', $tag->tag, '">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">', $tag->tag, '</span>';
|
||||
|
||||
if ($tag->kind === 'Person')
|
||||
{
|
||||
echo '
|
||||
<a class="delete-tag" title="Unlink this tag from this photo" href="#" data-id="', $tag->id_tag, '">❌</a>';
|
||||
<a class="btn btn-danger px-1" title="Unlink this tag from this photo" href="#" data-id="', $tag->id_tag, '">
|
||||
<i class="bi bi-x"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>
|
||||
</a>
|
||||
</li>';
|
||||
}
|
||||
|
||||
if ($allowLinkingNewTags)
|
||||
$this->linkNewTags();
|
||||
|
||||
echo '
|
||||
</ul>';
|
||||
}
|
||||
@ -181,12 +195,9 @@ class PhotoPage extends Template
|
||||
private function linkNewTags()
|
||||
{
|
||||
echo '
|
||||
<div>
|
||||
<h3>Link tags</h3>
|
||||
<p style="position: relative">
|
||||
<li style="position: relative">
|
||||
<input class="form-control w-auto" type="text" id="new_tag" placeholder="Type to link a new tag">
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<script type="text/javascript" src="', BASEURL, '/js/ajax.js"></script>
|
||||
<script type="text/javascript" src="', BASEURL, '/js/autosuggest.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
Loading…
Reference in New Issue
Block a user