+Better Cross-Linking between Alamanch and beiträge

This commit is contained in:
Simon Martens
2026-01-22 13:59:56 +01:00
parent 7f48ef48d3
commit df6f729eb8
8 changed files with 95 additions and 50 deletions

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,20 @@
<div class="flex flex-row w-full justify-between"> <div class="flex flex-row w-full justify-between">
<div class="flex flex-col justify-end-safe flex-2/5"> <div class="flex flex-col justify-end-safe flex-2/5">
<div class="mb-1"> <div class="mb-1">
<div class="header-tabs">
{{- if $model.result -}}
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/edit" class="header-tab">
<i class="ri-book-line"></i> Almanach
</a>
{{- else -}}
<span class="header-tab header-tab-disabled">
<i class="ri-book-line"></i> Almanach
</span>
{{- end -}}
<span class="header-tab header-tab-active">
<i class="ri-file-list-3-line"></i> Beiträge <i class="ri-file-list-3-line"></i> Beiträge
</span>
</div>
</div> </div>
<h1 class="text-2xl w-full font-bold text-slate-900 mb-1"> <h1 class="text-2xl w-full font-bold text-slate-900 mb-1">
{{- if $model.result -}} {{- if $model.result -}}
@@ -43,18 +56,6 @@
</div> </div>
{{- end -}} {{- end -}}
</div> </div>
&middot;
<div>
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/contents/edit" class="text-gray-700 no-underline hover:text-slate-950 block">
<i class="ri-loop-left-line"></i> Reset
</a>
</div>
&middot;
<div>
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/edit" class="text-gray-700 no-underline hover:text-slate-950 block">
<i class="ri-edit-2-line"></i> Almanach
</a>
</div>
</div> </div>
{{- end -}} {{- end -}}
</div> </div>
@@ -65,7 +66,7 @@
<div class="font-bold text-sm"> <div class="font-bold text-sm">
<i class="ri-navigation-line"></i> Navigation <i class="ri-navigation-line"></i> Navigation
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-2">
{{- if $model.result.PrevByTitle -}} {{- if $model.result.PrevByTitle -}}
<tool-tip position="top" class="!inline"> <tool-tip position="top" class="!inline">
<div class="data-tip">{{ $model.result.PrevByTitle.PreferredTitle }}</div> <div class="data-tip">{{ $model.result.PrevByTitle.PreferredTitle }}</div>
@@ -129,14 +130,14 @@
</div> </div>
</div> </div>
<div class="container-normal mx-auto mt-4 !px-0"> <div class="container-normal mx-auto mt-1 !px-0">
{{ template "_usermessage" $model }} {{ template "_usermessage" $model }}
<div id="contents-sync-indicator" class="fixed right-6 bottom-6 z-50 hidden rounded-full bg-stone-200 px-3 py-2 text-sm text-stone-700 shadow-md"> <div id="contents-sync-indicator" class="fixed right-6 bottom-6 z-50 hidden rounded-full bg-stone-200 px-3 py-2 text-sm text-stone-700 shadow-md">
<i class="ri-loader-4-line spinning mr-2"></i> <i class="ri-loader-4-line spinning mr-2"></i>
Reihenfolge wird gespeichert Reihenfolge wird gespeichert
</div> </div>
<input type="hidden" name="csrf_token" value="{{ $model.csrf_token }}" data-role="csrf-token" /> <input type="hidden" name="csrf_token" value="{{ $model.csrf_token }}" data-role="csrf-token" />
<div class="flex items-center gap-3 px-4"> <div class="flex items-center gap-3 px-4 hidden">
<form <form
method="POST" method="POST"
action="/almanach/{{ $model.result.Entry.MusenalmID }}/contents/edit/extent" action="/almanach/{{ $model.result.Entry.MusenalmID }}/contents/edit/extent"
@@ -155,11 +156,17 @@
</button> </button>
</form> </form>
</div> </div>
<div class="px-4 text-xl font-bold text-gray-800 mt-3">Inhalt</div> <div class="px-4 mt-1 flex items-center justify-between gap-3">
<div class="flex items-center gap-2 text-lg font-bold text-gray-700">
<i class="ri-folder-open-line"></i>
<span>Inhalt</span>
</div>
<span id="content-filter-count" class="text-sm font-semibold text-gray-600 whitespace-nowrap" data-role="content-filter-count">
{{ len $model.result.Contents }} Einträge
</span>
</div>
<hr class="mx-4 mt-2 mb-1 border-slate-300" />
<div class="px-4 py-2 flex flex-wrap items-center gap-3"> <div class="px-4 py-2 flex flex-wrap items-center gap-3">
<label for="content-filter" class="text-base font-bold text-gray-700 whitespace-nowrap">
<i class="ri-search-line"></i> Filter
</label>
<input <input
id="content-filter" id="content-filter"
type="text" type="text"
@@ -182,9 +189,6 @@
data-role="content-filter-type"> data-role="content-filter-type">
<option value="">Alle Typen</option> <option value="">Alle Typen</option>
</select> </select>
<span id="content-filter-count" class="text-sm text-gray-600 whitespace-nowrap ml-auto" data-role="content-filter-count">
{{ len $model.result.Contents }} Einträge
</span>
<button <button
type="button" type="button"
class="content-action-button" class="content-action-button"

