1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-10 18:51:01 +00:00

feat(ui): avoid showing an excessive number of tags

This commit is contained in:
Frédéric Guillot 2025-06-08 15:21:59 -07:00
parent f9dce3d10f
commit a8bb7a48d7
23 changed files with 471 additions and 339 deletions

View file

@ -136,13 +136,40 @@
{{ if .entry.Tags }}
<div class="entry-tags">
{{ t "entry.tags.label" }}
{{ range $i, $e := .entry.Tags }}
{{if $i}}, {{end}}
{{ if $.user }}
<a href="{{ route "tagEntriesAll" "tagName" (urlEncode $e) }}"><strong>{{ $e }}</strong></a>
{{ else }}
<strong>{{ $e }}</strong>
{{ $allTags := .entry.Tags }}
{{ $numTags := len $allTags }}
{{ $tagsLimit := 5 }}
{{ $numerOfAdditionalTags := subtract $numTags $tagsLimit }}
<ul class="entry-tags-list">
{{ range $i, $tagName := $allTags }}
{{ if lt $i $tagsLimit }}
{{ if $.user }}
<li><a href="{{ route "tagEntriesAll" "tagName" (urlEncode $tagName) }}"><strong>{{ $tagName }}</strong></a></li>
{{ else }}
<li><strong>{{ $tagName }}</strong></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ if gt $numTags $tagsLimit }}
<details class="entry-additional-tags">
<summary>
{{ plural "entry.tags.more_tags_label" $numerOfAdditionalTags $numerOfAdditionalTags }}
</summary>
<ul class="entry-tags-list">
{{ range $idx, $tagName := $allTags }}
{{ if ge $idx $tagsLimit }}
{{ if $.user }}
<li><a href="{{ route "tagEntriesAll" "tagName" (urlEncode $tagName) }}"><strong>{{ $tagName }}</strong></a></li>
{{ else }}
<li><strong>{{ $tagName }}</strong></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
</details>
{{ end }}
</div>
{{ end }}