diff --git a/modules/setting/config.go b/modules/setting/config.go index 184874094d..b36f4791bb 100644 --- a/modules/setting/config.go +++ b/modules/setting/config.go @@ -56,6 +56,7 @@ type RepositoryStruct struct { type ThemeStruct struct { DisableRegistration *config.Value[bool] HideExploreUsers *config.Value[bool] + HideExploreButton *config.Value[bool] EnableExplorePackages *config.Value[bool] HelpURL *config.Value[string] CustomSiteIconURL *config.Value[string] @@ -93,6 +94,7 @@ func initDefaultConfig() { Theme: &ThemeStruct{ DisableRegistration: config.ValueJSON[bool]("theme.disable_registration").WithFileConfig(config.CfgSecKey{Sec: "service", Key: "DISABLE_REGISTRATION"}), HideExploreUsers: config.ValueJSON[bool]("theme.hide_explore_users").WithDefault(false), + HideExploreButton: config.ValueJSON[bool]("theme.hide_explore_button").WithDefault(false), EnableExplorePackages: config.ValueJSON[bool]("theme.enable_explore_packages").WithFileConfig(config.CfgSecKey{Sec: "service.explore", Key: "ENABLE_PACKAGES_PAGE"}), HelpURL: config.ValueJSON[string]("theme.help_url").WithDefault(""), CustomSiteIconURL: config.ValueJSON[string]("theme.custom_site_icon_url").WithDefault(""), diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 3cbc208336..42f7f1e316 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -3997,6 +3997,8 @@ "admin.config.help_url_help": "URL for the Help link in the navigation. Leave empty to hide the Help link.", "admin.config.hide_explore_users": "Hide Explore Users", "admin.config.hide_explore_users_desc": "Hide the Users tab from the Explore menu", + "admin.config.hide_explore_button": "Hide Explore Button", + "admin.config.hide_explore_button_desc": "Hide the Explore button from the header navigation bar", "admin.config.enable_explore_packages": "Enable Explore Packages", "admin.config.enable_explore_packages_desc": "Show a Packages tab in the Explore menu to browse public and global packages", "admin.config.custom_home_title": "Homepage Title", diff --git a/routers/web/admin/config.go b/routers/web/admin/config.go index 14b50d7c97..68638ea9c6 100644 --- a/routers/web/admin/config.go +++ b/routers/web/admin/config.go @@ -243,6 +243,7 @@ func ChangeConfig(ctx *context.Context) { cfg.Theme.APIHeaderURL.DynKey(): marshalString(""), cfg.Theme.HelpURL.DynKey(): marshalString(""), cfg.Theme.HideExploreUsers.DynKey(): marshalBool, + cfg.Theme.HideExploreButton.DynKey(): marshalBool, cfg.Theme.EnableExplorePackages.DynKey(): marshalBool, cfg.Theme.CustomHomeTitle.DynKey(): marshalString(""), cfg.Theme.CustomHomeTagline.DynKey(): marshalString(""), diff --git a/templates/admin/config_settings/theme.tmpl b/templates/admin/config_settings/theme.tmpl index 5bb478c350..1ef4f83591 100644 --- a/templates/admin/config_settings/theme.tmpl +++ b/templates/admin/config_settings/theme.tmpl @@ -17,6 +17,13 @@
+