From 9b69de166fd539b66542518cda9dd170080c0ad6 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Mon, 11 Nov 2019 14:25:34 -0800 Subject: [PATCH] add silenced warning on invites page --- invites.go | 10 +++++++++- templates/user/invite.tmpl | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/invites.go b/invites.go index 1dba7bd..63216fa 100644 --- a/invites.go +++ b/invites.go @@ -56,12 +56,20 @@ func handleViewUserInvites(app *App, u *User, w http.ResponseWriter, r *http.Req p := struct { *UserPage - Invites *[]Invite + Invites *[]Invite + Suspended bool }{ UserPage: NewUserPage(app, r, u, "Invite People", f), } var err error + + p.Suspended, err = app.db.IsUserSuspended(u.ID) + if err != nil { + log.Error("view invites: %v", err) + return ErrInternalGeneral + } + p.Invites, err = app.db.GetUserInvites(u.ID) if err != nil { return err diff --git a/templates/user/invite.tmpl b/templates/user/invite.tmpl index 1985bd5..edf7061 100644 --- a/templates/user/invite.tmpl +++ b/templates/user/invite.tmpl @@ -31,6 +31,9 @@ table td {
+ {{if .Suspended}} + {{template "user-suspended"}} + {{end}}

Invite people

Invite others to join {{.SiteName}} by generating and sharing invite links below.