flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit a3401dc4b886761ec2ee7d083f62ee572debd97f
parent c30c52b371f6740fd22fed90250659dc1ec656ab
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Thu, 14 Jan 2021 20:52:55 -0800

Add domain to admin page

Diffstat:
Mdb.go | 4++--
Mtemplates/admin.html | 1+
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/db.go b/db.go @@ -131,14 +131,14 @@ func getUserByName(username string) (*User, error) { } func getUsers() ([]User, error) { - rows, err := DB.Query(`SELECT username, email, active, admin, created_at, reference from user ORDER BY created_at DESC`) + rows, err := DB.Query(`SELECT username, email, active, admin, created_at, reference, domain from user ORDER BY created_at DESC`) if err != nil { return nil, err } var users []User for rows.Next() { var user User - err = rows.Scan(&user.Username, &user.Email, &user.Active, &user.Admin, &user.CreatedAt, &user.Reference) + err = rows.Scan(&user.Username, &user.Email, &user.Active, &user.Admin, &user.CreatedAt, &user.Reference, &user.Domain) if err != nil { return nil, err } diff --git a/templates/admin.html b/templates/admin.html @@ -9,6 +9,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> {{ if not .Active }} <p> <form action="/admin/user/{{.Username}}/activate" method="POST" class="inline">