summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/api_keys.html7
-rw-r--r--templates/base.html15
-rw-r--r--templates/dns.html14
-rw-r--r--templates/guestbook.html9
-rw-r--r--templates/home.html18
-rw-r--r--templates/profile.html24
6 files changed, 56 insertions, 31 deletions
diff --git a/templates/api_keys.html b/templates/api_keys.html
index cd4d274..018fda3 100644
--- a/templates/api_keys.html
+++ b/templates/api_keys.html
@@ -28,12 +28,5 @@
<h2>generate key.</h2>
<hr>
<input type="submit" value="generate." />
- {{ if .FormError }}
- {{ if (len .FormError.Errors) }}
- {{ range $error := .FormError.Errors }}
- <div class="error">{{ $error }}</div>
- {{ end }}
- {{ end }}
- {{ end }}
</form>
{{ end }}
diff --git a/templates/base.html b/templates/base.html
index 9f5a903..89d6dd2 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -37,7 +37,9 @@
<span> | </span>
<a href="/keys">api keys.</a>
<span> | </span>
- <a href="/logout">logout, {{ .User.DisplayName }}.</a>
+ <a href="/profile">{{ .User.DisplayName }}.</a>
+ <span> | </span>
+ <a href="/logout">logout.</a>
{{ else }}
<a href="/login">login.</a>
@@ -46,6 +48,17 @@
<hr>
<div id="content">
+ {{ if and .Success (gt (len .Success.Messages) 0) }}
+ {{ range $message := .Success.Messages }}
+ <div class="info success">{{ $message }}</div>
+ {{ end }}
+ {{ end }}
+ {{ if and .Error (gt (len .Error.Messages) 0) }}
+ {{ range $error := .Error.Messages }}
+ <div class="info error">{{ $error }}</div>
+ {{ end }}
+ {{ end }}
+
{{ template "content" . }}
</div>
diff --git a/templates/dns.html b/templates/dns.html
index d16ed89..2f3f0a7 100644
--- a/templates/dns.html
+++ b/templates/dns.html
@@ -76,18 +76,6 @@
{{ end }}
/>
</label>
-
-
- <input type="submit" value="Add" />
-
- {{ if .FormError }}
- {{ if (len .FormError.Errors) }}
- {{ range $error := .FormError.Errors }}
- <div class="error">{{ $error }}</div>
- {{ end }}
- {{ end }}
- {{ end }}
+ <input type="submit" value="add." />
</form>
-
-
{{ end }}
diff --git a/templates/guestbook.html b/templates/guestbook.html
index 85727c7..d1f4417 100644
--- a/templates/guestbook.html
+++ b/templates/guestbook.html
@@ -21,18 +21,9 @@
<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>
diff --git a/templates/home.html b/templates/home.html
index 1c03377..76bbc6a 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -1,3 +1,19 @@
{{ define "content" }}
- <p class="blinky">under construction!</p>
+<h2 class="blinky">hello there!</h2>
+<p>current peeps in the club :D</p>
+<div class="club-members">
+ {{ range $user := .Users }}
+ <div class="club-member">
+ <div class="avatar">
+ <div style="background-image: url('{{ $user.Avatar }}')"></div>
+ </div>
+ <div class="about">
+ <div>name: {{ $user.Username }}</div>
+ <div>pronouns: {{ $user.Pronouns }}</div>
+ <div><a href="{{ $user.Website }}">{{ $user.Website }}</a></div>
+ <div class="club-bio">{{ $user.Bio }}</div>
+ </div>
+ </div>
+ {{ end }}
+</div>
{{ end }}
diff --git a/templates/profile.html b/templates/profile.html
new file mode 100644
index 0000000..a6e1b68
--- /dev/null
+++ b/templates/profile.html
@@ -0,0 +1,24 @@
+{{ define "content" }}
+
+<h1>hey {{ .Profile.DisplayName }}</h1>
+<br>
+<form action="/profile" method="POST" class="form" enctype="multipart/form-data">
+ <label for="file" class="file-upload">avatar.</label>
+ <input type="file" name="avatar">
+
+ <label for="location">location.</label>
+ <input type="text" name="location" value="{{ .Profile.Location }}">
+
+ <label for="website">website.</label>
+ <input type="text" name="website" value="{{ .Profile.Website }}">
+
+ <label for="pronouns">pronouns.</label>
+ <input type="text" name="pronouns" value="{{ .Profile.Pronouns }}">
+
+ <label for="bio">bio.</label>
+ <textarea name="bio">{{ .Profile.Bio }}</textarea>
+
+ <input type="submit" value="update">
+</form>
+
+{{ end }}