Add created time for users to admin page
alex wennerberg alex@alexwennerberg.com
Mon, 01 Feb 2021 21:58:41 -0800
3 files changed,
5 insertions(+),
2 deletions(-)
M
http.go
→
http.go
@@ -726,7 +726,9 @@
func runHTTPServer() { log.Printf("Running http server with hostname %s on port %d.", c.Host, c.HttpPort) var err error - t = template.New("main").Funcs(template.FuncMap{"parent": path.Dir, "hasSuffix": strings.HasSuffix, + t = template.New("main").Funcs(template.FuncMap{ + "unixTime": time.Unix, + "parent": path.Dir, "hasSuffix": strings.HasSuffix, "safeGeminiURL": func(u string) template.URL { if strings.HasPrefix(u, "gemini://") { return template.URL(u)
M
templates/admin.html
→
templates/admin.html
@@ -10,6 +10,7 @@ <p>Home: <a href="//{{.Username}}.{{$.Config.Host}}">{{.Username}}</a> </p>
<p>Email: <a href=mailto:{{.Email}}>{{.Email}}</a></p> <p>Reference: {{.Reference}}</p> <p>Domain: {{.Domain}}</p> + <p>Created: {{unixTime .CreatedAt 0}}</p> {{ if not .Active }} <p> <form action="/admin/user/{{.Username}}/activate" method="POST" class="inline">