From d6779c7ad3639d6af0c4454a9c22abf21d608922 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 19 Jul 2022 18:22:38 +0800 Subject: [PATCH] Fix public org members displayed too many informations (#20403) --- routers/web/org/members.go | 1 + templates/org/member/members.tmpl | 42 ++++++++++++++++--------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/routers/web/org/members.go b/routers/web/org/members.go index 374c89357523..ec5a98fc6a24 100644 --- a/routers/web/org/members.go +++ b/routers/web/org/members.go @@ -45,6 +45,7 @@ func Members(ctx *context.Context) { } opts.PublicOnly = !isMember && !ctx.Doer.IsAdmin } + ctx.Data["PublicOnly"] = opts.PublicOnly total, err := organization.CountOrgMembers(opts) if err != nil { diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl index 081a7f0a12b8..9a2c235aa6b2 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -29,28 +29,30 @@ {{end}} -
-
- {{$.locale.Tr "org.members.member_role"}} + {{if not .PublicOnly}} +
+
+ {{$.locale.Tr "org.members.member_role"}} +
+
+ {{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}} +
-
- {{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}} +
+
+ {{$.locale.Tr "admin.users.2fa"}} +
+
+ + {{if index $.MembersTwoFaStatus .ID}} + {{svg "octicon-check"}} + {{else}} + {{svg "octicon-x"}} + {{end}} + +
-
-
-
- {{$.locale.Tr "admin.users.2fa"}} -
-
- - {{if index $.MembersTwoFaStatus .ID}} - {{svg "octicon-check"}} - {{else}} - {{svg "octicon-x"}} - {{end}} - -
-
+ {{end}}
{{if eq $.SignedUser.ID .ID}}