Initial implementation

This commit is contained in:
2025-12-10 11:10:52 +01:00
parent cff9defc4a
commit 4cb97a25ba
26 changed files with 2714 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
{{define "diary_form.html"}}
<div class="diary-form">
<h3>Journal Entry - {{.Date.Format "January 2, 2006"}}</h3>
<form
hx-post="/diary/{{formatDate .Date}}"
hx-target="this"
hx-swap="outerHTML">
<textarea
name="text"
rows="8"
placeholder="Write your thoughts...">{{if .Entry}}{{.Entry.Text}}{{end}}</textarea>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
{{if .Entry}}
<button
type="button"
class="btn btn-danger"
hx-delete="/diary/{{formatDate .Date}}"
hx-confirm="Delete this diary entry?">
Delete
</button>
{{end}}
</div>
</form>
</div>
{{end}}