mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
Abstracted some edit components
This commit is contained in:
14
views/routes/components/_annotation_field.gohtml
Normal file
14
views/routes/components/_annotation_field.gohtml
Normal file
@@ -0,0 +1,14 @@
|
||||
{{- $annotation := index . 0 -}}
|
||||
{{- $label := "Annotation" -}}
|
||||
{{- if gt (len .) 1 -}}
|
||||
{{- if index . 1 -}}
|
||||
{{- $label = index . 1 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
<div class="inputwrapper">
|
||||
<div class="inputlabelrow">
|
||||
<label for="annotation" class="inputlabel">{{ $label }}</label>
|
||||
</div>
|
||||
<textarea name="annotation" id="annotation" class="inputinput" placeholder="" autocomplete="off" rows="2">{{- $annotation -}}</textarea>
|
||||
</div>
|
||||
94
views/routes/components/_linked_items.gohtml
Normal file
94
views/routes/components/_linked_items.gohtml
Normal file
@@ -0,0 +1,94 @@
|
||||
{{- $entries := index . 0 -}}
|
||||
{{- $contents := index . 1 -}}
|
||||
{{- $entryTypes := index . 2 -}}
|
||||
{{- $contentTypes := index . 3 -}}
|
||||
{{- $contentEntries := index . 4 -}}
|
||||
|
||||
<tab-list
|
||||
data-default-index="{{ if gt (len $entries) 0 }}0{{ else if $contents }}{{ if gt (len $contents) 0 }}1{{ end }}{{ end }}"
|
||||
data-disabled-indices="{{ if and (eq (len $entries) 0) (or (not $contents) (eq (len $contents) 0)) }}0,1{{ else if eq (len $entries) 0 }}0{{ else if or (not $contents) (eq (len $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-800 px-2 py-0.5 rounded-sm">{{ len $entries }}</span>
|
||||
</div>
|
||||
{{- if $contents -}}
|
||||
<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-800 px-2 py-0.5 rounded-sm">{{ len $contents }}</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<hr class="border-slate-400 mt-2 mb-3" />
|
||||
<div class="tab-list-panel text-sm text-gray-800 max-h-96 overflow-auto pr-1 pl-0 ml-0">
|
||||
{{- if $entries -}}
|
||||
<ul class="flex flex-col gap-3 pl-0 pr-0 m-0 ml-0 list-none">
|
||||
{{- range $entry := $entries -}}
|
||||
{{- $types := "" -}}
|
||||
{{- if $entryTypes -}}
|
||||
{{- $types = index $entryTypes $entry.Id -}}
|
||||
{{- end -}}
|
||||
<li class="flex items-baseline justify-between gap-3 ml-0 px-1 odd:bg-stone-100">
|
||||
<div class="flex flex-col gap-1">
|
||||
<a href="/almanach/{{ $entry.MusenalmID }}" class="font-bold no-underline hover:text-slate-900">
|
||||
{{- $entry.PreferredTitle -}}
|
||||
</a>
|
||||
{{- if $types -}}
|
||||
<div class="text-xs text-gray-800">
|
||||
{{- range $i, $t := $types -}}
|
||||
{{- if $i }}, {{ end -}}{{ $t -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<span class="text-xs text-gray-500 whitespace-nowrap">Alm {{ $entry.MusenalmID }}</span>
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
{{- else -}}
|
||||
<div class="italic text-gray-500">Keine Bände verknüpft.</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- if $contents -}}
|
||||
<div class="tab-list-panel text-sm text-gray-800 max-h-96 overflow-auto pr-1 pl-0 ml-0 self-stretch">
|
||||
{{- if $contents -}}
|
||||
<ul class="flex flex-col gap-3 pl-0 pr-0 m-0 ml-0 list-none">
|
||||
{{- range $content := $contents -}}
|
||||
{{- $entry := "" -}}
|
||||
{{- if $contentEntries -}}
|
||||
{{- $entry = index $contentEntries $content.Entry -}}
|
||||
{{- end -}}
|
||||
{{- $types := "" -}}
|
||||
{{- if $contentTypes -}}
|
||||
{{- $types = index $contentTypes $content.Id -}}
|
||||
{{- end -}}
|
||||
<li class="flex flex-col gap-1 ml-0 pl-0 odd:bg-stone-100 px-1">
|
||||
<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-800 ">
|
||||
{{- if $types -}}
|
||||
<span>
|
||||
{{- range $i, $t := $types -}}
|
||||
{{- if $i }}, {{ end -}}{{ $t -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- if $entry -}}, in:
|
||||
<span><a href="/almanach/{{ $entry.MusenalmID }}" class="no-underline hover:text-slate-900">{{ $entry.PreferredTitle }}</a></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>
|
||||
{{- end -}}
|
||||
</tab-list>
|
||||
39
views/routes/components/_status_edit.gohtml
Normal file
39
views/routes/components/_status_edit.gohtml
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- $entity := index . 0 -}}
|
||||
{{- $fieldName := index . 1 -}}
|
||||
{{- $fieldId := index . 2 -}}
|
||||
|
||||
<div class="flex flex-col gap-4">
|
||||
<!-- Status -->
|
||||
<div class="inputwrapper">
|
||||
<div class="inputlabelrow">
|
||||
<label for="{{ $fieldId }}" class="inputlabel">Status</label>
|
||||
</div>
|
||||
<select name="{{ $fieldName }}" id="{{ $fieldId }}" autocomplete="off" class="inputselect font-bold">
|
||||
<option value="Unknown" {{ if eq $entity.EditState "Unknown" }}selected{{ end }}>Unbekannt</option>
|
||||
<option value="ToDo" {{ if eq $entity.EditState "ToDo" }}selected{{ end }}>Zu erledigen</option>
|
||||
<option value="Review" {{ if eq $entity.EditState "Review" }}selected{{ end }}>Überprüfen</option>
|
||||
<option value="Seen" {{ if eq $entity.EditState "Seen" }}selected{{ end }}>Autopsiert</option>
|
||||
<option value="Edited" {{ if eq $entity.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 $entity.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">{{- $entity.Comment -}}</textarea>
|
||||
</div>
|
||||
</div-manager>
|
||||
</div>
|
||||
Reference in New Issue
Block a user