mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
+some small frontend annoyances
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
<div class="mt-8">
|
||||
{{- range $i, $c := $model.result.Contents -}}
|
||||
{{- $rels := index $model.result.ContentsAgents $c.Id -}}
|
||||
{{- template "_content" Arr $c $model.result.Entry $rels $model.result.Agents -}}
|
||||
{{- template "_content" Arr $c $model.result.Entry $rels $model.result.Agents false false false $model.request -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -185,8 +185,8 @@
|
||||
<span>Neuer Beitrag</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mx-4 mt-2 rounded-md border border-slate-200 bg-white flex flex-col overflow-hidden" data-role="contents-panel">
|
||||
<div class="flex-1 min-h-0 overflow-y-auto">
|
||||
<div class="mx-4 mt-2 rounded-md border border-slate-300 bg-white flex flex-col overflow-hidden p-1" data-role="contents-panel">
|
||||
<div class="flex-1 min-h-0 overflow-y-scroll">
|
||||
<div class="flex flex-col gap-0"
|
||||
data-role="contents-list"
|
||||
data-order-endpoint="/almanach/{{ $model.result.Entry.MusenalmID }}/contents/edit">
|
||||
@@ -562,12 +562,26 @@
|
||||
});
|
||||
};
|
||||
|
||||
const setContentsPanelHeight = () => {
|
||||
const panel = document.querySelector("[data-role='contents-panel']");
|
||||
if (!panel) {
|
||||
return;
|
||||
}
|
||||
const rect = panel.getBoundingClientRect();
|
||||
const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
|
||||
const bottomGap = 16;
|
||||
const available = Math.max(200, viewportHeight - rect.top - bottomGap);
|
||||
panel.style.height = `${available}px`;
|
||||
};
|
||||
|
||||
const initPage = () => {
|
||||
list = document.querySelector("[data-role='contents-list']");
|
||||
if (!list) {
|
||||
return;
|
||||
}
|
||||
|
||||
setContentsPanelHeight();
|
||||
|
||||
const getItems = () => Array.from(list.querySelectorAll("[data-role='content-item']"));
|
||||
if (getItems().length === 0) {
|
||||
return;
|
||||
@@ -903,4 +917,10 @@
|
||||
initPage();
|
||||
}
|
||||
});
|
||||
if (!window.__contentsPanelResizeBound) {
|
||||
window.__contentsPanelResizeBound = true;
|
||||
window.addEventListener("resize", () => {
|
||||
setContentsPanelHeight();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -34,7 +34,15 @@
|
||||
</div>
|
||||
|
||||
<div class="container-normal mt-12 flex flex-col font-serif">
|
||||
<div class="font-sans mb-1"><i class="ri-article-line"></i> Einzelbeitrag</div>
|
||||
<div class="font-sans mb-1 flex items-center gap-2">
|
||||
<div><i class="ri-article-line"></i> Einzelbeitrag</div>
|
||||
{{- if (IsAdminOrEditor $model.request.user) -}}
|
||||
<div>
|
||||
· <i class="ri-edit-line"></i>
|
||||
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/contents/{{- $model.result.Content.MusenalmID -}}/edit">Bearbeiten</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<h1 class="text-3xl font-bold">
|
||||
{{ $model.result.Entry.PreferredTitle }},
|
||||
{{ if $model.result.Content.Extent -}}
|
||||
|
||||
@@ -58,14 +58,23 @@
|
||||
{{- $searchparameters := false -}}
|
||||
{{- if gt (len .) 6 -}}
|
||||
{{- $searchparameters = index . 6 -}}
|
||||
{{- if or (eq (printf "%T" $searchparameters) "bool") (eq (printf "%T" $searchparameters) "<nil>") -}}
|
||||
{{- $searchparameters = false -}}
|
||||
{{- end -}}
|
||||
{{- if $searchparameters -}}
|
||||
{{- $isAlm = $searchparameters.AlmString -}}
|
||||
{{- $isTitle = or $searchparameters.Title $searchparameters.TitleString -}}
|
||||
{{- $isYear = or $searchparameters.Year $searchparameters.YearString -}}
|
||||
{{- $isPerson = or $searchparameters.Persons $searchparameters.PersonsString -}}
|
||||
{{- $isAnnotation = or $searchparameters.Annotations $searchparameters.AnnotationsString -}}
|
||||
{{- $isIncipit = or $searchparameters.Incipit $searchparameters.IncipitString -}}
|
||||
{{- $isEntry = or $searchparameters.Entry $searchparameters.EntryString -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $isAlm = $searchparameters.AlmString -}}
|
||||
{{- $isTitle = or $searchparameters.Title $searchparameters.TitleString -}}
|
||||
{{- $isYear = or $searchparameters.Year $searchparameters.YearString -}}
|
||||
{{- $isPerson = or $searchparameters.Persons $searchparameters.PersonsString -}}
|
||||
{{- $isAnnotation = or $searchparameters.Annotations $searchparameters.AnnotationsString -}}
|
||||
{{- $isIncipit = or $searchparameters.Incipit $searchparameters.IncipitString -}}
|
||||
{{- $isEntry = or $searchparameters.Entry $searchparameters.EntryString -}}
|
||||
{{- $request := false -}}
|
||||
{{- if gt (len .) 7 -}}
|
||||
{{- $request = index . 7 -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -204,12 +213,19 @@
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<div class="font-sans py-0.5 text-sm">
|
||||
<div class="font-sans py-0.5 text-sm flex flex-col items-end gap-1">
|
||||
<a
|
||||
href="/beitrag/{{ $content.MusenalmID }}"
|
||||
class="no-underline rounded bg-stone-100 px-1.5">
|
||||
Link <i class="ri-links-line"></i>
|
||||
</a>
|
||||
{{- if and $request (IsAdminOrEditor $request.user) -}}
|
||||
<a
|
||||
href="/almanach/{{- $entry.MusenalmID -}}/contents/{{- $content.MusenalmID -}}/edit"
|
||||
class="no-underline rounded bg-stone-100 px-1.5">
|
||||
<i class="ri-edit-line"></i> Bearbeiten
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
{{- if (IsAdminOrEditor $request.user) -}}
|
||||
<a href="/reihe/{{ $r.MusenalmID }}/edit" class="no-underline rounded bg-stone-100 px-1.5">
|
||||
<i class="ri-edit-line"></i>
|
||||
Edit
|
||||
Bearbeiten
|
||||
</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user