+Show contents count in /baende list

This commit is contained in:
Simon Martens
2026-01-30 19:39:02 +01:00
parent e7e279aeeb
commit a70cdd6488
9 changed files with 100 additions and 19 deletions

View File

@@ -13,11 +13,11 @@
{{- if $entry.References -}}
<span class="inline-flex items-center rounded-xs bg-stone-100 px-2.5 py-0.5 text-xs text-slate-700 max-w-[10rem] whitespace-normal break-words" title="{{ $entry.References }}">{{ $entry.References }}</span>
{{- end -}}
<div class="flex flex-wrap items-center gap-1.5 pt-1">
<tool-tip position="top" class="inline">
<a href="/almanach/{{ $entry.MusenalmID }}" onclick="event.stopPropagation();" hx-target="body" class="no-underline inline-flex items-center gap-1 rounded-xs bg-stone-100 px-2 py-1 text-xs font-semibold text-slate-700 hover:bg-stone-200 hover:text-slate-900">
<i class="ri-eye-line"></i>
</a>
<div class="flex flex-wrap items-center gap-1.5 pt-1">
<tool-tip position="top" class="inline">
<a href="/almanach/{{ $entry.MusenalmID }}" onclick="event.stopPropagation();" hx-target="body" class="no-underline inline-flex items-center gap-1 rounded-xs bg-stone-100 px-2 py-1 text-xs font-semibold text-slate-700 hover:bg-stone-200 hover:text-slate-900">
<i class="ri-eye-line"></i>
</a>
<div class="data-tip">Ansehen</div>
</tool-tip>
{{- if (IsAdminOrEditor $model.request.user) -}}
@@ -27,6 +27,14 @@
</a>
<div class="data-tip">Bearbeiten</div>
</tool-tip>
<tool-tip position="top" class="inline">
<a href="/almanach/{{ $entry.MusenalmID }}/contents/edit" onclick="event.stopPropagation();" hx-target="body" class="no-underline inline-flex items-center gap-1 rounded-xs bg-stone-100 px-2 py-1 text-xs font-semibold text-slate-700 hover:bg-stone-200 hover:text-slate-900">
<i class="ri-file-list-3-line"></i>
{{- $count := index $model.result.ContentsCount $entry.Id -}}
<span>{{ if $count }}{{ $count }}{{ else }}0{{ end }}</span>
</a>
<div class="data-tip">Beiträge bearbeiten</div>
</tool-tip>
<tool-tip position="top" class="inline">
<button
type="button"