all repos — flounder @ a3401dc4b886761ec2ee7d083f62ee572debd97f

A small site builder for the Gemini protocol

Add domain to admin page
alex wennerberg alex@alexwennerberg.com
Thu, 14 Jan 2021 20:52:55 -0800
commit

a3401dc4b886761ec2ee7d083f62ee572debd97f

parent

c30c52b371f6740fd22fed90250659dc1ec656ab

2 files changed, 3 insertions(+), 2 deletions(-)

jump to
M db.godb.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.htmltemplates/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">