View File

@@ -5,7 +5,26 @@
<div class="flex flex-row w-full justify-between"> <div class="flex flex-row w-full justify-between">
<div class="flex flex-col justify-end-safe flex-2/5"> <div class="flex flex-col justify-end-safe flex-2/5">
<div class="mb-1"> <div class="mb-1">
<i class="ri-file-list-3-line"></i> Beitrag <div class="header-tabs">
{{- if $model.result -}}
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/edit" class="header-tab">
<i class="ri-book-line"></i> Almanach
</a>
{{- else -}}
<span class="header-tab header-tab-disabled">
<i class="ri-book-line"></i> Almanach
</span>
{{- end -}}
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/contents/edit" class="header-tab">
<i class="ri-file-list-3-line"></i> Beiträge
</a>
<span class="header-tab-sep" aria-hidden="true">
<i class="ri-arrow-right-s-line"></i>
</span>
<span class="header-tab header-tab-active" aria-current="page">
<i class="ri-file-text-line"></i> Einzelbeitrag
</span>
</div>
</div> </div>
<h1 class="text-2xl w-full font-bold text-slate-900 mb-1"> <h1 class="text-2xl w-full font-bold text-slate-900 mb-1">
{{- if $model.result -}} {{- if $model.result -}}
@@ -55,19 +74,7 @@
<i class="ri-loop-left-line"></i> Reset <i class="ri-loop-left-line"></i> Reset
</a> </a>
</div> </div>
&middot;
{{- end -}} {{- end -}}
<div>
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/contents/edit" class="text-gray-700 no-underline hover:text-slate-950 block">
<i class="ri-arrow-left-line"></i> Liste
</a>
</div>
&middot;
<div>
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/edit" class="text-gray-700 no-underline hover:text-slate-950 block">
<i class="ri-edit-2-line"></i> Almanach
</a>
</div>
</div> </div>
{{- end -}} {{- end -}}
</div> </div>
@@ -78,7 +85,7 @@
<div class="font-bold text-sm"> <div class="font-bold text-sm">
<i class="ri-navigation-line"></i> Navigation <i class="ri-navigation-line"></i> Navigation
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-2">
{{- if not $model.is_new -}} {{- if not $model.is_new -}}
{{- if $model.prev_content -}} {{- if $model.prev_content -}}
<tool-tip position="top" class="!inline"> <tool-tip position="top" class="!inline">

View File

