From 32746aa6da2980cd3ce37de8a5471196cd54586b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 19 Jul 2022 13:28:41 +0800 Subject: [PATCH] Fix public org members displayed too many informations --- 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 374c893575230..ec5a98fc6a240 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 081a7f0a12b89..9a2c235aa6b29 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 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 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 $.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}}