From de387102b4d74c69f9267f342b1cd782460af823 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 30 Sep 2023 23:58:35 +0800 Subject: [PATCH] Introduce fixes and more rigorous tests for 'Show on a map' feature (#26803) (#27365) Backport #26803 by @n0toose This change introduces some fixes for my original PR (https://github.com/go-gitea/gitea/pull/26214) and introduces some additional tests so that such a regression does not happen again in the future. Co-authored-by: Panagiotis "Ivory" Vasilopoulos --- routers/web/shared/user/header.go | 1 + routers/web/user/profile.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go index 16d9321e80a14..2934f8206ef9d 100644 --- a/routers/web/shared/user/header.go +++ b/routers/web/shared/user/header.go @@ -32,6 +32,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) { ctx.Data["IsFollowing"] = ctx.Doer != nil && user_model.IsFollowing(ctx, ctx.Doer.ID, ctx.ContextUser.ID) ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail && ctx.ContextUser.Email != "" && ctx.IsSigned && !ctx.ContextUser.KeepEmailPrivate + ctx.Data["UserLocationMapURL"] = setting.Service.UserLocationMapURL // Show OpenID URIs openIDs, err := user_model.GetUserOpenIDs(ctx, ctx.ContextUser.ID) diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index f52ceb1a642ad..48a4b94c190b6 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -52,7 +52,6 @@ func userProfile(ctx *context.Context) { ctx.Data["Title"] = ctx.ContextUser.DisplayName() ctx.Data["PageIsUserProfile"] = true - ctx.Data["UserLocationMapURL"] = setting.Service.UserLocationMapURL // prepare heatmap data if setting.Service.EnableUserHeatmap {