32 lines
1.2 KiB
HTML
32 lines
1.2 KiB
HTML
{{define "diary_form.html"}}
|
|
<div class="diary-form">
|
|
<div class="tui-window tui-no-shadow">
|
|
<fieldset class="tui-fieldset">
|
|
<legend class="center">Journal Entry - {{.Date.Format "January 2, 2006"}}</legend>
|
|
<form
|
|
hx-post="/diary/{{formatDate .Date}}"
|
|
hx-target="this"
|
|
hx-swap="outerHTML">
|
|
<textarea
|
|
name="text"
|
|
class="tui-input full-width"
|
|
rows="8"
|
|
placeholder="Write your thoughts...">{{if .Entry}}{{.Entry.Text}}{{end}}</textarea>
|
|
<div class="form-actions">
|
|
<button type="submit" class="tui-button green-168 white-text">Save</button>
|
|
{{if .Entry}}
|
|
<button
|
|
type="button"
|
|
class="tui-button red-168 white-text"
|
|
hx-delete="/diary/{{formatDate .Date}}"
|
|
hx-confirm="Delete this diary entry?">
|
|
Delete
|
|
</button>
|
|
{{end}}
|
|
</div>
|
|
</form>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
{{end}}
|