From 9b69de166fd539b66542518cda9dd170080c0ad6 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Mon, 11 Nov 2019 14:25:34 -0800 Subject: [PATCH 1/3] 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.

From 8cfffb56505318da1fc4253c59115be3cdc002bc Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sun, 9 Feb 2020 10:51:34 -0500 Subject: [PATCH 2/3] Disable form items on Invite page when silenced Ref T661 --- templates/user/invite.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/user/invite.tmpl b/templates/user/invite.tmpl index edf7061..a853dc0 100644 --- a/templates/user/invite.tmpl +++ b/templates/user/invite.tmpl @@ -41,7 +41,7 @@ table td {
- @@ -53,7 +53,7 @@ table td {
- @@ -66,7 +66,7 @@ table td {
- +
From b78f64bad3d07f833e71e47270395196d792a6fd Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sun, 9 Feb 2020 10:57:08 -0500 Subject: [PATCH 3/3] Don't fail Invite page rendering on IsUserSuspended check --- invites.go | 1 - 1 file changed, 1 deletion(-) diff --git a/invites.go b/invites.go index 63216fa..e39ec3b 100644 --- a/invites.go +++ b/invites.go @@ -67,7 +67,6 @@ func handleViewUserInvites(app *App, u *User, w http.ResponseWriter, r *http.Req 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)