aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAlexander Kavon <hawk@alexkavon.com>2023-12-01 00:45:31 -0500
committerAlexander Kavon <hawk@alexkavon.com>2023-12-01 00:45:31 -0500
commitbc47e526e962c1c5bce850de312c6e5fbaf16458 (patch)
treec3a832edf869e75e3fd87494939a34a846778431 /ui
parent17af6e1a5017285b680a7d0a1dace1e1a1612ab9 (diff)
settled on map[string]interface{} for passing data to view, automatically append session struct, fixed nil session checks, updated templates to use map variable names
Diffstat (limited to 'ui')
-rw-r--r--ui/pages/user/me.tmpl.html6
-rw-r--r--ui/templates/messages.tmpl.html4
2 files changed, 5 insertions, 5 deletions
diff --git a/ui/pages/user/me.tmpl.html b/ui/pages/user/me.tmpl.html
index 3f3950c..be66beb 100644
--- a/ui/pages/user/me.tmpl.html
+++ b/ui/pages/user/me.tmpl.html
@@ -1,5 +1,5 @@
-{{ define "title"}}Profile{{end}}
+{{define "title"}}Profile{{end}}
-{{ define "main"}}
-<h1>Welcome, {{.Username}}</h1>
+{{define "main"}}
+<h1>Welcome, {{ .session.Get "username" }}</h1>
{{end}}
diff --git a/ui/templates/messages.tmpl.html b/ui/templates/messages.tmpl.html
index b9d327f..dd5bfb1 100644
--- a/ui/templates/messages.tmpl.html
+++ b/ui/templates/messages.tmpl.html
@@ -1,8 +1,8 @@
{{define "messages"}}
<div id="messages">
- {{ if .Message }}
+ {{ if .message }}
<div class="c-alert c-alert--info" role="alert">
- {{.Message}}
+ {{ .message }}
</div>
{{ end }}
</div>