46 lines
2.0 KiB
HTML
46 lines
2.0 KiB
HTML
{{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">◎ 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" .}}
|