+person delete endpond, BUGFIX: some visual inconistencies

This commit is contained in:
Simon Martens
2026-01-11 09:27:57 +01:00
parent 4c2fcb991f
commit 5ac7042c8d
10 changed files with 241 additions and 86 deletions

View File

@@ -104,7 +104,10 @@
class="w-full dbform"
id="changepersonform"
method="POST"
action="{{ if $model.is_new }}/personen/new/{{ else }}/person/{{ $agent.Id }}/edit{{ end }}">
action="{{ if $model.is_new }}/personen/new/{{ else }}/person/{{ $agent.Id }}/edit{{ end }}"
{{- if not $model.is_new -}}
data-delete-endpoint="/person/{{ $agent.Id }}/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 }}{{ $agent.Updated }}{{ end }}" />
@@ -186,6 +189,13 @@
<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>Person 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>
@@ -193,6 +203,26 @@
</button>
</div>
</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-[22rem]">
<div class="text-base font-bold text-gray-900">Person löschen?</div>
<div class="text-sm font-bold text-gray-900 mt-1">{{ $agent.Name }}</div>
<p class="text-sm text-gray-700 mt-2">
Die Person wird dauerhaft gelöscht. Verknüpfungen zu Bänden und Beiträgen 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="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 -}}
</form>
</div>
</edit-page>