@@ -24,7 +24,20 @@ type AlmanachResult struct {
<div class="flex flex-row w-full justify-between"> <div class="flex flex-row w-full justify-between">
<div class="flex flex-col justify-end-safe flex-2/5"> <div class="flex flex-col justify-end-safe flex-2/5">
<div class="mb-1"> <div class="mb-1">
<div class="header-tabs">
<span class="header-tab header-tab-active">
<i class="ri-book-line"></i> Almanach <i class="ri-book-line"></i> Almanach
</span>
{{- if not $model.is_new -}}
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/contents/edit" class="header-tab">
<i class="ri-file-list-3-line"></i> Beiträge
</a>
{{- else -}}
<span class="header-tab header-tab-disabled">
<i class="ri-file-list-3-line"></i> Beiträge
</span>
{{- end -}}
</div>
</div> </div>
<h1 class="text-2xl w-full font-bold text-slate-900 mb-1"> <h1 class="text-2xl w-full font-bold text-slate-900 mb-1">
{{- if $model.is_new -}} {{- if $model.is_new -}}
@@ -72,13 +85,6 @@ type AlmanachResult struct {
<i class="ri-loop-left-line"></i> Reset <i class="ri-loop-left-line"></i> Reset
</a> </a>
</div> </div>
&middot;
<div>
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/contents/edit" class="text-gray-700
no-underline hover:text-slate-950 block ">
<i class="ri-file-list-3-line"></i> Beiträge
</a>
</div>
</div> </div>
{{- end -}} {{- end -}}
</div> </div>
@@ -89,7 +95,7 @@ type AlmanachResult struct {
<div class="font-bold text-sm"> <div class="font-bold text-sm">
<i class="ri-navigation-line"></i> Navigation <i class="ri-navigation-line"></i> Navigation
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-2">
{{- if $model.result.PrevByTitle -}} {{- if $model.result.PrevByTitle -}}
<tool-tip position="top" class="!inline"> <tool-tip position="top" class="!inline">
<div class="data-tip">{{ $model.result.PrevByTitle.PreferredTitle }}</div> <div class="data-tip">{{ $model.result.PrevByTitle.PreferredTitle }}</div>

View File

@@ -39,7 +39,7 @@
<div class="font-bold text-sm"> <div class="font-bold text-sm">
<i class="ri-navigation-line"></i> Navigation <i class="ri-navigation-line"></i> Navigation
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-2">
{{- if $model.result.Prev -}} {{- if $model.result.Prev -}}
<tool-tip position="top" class="!inline"> <tool-tip position="top" class="!inline">
<div class="data-tip">{{ $model.result.Prev.Name }}</div> <div class="data-tip">{{ $model.result.Prev.Name }}</div>

View File

@@ -41,7 +41,7 @@
<div class="font-bold text-sm"> <div class="font-bold text-sm">
<i class="ri-navigation-line"></i> Navigation <i class="ri-navigation-line"></i> Navigation
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-2">
{{- if $model.result.Prev -}} {{- if $model.result.Prev -}}
<tool-tip position="top" class="!inline"> <tool-tip position="top" class="!inline">
<div class="data-tip">{{ $model.result.Prev.Name }}</div> <div class="data-tip">{{ $model.result.Prev.Name }}</div>

View File

@@ -41,7 +41,7 @@
<div class="font-bold text-sm"> <div class="font-bold text-sm">
<i class="ri-navigation-line"></i> Navigation <i class="ri-navigation-line"></i> Navigation
</div> </div>
<div class="flex items-center gap-3"> <div class="flex items-center gap-2">
{{- if $model.result.Prev -}} {{- if $model.result.Prev -}}
<tool-tip position="top" class="!inline"> <tool-tip position="top" class="!inline">
<div class="data-tip">{{ $model.result.Prev.Title }}</div> <div class="data-tip">{{ $model.result.Prev.Title }}</div>

View File

@@ -138,6 +138,34 @@
@apply inline-flex items-center justify-center gap-2 rounded-xs border border-slate-300 bg-white px-3 py-1.5 text-base font-semibold text-gray-800 shadow-sm transition-all duration-75 hover:bg-stone-50 focus:outline-none focus:ring-2 focus:ring-slate-400/30; @apply inline-flex items-center justify-center gap-2 rounded-xs border border-slate-300 bg-white px-3 py-1.5 text-base font-semibold text-gray-800 shadow-sm transition-all duration-75 hover:bg-stone-50 focus:outline-none focus:ring-2 focus:ring-slate-400/30;
} }
.header-tabs {
@apply inline-flex items-center gap-1 rounded-md bg-stone-200 p-1 shadow-inner mb-1.5;
}
.header-tab {
@apply inline-flex items-center gap-1 rounded-md px-3 py-1 text-sm font-semibold text-gray-700 no-underline transition-all duration-100;
}
.header-tab:hover {
@apply bg-stone-300 text-slate-900;
}
.header-tab-active {
@apply bg-white text-slate-900 shadow-sm pointer-events-none;
}
.header-tab-active:hover {
@apply bg-white text-slate-900;
}
.header-tab-disabled {
@apply opacity-50 cursor-default;
}
.header-tab-sep {
@apply inline-flex items-center px-1 text-gray-500;
}
.dbform div-menu { .dbform div-menu {
@apply relative inline-block; @apply relative inline-block;
} }