edit added
All checks were successful
Deploy to NAS / deploy (push) Successful in 1m51s

This commit is contained in:
Christoph K.
2026-04-09 22:25:31 +02:00
parent fa76787d7b
commit b73d91ccaa
6 changed files with 201 additions and 1 deletions

View File

@@ -35,6 +35,7 @@
<strong>{{.EntryTime}}</strong>
{{if eq .Visibility "public"}}<span class="badge-public">öffentlich</span>{{end}}
{{if .Lat}}<small> · &#9675; {{printf "%.5f" (deref .Lat)}}, {{printf "%.5f" (deref .Lon)}}</small>{{end}}
<a href="/entries/{{.EntryID}}/edit" class="entry-edit">bearbeiten</a>
</div>
{{if .Title}}<div class="entry-title">{{.Title}}</div>{{end}}
{{if .Description}}<div class="entry-desc">{{.Description}}</div>{{end}}

View File

@@ -0,0 +1,45 @@
{{define "title"}}Eintrag bearbeiten{{end}}
{{define "content"}}
<main class="container">
<nav><a href="/days/{{.Entry.EntryDate}}">← {{.Entry.EntryDate}}</a></nav>
<h1>Eintrag bearbeiten</h1>
<form method="post" action="/entries/{{.Entry.EntryID}}" enctype="multipart/form-data">
<div class="gps-row">
<input type="time" name="time" required value="{{.Entry.EntryTime}}">
<select name="visibility">
<option value="private"{{if eq .Entry.Visibility "private"}} selected{{end}}>Privat</option>
<option value="public"{{if eq .Entry.Visibility "public"}} selected{{end}}>Öffentlich</option>
</select>
</div>
<input type="text" name="title" placeholder="Überschrift" value="{{.Entry.Title}}">
<textarea name="description" rows="4" placeholder="Beschreibung">{{.Entry.Description}}</textarea>
<div class="gps-row">
<input type="number" name="lat" id="entry-lat" step="any" placeholder="Breite"{{if .Entry.Lat}} value="{{printf "%.6f" (deref .Entry.Lat)}}"{{end}}>
<input type="number" name="lon" id="entry-lon" step="any" placeholder="Länge"{{if .Entry.Lon}} value="{{printf "%.6f" (deref .Entry.Lon)}}"{{end}}>
<button type="button" id="btn-gps">&#9678; GPS</button>
</div>
<small id="gps-status"></small>
<input type="text" name="hashtags" placeholder="Hashtags (kommagetrennt)" value="{{join .Entry.Hashtags ", "}}">
{{if .Entry.Images}}
<div class="entry-images" style="margin-bottom:.5rem">
{{range .Entry.Images}}
<a href="/uploads/{{.Filename}}" target="_blank">
<img src="/uploads/{{.Filename}}" alt="{{.OriginalName}}" class="thumb">
</a>
{{end}}
</div>
{{end}}
<input type="file" name="images" multiple accept="image/*" id="image-input">
<div id="image-preview" class="image-preview"></div>
<button type="submit">Speichern</button>
</form>
</main>
{{end}}
{{define "scripts"}}
<script src="/static/day.js"></script>
{{end}}
{{template "base" .}}