diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 307404d022..aaa7e35a41 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -827,6 +827,9 @@ LEVEL = Info ;; Dependencies can be added from any repository where the user is granted access or only from the current repository depending on this setting. ;ALLOW_CROSS_REPOSITORY_DEPENDENCIES = true ;; +;; Enable OpenStreetMap button in Location field on user profiles +;ENABLE_OSM_BUTTON = true +;; ;; Enable heatmap on users profiles. ;ENABLE_USER_HEATMAP = true ;; diff --git a/modules/setting/service.go b/modules/setting/service.go index 03225f566b..bc816c0933 100644 --- a/modules/setting/service.go +++ b/modules/setting/service.go @@ -73,6 +73,7 @@ var Service = struct { AllowCrossRepositoryDependencies bool DefaultAllowOnlyContributorsToTrackTime bool NoReplyAddress string + EnableOSMButton bool EnableUserHeatmap bool AutoWatchNewRepos bool AutoWatchOnChanges bool @@ -185,6 +186,7 @@ func loadServiceFrom(rootCfg ConfigProvider) { Service.AllowCrossRepositoryDependencies = sec.Key("ALLOW_CROSS_REPOSITORY_DEPENDENCIES").MustBool(true) Service.DefaultAllowOnlyContributorsToTrackTime = sec.Key("DEFAULT_ALLOW_ONLY_CONTRIBUTORS_TO_TRACK_TIME").MustBool(true) Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply." + Domain) + Service.EnableOSMButton = sec.Key("ENABLE_OSM_BUTTON").MustBool(true) Service.EnableUserHeatmap = sec.Key("ENABLE_USER_HEATMAP").MustBool(true) Service.AutoWatchNewRepos = sec.Key("AUTO_WATCH_NEW_REPOS").MustBool(true) Service.AutoWatchOnChanges = sec.Key("AUTO_WATCH_ON_CHANGES").MustBool(false) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 6e8d4ed1ad..46c31d8f42 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -601,6 +601,7 @@ user_bio = Biography disabled_public_activity = This user has disabled the public visibility of the activity. email_visibility.limited = Your email address is visible to all authenticated users email_visibility.private = Your email address is only visible to you and administrators +redirect_to_osm = View on OpenStreetMap form.name_reserved = The username "%s" is reserved. form.name_pattern_not_allowed = The pattern "%s" is not allowed in a username. @@ -627,6 +628,7 @@ webauthn = Security Keys public_profile = Public Profile biography_placeholder = Tell us a little bit about yourself +location_placeholder = Share your approximate location with others profile_desc = Your email address will be used for notifications and other operations. password_username_disabled = Non-local users are not allowed to change their username. Please contact your site administrator for more details. full_name = Full Name diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index 07a2261c96..7e44288b43 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -52,6 +52,7 @@ func userProfile(ctx *context.Context) { ctx.Data["Title"] = ctx.ContextUser.DisplayName() ctx.Data["PageIsUserProfile"] = true + ctx.Data["EnableOSMButton"] = setting.Service.EnableOSMButton // prepare heatmap data if setting.Service.EnableUserHeatmap { diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl index 5a1e43b88e..e04a1b512f 100644 --- a/templates/shared/user/profile_big_avatar.tmpl +++ b/templates/shared/user/profile_big_avatar.tmpl @@ -24,7 +24,17 @@