summaryrefslogtreecommitdiff
path: root/templates/guestbook.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/guestbook.html')
-rw-r--r--templates/guestbook.html57
1 files changed, 56 insertions, 1 deletions
diff --git a/templates/guestbook.html b/templates/guestbook.html
index 859daaf..f304666 100644
--- a/templates/guestbook.html
+++ b/templates/guestbook.html
@@ -1,3 +1,58 @@
{{ define "content" }}
- <h1>guestbook</h1>
+
+<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 }}