This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
<strong>{{.EntryTime}}</strong>
|
||||
{{if eq .Visibility "public"}}<span class="badge-public">öffentlich</span>{{end}}
|
||||
{{if .Lat}}<small> · ○ {{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}}
|
||||
|
||||
45
backend/internal/api/templates/edit_entry.html
Normal file
45
backend/internal/api/templates/edit_entry.html
Normal 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">◎ 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" .}}
|
||||
Reference in New Issue
Block a user