From 35b45fb3a64251c5d6e104184c2c15a857ca2798 Mon Sep 17 00:00:00 2001 From: Ben Chang Date: Tue, 17 Dec 2024 09:54:20 +0800 Subject: [PATCH] make query string right --- routers/web/org/home.go | 7 ++++--- templates/org/home.tmpl | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/routers/web/org/home.go b/routers/web/org/home.go index ad44a07ac7..e073093476 100644 --- a/routers/web/org/home.go +++ b/routers/web/org/home.go @@ -8,6 +8,7 @@ import ( "net/http" "path" "strings" + html_template "html/template" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/organization" @@ -112,11 +113,11 @@ func home(ctx *context.Context, viewRepositories bool) { ctx.Data["ShowMemberAndTeamTab"] = ctx.Org.IsMember || len(members) > 0 currentURL := ctx.Req.URL - queryParams := currentURL.Query() + queryParams := currentURL.Query() queryParams.Set("view_as", "member") - ctx.Data["QueryForMember"] = queryParams.Encode() + ctx.Data["QueryForMember"] = html_template.URL(queryParams.Encode()) queryParams.Set("view_as", "public") - ctx.Data["QueryForPublic"] = queryParams.Encode() + ctx.Data["QueryForPublic"] = html_template.URL(queryParams.Encode()) isViewerMember := ctx.FormString("view_as") == "member" ctx.Data["IsViewerMember"] = isViewerMember diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index e0996de90d..a8e5d4ebd2 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -5,6 +5,14 @@
+ {{if .IsViewerMember}} {{if .PrivateProfileReadme}}
{{.PrivateProfileReadme}}