fixes #2414 change related tags display

Add conf to display or not the related tag options by default
Add templates and css for new display
This commit is contained in:
HWFord
2025-10-03 15:43:29 +02:00
committed by GitHub
parent f930b6b524
commit b682fd0cd3
13 changed files with 332 additions and 109 deletions
@@ -0,0 +1,27 @@
<div class="mcs-side-results search-in-set-button" id="related-tags-toggle">
<div>
<p>{'Related tags'|translate}<i class="gallery-icon-up-open rotated"></i></p>
</div>
</div>
{foreach from=$RELATED_TAGS item=tag}
<span class="related-tags {if isset($RELATED_TAGS_DISPLAY) and $RELATED_TAGS_DISPLAY == false} hide{/if}">{strip}
<a class="tagLevel {if isset($tag.level)}{$tag.level}{/if}" href=
{if isset($tag.U_ADD)}
"{$tag.U_ADD}" title="{$tag.counter|@translate_dec:'%d photo is also linked to current tags':'%d photos are also linked to current tags'}" rel="nofollow">
{else}
"{$tag.URL}" title="{'display photos linked to this tag'|@translate}">
{/if}
+ {$tag.name}</a><div class="tag-counter">{$tag.counter}</div></span>{/strip}
{/foreach}
{footer_script require='jquery'}
$(document).ready(function () {
$('#related-tags-toggle').on("click", function (e) {
$('.related-tags').toggle();
$('#related-tags-toggle .gallery-icon-up-open').toggleClass('rotated');
});
});
{/footer_script}
@@ -0,0 +1,14 @@
<span id="selected-tags-container">
{foreach $SELECT_RELATED_TAGS as $TAG}
<span class="selected-related-tag">
<a href="{$TAG.index_url}" title="{'display photos linked to this tag'|translate}">
{$TAG.tag_name}
</a>
<a class="selected-related-tag-remove" href="{$TAG.remove_url}" style="border:none;" title="{'remove this tag from the list'|translate}">
<i class="gallery-icon-cancel"></i>
</a>
</span>{if !$TAG@last}<span class="related-tag-condition">+</span>{/if}
{/foreach}
</span>