Skip to content

Commit 6b7e860

Browse files
authored
Hide notify mail setting ui if not enabled (go-gitea#20138) (go-gitea#20337)
Backport go-gitea#20138
1 parent 0f89417 commit 6b7e860

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

routers/web/user/setting/account.go

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func Account(ctx *context.Context) {
3535
ctx.Data["Title"] = ctx.Tr("settings")
3636
ctx.Data["PageIsSettingsAccount"] = true
3737
ctx.Data["Email"] = ctx.User.Email
38+
ctx.Data["EnableNotifyMail"] = setting.Service.EnableNotifyMail
3839

3940
loadAccountData(ctx)
4041

templates/user/settings/account.tmpl

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
</h4>
4444
<div class="ui attached segment">
4545
<div class="ui email list">
46+
{{if $.EnableNotifyMail}}
4647
<div class="item">
4748
<form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post">
4849
{{.i18n.Tr "settings.email_desc"}}
@@ -69,6 +70,7 @@
6970
</div>
7071
</form>
7172
</div>
73+
{{end}}
7274
{{range .Emails}}
7375
<div class="item">
7476
{{if not .IsPrimary}}

0 commit comments

Comments
 (0)