Abstracted some edit components

This commit is contained in:
Simon Martens
2026-01-10 13:40:09 +01:00
parent 86fb5f70b9
commit b8c1dec24f
8 changed files with 185 additions and 308 deletions

View File

@@ -22,15 +22,15 @@ 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">
<div class="mb-3">
<i class="ri-book-line"></i> Almanach
</div>
<h1 class="text-2xl w-full font-bold text-slate-900 mb-4">
{{- if $model.is_new -}}
Almanach
Neuen Almanach anlegen
{{- 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">
@@ -280,12 +280,7 @@ type AlmanachResult struct {
<div id="publication"></div>
<!-- Annotationen -->
<div class="inputwrapper">
<div class="inputlabelrow">
<label for="annotation" class="inputlabel">Annotationen</label>
</div>
<textarea name="annotation" id="annotation" class="inputinput" placeholder="" autocomplete="off" rows="1">{{- $model.result.Entry.Annotation -}}</textarea>
</div>
{{ template "_annotation_field" (Arr $model.result.Entry.Annotation "Annotationen") }}
</div>
</div>
@@ -615,41 +610,7 @@ type AlmanachResult struct {
<!-- Right Column -->
<div class="w-[28rem] shrink-0 flex flex-col gap-3">
<div>
<div class="flex flex-col gap-4">
<!-- Status -->
<div class="inputwrapper">
<div class="inputlabelrow">
<label for="type" class="inputlabel">Status</label>
</div>
<select name="type" id="type" autocomplete="off" class="inputselect font-bold">
<option value="Unknown" {{ if eq $model.result.Entry.EditState "Unknown" }}selected{{ end }}>Unbekannt</option>
<option value="ToDo" {{ if eq $model.result.Entry.EditState "ToDo" }}selected{{ end }}>Zu erledigen</option>
<option value="Review" {{ if eq $model.result.Entry.EditState "Review" }}selected{{ end }}>Überprüfen</option>
<option value="Seen" {{ if eq $model.result.Entry.EditState "Seen" }}selected{{ end }}>Autopsiert</option>
<option value="Edited" {{ if eq $model.result.Entry.EditState "Edited" }}selected{{ end }}>Vollständig Erfasst</option>
</select>
</div>
<!-- Bearbeitungsvermerk -->
<div id="edit_comment_section"></div>
<div-manager dm-target="edit_comment_section">
<button class="dm-menu-button text-right cursor-pointer whitespace-nowrap"><i class="ri-add-line"></i>
Bearbeitungsvermerk hinzufügen</button>
<div class="inputwrapper {{ if eq $model.result.Entry.Comment "" }}hidden{{ end }}">
<div class="inputlabelrow">
<label for="edit_comment" class="inputlabel menu-label">Bearbeitungsvermerk</label>
<div class="pr-2">
<button class="dm-close-button font-bold input-label">
<i class="ri-close-line"></i>
</button>
</div>
</div>
<textarea name="edit_comment" id="edit_comment" class="inputinput" placeholder="" autocomplete="off" rows="1">{{- $model.result.Entry.Comment -}}</textarea>
</div>
</div-manager>
</div>
{{ template "_status_edit" (Arr $model.result.Entry "type" "type") }}
</div>
<div>