mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 02:25:30 +00:00
283 lines
12 KiB
Plaintext
283 lines
12 KiB
Plaintext
{{ $model := . }}
|
|
{{ $series := $model.result.Series }}
|
|
|
|
<edit-page>
|
|
<div class="flex container-normal bg-slate-100 mx-auto px-8">
|
|
<div class="flex flex-row w-full justify-between">
|
|
<div class="flex flex-col justify-end-safe flex-2/5">
|
|
<h1 class="text-2xl w-full font-bold text-slate-900 mb-4">
|
|
{{- if $model.is_new -}}
|
|
Neue Reihe
|
|
{{- else -}}
|
|
{{- $series.Title -}}
|
|
{{- end -}}
|
|
{{- if $model.is_new -}}
|
|
<span class="ml-2 text-sm font-semibold text-amber-700 bg-amber-100 px-2 py-0.5 rounded-xs align-middle">Neu</span>
|
|
{{- end -}}
|
|
</h1>
|
|
{{- if not $model.is_new -}}
|
|
<div class="flex flex-row gap-x-3">
|
|
<div>
|
|
<a
|
|
href="/reihe/{{ $series.MusenalmID }}"
|
|
class="text-gray-700 hover:text-slate-950 block no-underline">
|
|
<i class="ri-eye-line"></i> Anschauen
|
|
</a>
|
|
</div>
|
|
·
|
|
<div>
|
|
<a href="/reihe/{{ $series.MusenalmID }}/edit" class="text-gray-700 no-underline hover:text-slate-950 block">
|
|
<i class="ri-loop-left-line"></i> Reset
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
</div>
|
|
{{- if not $model.is_new -}}
|
|
<div class="flex flex-row" id="series-header-data">
|
|
<div class="flex flex-col justify-end gap-y-6 pr-20">
|
|
<div class="">
|
|
<div class="font-bold text-sm">
|
|
<i class="ri-database-2-line"></i> Datenbank-ID
|
|
</div>
|
|
<div class="">{{ $series.Id }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-col justify-end gap-y-6 pr-6">
|
|
<div class="">
|
|
<div class="font-bold text-sm">
|
|
<i class="ri-navigation-line"></i> Navigation
|
|
</div>
|
|
<div class="flex items-center gap-3">
|
|
{{- if $model.result.Prev -}}
|
|
<tool-tip position="top" class="!inline">
|
|
<div class="data-tip">{{ $model.result.Prev.Title }}</div>
|
|
<a
|
|
href="/reihe/{{ $model.result.Prev.MusenalmID }}/edit"
|
|
class="text-gray-700 hover:text-slate-950 no-underline">
|
|
<i class="ri-arrow-left-s-line"></i>
|
|
</a>
|
|
</tool-tip>
|
|
{{- end -}}
|
|
{{- if $model.result.Next -}}
|
|
<tool-tip position="top" class="!inline">
|
|
<div class="data-tip">{{ $model.result.Next.Title }}</div>
|
|
<a
|
|
href="/reihe/{{ $model.result.Next.MusenalmID }}/edit"
|
|
class="text-gray-700 hover:text-slate-950 no-underline">
|
|
<i class="ri-arrow-right-s-line"></i>
|
|
</a>
|
|
</tool-tip>
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex flex-col justify-end gap-y-6 pr-4">
|
|
<div class="">
|
|
<div class="font-bold text-sm mb-1"><i class="ri-calendar-line"></i> Zuletzt bearbeitet</div>
|
|
<div>
|
|
<div class="px-1.5 py-0.5 rounded-xs bg-gray-200 w-fit" id="series-updated-stamp">
|
|
<span id="series-updated-date">{{ GermanDate $series.Updated }}</span>,
|
|
<span id="series-updated-time">{{ GermanTime $series.Updated }}</span>h
|
|
</div>
|
|
<div
|
|
class="px-1.5 py-0.5 rounded-xs mt-1.5 bg-gray-200 w-fit {{ if not $model.result.User }}hidden{{ end }}"
|
|
id="series-updated-user">
|
|
<i class="ri-user-line mr-1"></i>
|
|
<span id="series-updated-user-name">{{- if $model.result.User -}}{{ $model.result.User.Name }}{{- end -}}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container-normal mx-auto mt-4 !px-0">
|
|
{{ template "_usermessage" $model }}
|
|
<form
|
|
class="w-full dbform"
|
|
id="changeseriesform"
|
|
method="POST"
|
|
action="{{ if $model.is_new }}/reihen/new/{{ else }}/reihe/{{ $series.MusenalmID }}/edit{{ end }}"
|
|
{{- if not $model.is_new -}}
|
|
data-delete-endpoint="/reihe/{{ $series.MusenalmID }}/edit/delete"
|
|
{{- end -}}>
|
|
<input type="hidden" name="csrf_token" value="{{ $model.csrf_token }}" />
|
|
<input type="hidden" name="last_edited" value="{{ if not $model.is_new }}{{ $series.Updated }}{{ end }}" />
|
|
|
|
<div class="flex gap-8">
|
|
<div class="flex-1 flex flex-col gap-4">
|
|
<div class="inputwrapper">
|
|
<label for="title" class="inputlabel">Reihentitel</label>
|
|
<textarea name="title" id="title" class="inputinput no-enter" autocomplete="off" rows="1">{{- $series.Title -}}</textarea>
|
|
</div>
|
|
<div class="inputwrapper">
|
|
<label for="pseudonyms" class="inputlabel">Alternativtitel</label>
|
|
<textarea name="pseudonyms" id="pseudonyms" class="inputinput" autocomplete="off" rows="1">{{- $series.Pseudonyms -}}</textarea>
|
|
</div>
|
|
<div class="inputwrapper">
|
|
<label for="annotation" class="inputlabel">Annotation</label>
|
|
<textarea name="annotation" id="annotation" class="inputinput" autocomplete="off" rows="2">{{- $series.Annotation -}}</textarea>
|
|
</div>
|
|
<div class="inputwrapper">
|
|
<label for="references" class="inputlabel">Nachweise</label>
|
|
<textarea name="references" id="references" class="inputinput no-enter" autocomplete="off" rows="1">{{- $series.References -}}</textarea>
|
|
</div>
|
|
<div class="inputwrapper">
|
|
<label for="frequency" class="inputlabel">Erscheinungsfrequenz</label>
|
|
<input name="frequency" id="frequency" class="inputinput" autocomplete="off" value="{{ $series.Frequency }}" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="w-[28rem] shrink-0 flex flex-col gap-3">
|
|
<div class="inputwrapper">
|
|
<label for="status" class="inputlabel">Status</label>
|
|
<select name="status" id="status" autocomplete="off" class="inputselect font-bold">
|
|
<option value="Unknown" {{ if eq $series.EditState "Unknown" }}selected{{ end }}>Unbekannt</option>
|
|
<option value="ToDo" {{ if eq $series.EditState "ToDo" }}selected{{ end }}>Zu erledigen</option>
|
|
<option value="Review" {{ if eq $series.EditState "Review" }}selected{{ end }}>Überprüfen</option>
|
|
<option value="Seen" {{ if eq $series.EditState "Seen" }}selected{{ end }}>Autopsiert</option>
|
|
<option value="Edited" {{ if eq $series.EditState "Edited" }}selected{{ end }}>Vollständig Erfasst</option>
|
|
</select>
|
|
</div>
|
|
<div class="inputwrapper">
|
|
<label for="edit_comment" class="inputlabel">Bearbeitungsvermerk</label>
|
|
<textarea name="edit_comment" id="edit_comment" class="inputinput" autocomplete="off" rows="1">{{- $series.Comment -}}</textarea>
|
|
</div>
|
|
<div class="mt-2">
|
|
<tab-list
|
|
data-default-index="{{ if gt (len $model.result.Entries) 0 }}0{{ else if gt (len $model.result.Contents) 0 }}1{{ end }}"
|
|
data-disabled-indices="{{ if and (eq (len $model.result.Entries) 0) (eq (len $model.result.Contents) 0) }}0,1{{ else if eq (len $model.result.Entries) 0 }}0{{ else if eq (len $model.result.Contents) 0 }}1{{ end }}">
|
|
<div class="flex items-center gap-3 text-sm font-bold text-gray-700">
|
|
<div class="tab-list-head flex items-center gap-2">
|
|
<i class="ri-book-2-line"></i>
|
|
<span>Verknüpfte Bände</span>
|
|
<span class="text-xs bg-stone-200 text-gray-700 px-2 py-0.5 rounded-sm">{{ len $model.result.Entries }}</span>
|
|
</div>
|
|
<div class="tab-list-head flex items-center gap-2">
|
|
<i class="ri-article-line"></i>
|
|
<span>Verknüpfte Inhalte</span>
|
|
<span class="text-xs bg-stone-200 text-gray-700 px-2 py-0.5 rounded-sm">{{ len $model.result.Contents }}</span>
|
|
</div>
|
|
</div>
|
|
<hr class="border-slate-400 mt-2 mb-3" />
|
|
<div class="tab-list-panel text-sm text-gray-700 max-h-96 overflow-auto pr-1 pl-0 ml-0">
|
|
{{- if $model.result.Entries -}}
|
|
<ul class="flex flex-col gap-2 pl-0 pr-0 m-0 ml-0 list-none">
|
|
{{- range $entry := $model.result.Entries -}}
|
|
<li class="flex items-baseline justify-between gap-3 ml-0 pl-0">
|
|
<a href="/almanach/{{ $entry.MusenalmID }}" class="no-underline hover:text-slate-900">
|
|
{{- $entry.PreferredTitle -}}
|
|
</a>
|
|
<span class="text-xs text-gray-500">{{ $entry.Year }}</span>
|
|
</li>
|
|
{{- end -}}
|
|
</ul>
|
|
{{- else -}}
|
|
<div class="italic text-gray-500">Keine Bände verknüpft.</div>
|
|
{{- end -}}
|
|
</div>
|
|
<div class="tab-list-panel text-sm text-gray-700 max-h-96 overflow-auto pr-1 pl-0 ml-0">
|
|
{{- if $model.result.Contents -}}
|
|
<ul class="flex flex-col gap-3 pl-0 pr-0 m-0 ml-0 list-none">
|
|
{{- range $content := $model.result.Contents -}}
|
|
{{- $entry := index $model.result.ContentEntries $content.Entry -}}
|
|
{{- $types := index $model.result.ContentTypes $content.Id -}}
|
|
<li class="flex flex-col gap-1 ml-0 pl-0">
|
|
<a href="/beitrag/{{ $content.MusenalmID }}" class="no-underline hover:text-slate-900 font-semibold">
|
|
{{- if $content.PreferredTitle -}}{{ $content.PreferredTitle }}{{- else -}}Inhalt #{{ $content.MusenalmID }}{{- end -}}
|
|
</a>
|
|
<div class="text-xs text-gray-600 flex flex-wrap gap-3">
|
|
{{- if $entry -}}
|
|
<span>Band: <a href="/almanach/{{ $entry.MusenalmID }}" class="no-underline hover:text-slate-900">{{ $entry.PreferredTitle }}</a></span>
|
|
{{- end -}}
|
|
{{- if $types -}}
|
|
<span>
|
|
Typ:
|
|
{{- range $i, $t := $types -}}
|
|
{{- if $i }}, {{ end -}}{{ $t -}}
|
|
{{- end -}}
|
|
</span>
|
|
{{- end -}}
|
|
{{- if $content.MusenalmPagination -}}
|
|
<span>Seite: {{ $content.MusenalmPagination }}</span>
|
|
{{- end -}}
|
|
</div>
|
|
</li>
|
|
{{- end -}}
|
|
</ul>
|
|
{{- else -}}
|
|
<div class="italic text-gray-500">Keine Inhalte verknüpft.</div>
|
|
{{- end -}}
|
|
</div>
|
|
</tab-list>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="w-full flex items-end justify-between gap-4 mt-6 flex-wrap">
|
|
<p id="series-save-feedback" class="text-sm text-gray-600" aria-live="polite"></p>
|
|
<div class="flex items-center gap-3 self-end flex-wrap">
|
|
<a href="{{ if $model.is_new }}/reihen/{{ else }}/reihe/{{ $series.MusenalmID }}{{ end }}" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
|
<i class="ri-close-line"></i>
|
|
<span>Abbrechen</span>
|
|
</a>
|
|
{{- if not $model.is_new -}}
|
|
<a href="/reihe/{{ $series.MusenalmID }}/edit" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
|
<i class="ri-loop-left-line"></i>
|
|
<span>Reset</span>
|
|
</a>
|
|
<button
|
|
type="button"
|
|
class="resetbutton w-40 flex items-center gap-2 justify-center bg-red-50 text-red-800 hover:bg-red-100 hover:text-red-900"
|
|
data-role="edit-delete">
|
|
<i class="ri-delete-bin-line"></i>
|
|
<span>Reihe löschen</span>
|
|
</button>
|
|
{{- end -}}
|
|
<button type="submit" class="submitbutton w-40 flex items-center gap-2 justify-center">
|
|
<i class="ri-save-line"></i>
|
|
<span>Speichern</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{{- if not $model.is_new -}}
|
|
<dialog data-role="edit-delete-dialog" class="fixed inset-0 m-auto rounded-md border border-slate-200 p-0 shadow-xl backdrop:bg-black/40">
|
|
<div class="p-5 w-[26rem]">
|
|
<div class="text-base font-bold text-gray-900">Reihe löschen?</div>
|
|
<div class="text-sm font-bold text-gray-900 mt-1">{{ $series.Title }}</div>
|
|
<p class="text-sm text-gray-700 mt-2">
|
|
Alle Bände, Inhalte und Verknüpfungen der bevorzugten Reihentitel werden gelöscht.
|
|
</p>
|
|
<div class="mt-3">
|
|
<div class="text-sm font-semibold text-gray-700">Betroffene Bände</div>
|
|
<div class="mt-2 max-h-40 overflow-auto pr-1">
|
|
{{- if $model.result.PreferredEntries -}}
|
|
<ul class="flex flex-col gap-2 pl-0 pr-0 m-0 list-none">
|
|
{{- range $entry := $model.result.PreferredEntries -}}
|
|
<li class="flex items-baseline justify-between gap-3 ml-0 pl-0 text-sm text-gray-700">
|
|
<span>{{ $entry.PreferredTitle }}</span>
|
|
<span class="text-xs text-gray-500">{{ $entry.Year }}</span>
|
|
</li>
|
|
{{- end -}}
|
|
</ul>
|
|
{{- else -}}
|
|
<div class="italic text-gray-500">Keine Bände betroffen.</div>
|
|
{{- end -}}
|
|
</div>
|
|
</div>
|
|
<div class="flex items-center justify-end gap-3 mt-4">
|
|
<button type="button" class="resetbutton w-auto px-3 py-1 text-sm" data-role="edit-delete-cancel">Abbrechen</button>
|
|
<button type="button" class="submitbutton w-auto bg-red-700 hover:bg-red-800 px-3 py-1 text-sm" data-role="edit-delete-confirm">
|
|
Löschen
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</dialog>
|
|
{{- end -}}
|
|
</edit-page>
|