mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
Basic new
This commit is contained in:
@@ -2593,6 +2593,10 @@ class Gt extends HTMLElement {
|
||||
const n = (s == null ? void 0 : s.error) || `Speichern fehlgeschlagen (${i.status}).`;
|
||||
throw new Error(n);
|
||||
}
|
||||
if (s != null && s.redirect) {
|
||||
window.location.assign(s.redirect);
|
||||
return;
|
||||
}
|
||||
await this._reloadForm((s == null ? void 0 : s.message) || "Änderungen gespeichert."), this._clearStatus();
|
||||
} catch (i) {
|
||||
this._showStatus(i instanceof Error ? i.message : "Speichern fehlgeschlagen.", "error");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -22,47 +22,59 @@ type AlmanachResult struct {
|
||||
<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">{{ $model.result.Entry.PreferredTitle }}</h1>
|
||||
<div class="flex flex-row gap-x-3">
|
||||
<div>
|
||||
<a
|
||||
href="/almanach/{{ $model.result.Entry.MusenalmID }}"
|
||||
class="text-gray-700
|
||||
hover:text-slate-950 block no-underline">
|
||||
<i class="ri-eye-line"></i> Anschauen
|
||||
</a>
|
||||
</div>
|
||||
·
|
||||
<div class="flex flex-row">
|
||||
{{- if $model.result.Prev -}}
|
||||
<div>
|
||||
<a href="/almanach/{{ $model.result.Prev.MusenalmID }}/edit" class="text-gray-700 hover:text-slate-950 no-underline block ">
|
||||
<i class="ri-arrow-left-s-line"></i>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
<div class="px-1.5 py-0.5 rounded-xs bg-gray-200 w-fit font-bold">
|
||||
{{ $model.result.Entry.MusenalmID }}
|
||||
<tool-tip position="right" class="!inline">
|
||||
<div class="data-tip">Die Alm-Nr ist Teil der URL und wird automatisch vergeben.</div>
|
||||
<i class="ri-information-line"></i>
|
||||
</tool-tip>
|
||||
<h1 class="text-2xl w-full font-bold text-slate-900 mb-4">
|
||||
{{- if $model.is_new -}}
|
||||
Neuer Almanach
|
||||
{{- else -}}
|
||||
{{- $model.result.Entry.PreferredTitle -}}
|
||||
{{- 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="/almanach/{{ $model.result.Entry.MusenalmID }}"
|
||||
class="text-gray-700
|
||||
hover:text-slate-950 block no-underline">
|
||||
<i class="ri-eye-line"></i> Anschauen
|
||||
</a>
|
||||
</div>
|
||||
{{- if $model.result.Next -}}
|
||||
<div>
|
||||
<a href="/almanach/{{ $model.result.Next.MusenalmID }}/edit" class="text-gray-700 hover:text-slate-950 block no-underline"><i class="ri-arrow-right-s-line"></i></a>
|
||||
·
|
||||
<div class="flex flex-row">
|
||||
{{- if $model.result.Prev -}}
|
||||
<div>
|
||||
<a href="/almanach/{{ $model.result.Prev.MusenalmID }}/edit" class="text-gray-700 hover:text-slate-950 no-underline block ">
|
||||
<i class="ri-arrow-left-s-line"></i>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
<div class="px-1.5 py-0.5 rounded-xs bg-gray-200 w-fit font-bold">
|
||||
{{ $model.result.Entry.MusenalmID }}
|
||||
<tool-tip position="right" class="!inline">
|
||||
<div class="data-tip">Die Alm-Nr ist Teil der URL und wird automatisch vergeben.</div>
|
||||
<i class="ri-information-line"></i>
|
||||
</tool-tip>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- if $model.result.Next -}}
|
||||
<div>
|
||||
<a href="/almanach/{{ $model.result.Next.MusenalmID }}/edit" class="text-gray-700 hover:text-slate-950 block no-underline"><i class="ri-arrow-right-s-line"></i></a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
·
|
||||
<div>
|
||||
<a href="/almanach/{{- $model.result.Entry.MusenalmID -}}/edit" class="text-gray-700
|
||||
no-underline hover:text-slate-950 block ">
|
||||
<i class="ri-loop-left-line"></i> Reset
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
·
|
||||
<div>
|
||||
<a href="/almanach/{{- $model.result.Entry.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="almanach-header-data">
|
||||
<div class="flex flex-col justify-end gap-y-6 pr-20">
|
||||
<div class="">
|
||||
@@ -94,6 +106,7 @@ type AlmanachResult struct {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -105,10 +118,12 @@ type AlmanachResult struct {
|
||||
x-target="changealmanachform user-message almanach-header-data"
|
||||
hx-boost="false"
|
||||
method="POST"
|
||||
data-save-endpoint="/almanach/{{ $model.result.Entry.MusenalmID }}/edit/save"
|
||||
data-delete-endpoint="/almanach/{{ $model.result.Entry.MusenalmID }}/edit/delete">
|
||||
data-save-endpoint="{{ if $model.is_new }}/almanach-new/save{{ else }}/almanach/{{ $model.result.Entry.MusenalmID }}/edit/save{{ end }}"
|
||||
{{- if not $model.is_new -}}
|
||||
data-delete-endpoint="/almanach/{{ $model.result.Entry.MusenalmID }}/edit/delete"
|
||||
{{- end -}}>
|
||||
<input type="hidden" name="csrf_token" value="{{ $model.csrf_token }}" />
|
||||
<input type="hidden" name="last_edited" value="{{ $model.result.Entry.Updated }}" />
|
||||
<input type="hidden" name="last_edited" value="{{ if not $model.is_new }}{{ $model.result.Entry.Updated }}{{ end }}" />
|
||||
|
||||
<div class="flex gap-8">
|
||||
<!-- Left Column -->
|
||||
@@ -246,7 +261,7 @@ type AlmanachResult struct {
|
||||
<div class="flex gap-4">
|
||||
<div class="flex-1 inputwrapper">
|
||||
<label for="year" class="inputlabel">Jahr</label>
|
||||
<input type="number" name="year" id="year" class="inputinput" placeholder="" autocomplete="off" value="{{ $model.result.Entry.Year }}" />
|
||||
<input type="number" name="year" id="year" class="inputinput" placeholder="" autocomplete="off" value="{{ if not $model.is_new }}{{ $model.result.Entry.Year }}{{ end }}" />
|
||||
</div>
|
||||
|
||||
<div class="flex-1 inputwrapper">
|
||||
@@ -889,45 +904,49 @@ type AlmanachResult struct {
|
||||
<div class="w-full flex items-end justify-between gap-4 mt-6 flex-wrap">
|
||||
<p id="almanach-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="/almanach/{{ $model.result.Entry.MusenalmID }}" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<a href="{{ if $model.is_new }}/suche/baende{{ else }}/almanach/{{ $model.result.Entry.MusenalmID }}{{ end }}" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<i class="ri-close-line"></i>
|
||||
<span>Abbrechen</span>
|
||||
</a>
|
||||
<button type="button" class="resetbutton w-40 flex items-center gap-2 justify-center" data-role="almanach-reset">
|
||||
<i class="ri-loop-left-line"></i>
|
||||
<span>Reset</span>
|
||||
</button>
|
||||
<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="almanach-delete">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
<span>Eintrag löschen</span>
|
||||
</button>
|
||||
{{- if not $model.is_new -}}
|
||||
<button type="button" class="resetbutton w-40 flex items-center gap-2 justify-center" data-role="almanach-reset">
|
||||
<i class="ri-loop-left-line"></i>
|
||||
<span>Reset</span>
|
||||
</button>
|
||||
<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="almanach-delete">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
<span>Eintrag löschen</span>
|
||||
</button>
|
||||
{{- end -}}
|
||||
<button type="button" class="submitbutton w-40 flex items-center gap-2 justify-center" data-role="almanach-save">
|
||||
<i class="ri-save-line"></i>
|
||||
<span>Speichern</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<dialog data-role="almanach-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-[22rem]">
|
||||
<div class="text-base font-bold text-gray-900">Eintrag löschen?</div>
|
||||
<div class="text-sm font-bold text-gray-900 mt-1">{{ $model.result.Entry.PreferredTitle }}</div>
|
||||
<p class="text-sm text-gray-700 mt-2">
|
||||
Der Eintrag wird dauerhaft gelöscht. Verknüpfungen, Exemplare und Inhalte werden entfernt.
|
||||
</p>
|
||||
<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="almanach-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="almanach-delete-confirm">
|
||||
Löschen
|
||||
</button>
|
||||
{{- if not $model.is_new -}}
|
||||
<dialog data-role="almanach-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-[22rem]">
|
||||
<div class="text-base font-bold text-gray-900">Eintrag löschen?</div>
|
||||
<div class="text-sm font-bold text-gray-900 mt-1">{{ $model.result.Entry.PreferredTitle }}</div>
|
||||
<p class="text-sm text-gray-700 mt-2">
|
||||
Der Eintrag wird dauerhaft gelöscht. Verknüpfungen, Exemplare und Inhalte werden entfernt.
|
||||
</p>
|
||||
<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="almanach-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="almanach-delete-confirm">
|
||||
Löschen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
</dialog>
|
||||
{{- end -}}
|
||||
</form>
|
||||
</div>
|
||||
</almanach-edit-page>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{{ $model := . }}
|
||||
<title>
|
||||
{{ if $model.result }}
|
||||
{{ if $model.is_new }}
|
||||
Neuer Almanach - Musenalm
|
||||
{{ else if $model.result }}
|
||||
Bearbeiten: {{ $model.result.Entry.PreferredTitle }} - Musenalm
|
||||
{{ else }}
|
||||
Neuer Almanach - Musenalm
|
||||
|
||||
@@ -5,23 +5,35 @@
|
||||
<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">{{ $agent.Name }}</h1>
|
||||
<div class="flex flex-row gap-x-3">
|
||||
<div>
|
||||
<a
|
||||
href="/person/{{ $agent.Id }}"
|
||||
class="text-gray-700 hover:text-slate-950 block no-underline">
|
||||
<i class="ri-eye-line"></i> Anschauen
|
||||
</a>
|
||||
<h1 class="text-2xl w-full font-bold text-slate-900 mb-4">
|
||||
{{- if $model.is_new -}}
|
||||
Neue Person
|
||||
{{- else -}}
|
||||
{{- $agent.Name -}}
|
||||
{{- 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="/person/{{ $agent.Id }}"
|
||||
class="text-gray-700 hover:text-slate-950 block no-underline">
|
||||
<i class="ri-eye-line"></i> Anschauen
|
||||
</a>
|
||||
</div>
|
||||
·
|
||||
<div>
|
||||
<a href="/person/{{ $agent.Id }}/edit" class="text-gray-700 no-underline hover:text-slate-950 block">
|
||||
<i class="ri-loop-left-line"></i> Reset
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
·
|
||||
<div>
|
||||
<a href="/person/{{ $agent.Id }}/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="person-header-data">
|
||||
<div class="flex flex-col justify-end gap-y-6 pr-20">
|
||||
<div class="">
|
||||
@@ -78,6 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -87,9 +100,9 @@
|
||||
class="w-full dbform"
|
||||
id="changepersonform"
|
||||
method="POST"
|
||||
action="/person/{{ $agent.Id }}/edit">
|
||||
action="{{ if $model.is_new }}/personen/new/{{ else }}/person/{{ $agent.Id }}/edit{{ end }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ $model.csrf_token }}" />
|
||||
<input type="hidden" name="last_edited" value="{{ $agent.Updated }}" />
|
||||
<input type="hidden" name="last_edited" value="{{ if not $model.is_new }}{{ $agent.Updated }}{{ end }}" />
|
||||
|
||||
<div class="flex gap-8">
|
||||
<div class="flex-1 flex flex-col gap-4">
|
||||
@@ -236,14 +249,16 @@
|
||||
<div class="w-full flex items-end justify-between gap-4 mt-6 flex-wrap">
|
||||
<p id="person-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="/person/{{ $agent.Id }}" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<a href="{{ if $model.is_new }}/personen/{{ else }}/person/{{ $agent.Id }}{{ end }}" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<i class="ri-close-line"></i>
|
||||
<span>Abbrechen</span>
|
||||
</a>
|
||||
<a href="/person/{{ $agent.Id }}/edit" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<i class="ri-loop-left-line"></i>
|
||||
<span>Reset</span>
|
||||
</a>
|
||||
{{- if not $model.is_new -}}
|
||||
<a href="/person/{{ $agent.Id }}/edit" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<i class="ri-loop-left-line"></i>
|
||||
<span>Reset</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
<button type="submit" class="submitbutton w-40 flex items-center gap-2 justify-center">
|
||||
<i class="ri-save-line"></i>
|
||||
<span>Speichern</span>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{{ $model := . }}
|
||||
<title>
|
||||
{{- if $model.result -}}
|
||||
{{- if $model.is_new -}}
|
||||
Neue Person - Musenalm
|
||||
{{- else if $model.result -}}
|
||||
Bearbeiten: {{ $model.result.Agent.Name }} - Musenalm
|
||||
{{- else -}}
|
||||
Person bearbeiten - Musenalm
|
||||
|
||||
@@ -21,4 +21,12 @@
|
||||
</span>
|
||||
<span x-show="search"> Suche · Alle Personen & Körperschaften </span>
|
||||
</h1>
|
||||
{{- if (IsAdminOrEditor $model.request.user) -}}
|
||||
<div class="ml-24 -mt-4">
|
||||
<a href="/personen/new/" class="inline-flex items-center gap-2 text-sm font-bold text-gray-700 hover:text-slate-950 no-underline">
|
||||
<i class="ri-add-line"></i>
|
||||
<span>Neu</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -5,23 +5,35 @@
|
||||
<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">{{ $series.Title }}</h1>
|
||||
<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>
|
||||
<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>
|
||||
·
|
||||
<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="">
|
||||
@@ -78,6 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -87,10 +100,12 @@
|
||||
class="w-full dbform"
|
||||
id="changeseriesform"
|
||||
method="POST"
|
||||
action="/reihe/{{ $series.MusenalmID }}/edit"
|
||||
data-delete-endpoint="/reihe/{{ $series.MusenalmID }}/edit/delete">
|
||||
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="{{ $series.Updated }}" />
|
||||
<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">
|
||||
@@ -205,21 +220,23 @@
|
||||
<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="/reihe/{{ $series.MusenalmID }}" class="resetbutton w-40 flex items-center gap-2 justify-center">
|
||||
<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>
|
||||
<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>
|
||||
{{- 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>
|
||||
@@ -228,36 +245,38 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<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 -}}
|
||||
{{- 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>
|
||||
<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>
|
||||
</dialog>
|
||||
{{- end -}}
|
||||
</edit-page>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{{ $model := . }}
|
||||
<title>
|
||||
{{- if $model.result -}}
|
||||
{{- if $model.is_new -}}
|
||||
Neue Reihe - Musenalm
|
||||
{{- else if $model.result -}}
|
||||
Bearbeiten: {{ $model.result.Series.Title }} - Musenalm
|
||||
{{- else -}}
|
||||
Reihe bearbeiten - Musenalm
|
||||
|
||||
@@ -47,6 +47,14 @@
|
||||
<!-- INFO: 2. Header -->
|
||||
<div id="pageheading" class="headingcontainer">
|
||||
<h1 class="heading">Bände nach Reihentiteln</h1>
|
||||
{{- if (IsAdminOrEditor $model.request.user) -}}
|
||||
<div class="mt-2">
|
||||
<a href="/reihen/new/" class="inline-flex items-center gap-2 text-sm font-bold text-gray-700 hover:text-slate-950 no-underline">
|
||||
<i class="ri-add-line"></i>
|
||||
<span>Neu</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{ template "notifier" $model }}
|
||||
|
||||
{{ if not (or .search .hidden) }}
|
||||
|
||||
@@ -68,6 +68,14 @@
|
||||
|
||||
<div id="searchcontrol" class="container-normal">
|
||||
{{- template "_heading" $model.parameters -}}
|
||||
{{- if (IsAdminOrEditor $model.request.user) -}}
|
||||
<div class="mt-2">
|
||||
<a href="/almanach-new/" class="inline-flex items-center gap-2 text-sm font-bold text-gray-700 hover:text-slate-950 no-underline">
|
||||
<i class="ri-add-line"></i>
|
||||
<span>Neu</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
<div id="searchform" class="border-l border-zinc-300 px-8 py-10 relative">
|
||||
{{- if not $model.parameters.Extended -}}
|
||||
{{- template "_musenalmidbox" Arr $model.parameters.AlmString "baende" -}}
|
||||
|
||||
@@ -199,6 +199,11 @@ export class AlmanachEditPage extends HTMLElement {
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
if (data?.redirect) {
|
||||
window.location.assign(data.redirect);
|
||||
return;
|
||||
}
|
||||
|
||||
await this._reloadForm(data?.message || "Änderungen gespeichert.");
|
||||
this._clearStatus();
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user