diff --git a/conf/app.ini b/conf/app.ini index ab8e63fdcb..3bd0e8ea9c 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -57,6 +57,8 @@ FEED_MAX_COMMIT_NUM = 5 THEME_COLOR_META_TAG = `#6cc644` ; Max size of files to be displayed (defaults is 8MiB) MAX_DISPLAY_FILE_SIZE = 8388608 +; Whether show the user email in the Explore Users page +SHOW_USER_EMAIL = true [ui.admin] ; Number of users that are showed in one page diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 4acac07ef7..9a8a52e195 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -203,6 +203,7 @@ var ( FeedMaxCommitNum int ThemeColorMetaTag string MaxDisplayFileSize int64 + ShowUserEmail bool Admin struct { UserPagingNum int @@ -820,6 +821,8 @@ please consider changing to GITEA_CUSTOM`) ShowFooterVersion = Cfg.Section("other").Key("SHOW_FOOTER_VERSION").MustBool(true) ShowFooterTemplateLoadTime = Cfg.Section("other").Key("SHOW_FOOTER_TEMPLATE_LOAD_TIME").MustBool(true) + UI.ShowUserEmail = Cfg.Section("ui").Key("SHOW_USER_EMAIL").MustBool(true) + HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt")) } diff --git a/routers/home.go b/routers/home.go index d3c48f7aae..f5172182d5 100644 --- a/routers/home.go +++ b/routers/home.go @@ -229,6 +229,7 @@ func RenderUserSearch(ctx *context.Context, opts *UserSearchOptions) { ctx.Data["Total"] = count ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, page, 5) ctx.Data["Users"] = users + ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail ctx.HTML(200, opts.TplName) } diff --git a/templates/explore/users.tmpl b/templates/explore/users.tmpl index 09091df253..84ab7ad7fb 100644 --- a/templates/explore/users.tmpl +++ b/templates/explore/users.tmpl @@ -16,7 +16,7 @@ {{if .Location}} {{.Location}} {{end}} - {{if and .Email $.IsSigned}} + {{if and $.ShowUserEmail .Email $.IsSigned}} {{.Email}} {{end}} diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index cfb646ace1..37f94d2b79 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -22,7 +22,7 @@ {{if .Owner.Location}}