hatecomputers.club/templates/guestbook.html

57 lines
1.5 KiB
HTML

{{ define "content" }}
<form action="/guestbook" method="post" class="form">
<h1>sign the guestboooook!!!!</h1>
<p>leave a message for the world to see (keep it civil plz and no spam >:3).</p>
<hr>
<label for="name">name.</label>
<input type="text" id="name" name="name" class="form-control"
{{ if not .EntryForm }}
placeholder="john doe"
{{ else }}
value="{{ .EntryForm.Name }}"
{{ end }}
required>
<label for="message">message.</label>
<textarea id="message" name="message" class="form-control"
{{ if not .EntryForm }}
placeholder="hoi!"
{{ end }}
>{{ if .EntryForm }}{{ .EntryForm.Message }}{{ end }}</textarea>
<div
class="h-captcha"
data-sitekey="{{ .HcaptchaArgs.SiteKey }}"
data-theme="dark"
></div>
<br>
<button type="submit" class="btn btn-primary">sign.</button>
<br>
{{ if .FormError }}
{{ if (len .FormError.Errors) }}
{{ range $error := .FormError.Errors }}
<div class="error">{{ $error }}</div>
{{ end }}
{{ end }}
{{ end }}
</form>
<hr>
{{ if (eq (len .GuestbookEntries) 0) }}
<div class="blinky">no entries yet.</div>
{{ else }}
<h1>peeps that said hi.</h1>
<br>
{{ range .GuestbookEntries }}
<div class="entry">
<div>name: <span class="entry-name">{{ .Name }}</span></div>
<div class="time">{{ .CreatedAt }}</div>
<div class="entry-message">{{ .Message }}</div>
</div>
{{ end }}
{{ end }}
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
{{ end }}