Add domain to admin page
alex wennerberg alex@alexwennerberg.com
Thu, 14 Jan 2021 20:52:55 -0800
2 files changed,
3 insertions(+),
2 deletions(-)
M
db.go
→
db.go
@@ -131,14 +131,14 @@ return &user, nil
} 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 }
M
templates/admin.html
→
templates/admin.html
@@ -9,6 +9,7 @@ <div class="user-admin-details">
<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">