Skip to content

Commit

Permalink
Fix the admin mailer config display (go-gitea#20633)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored and Sysoev, Vladimir committed Aug 10, 2022
1 parent 654ad1a commit 5abf809
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
9 changes: 6 additions & 3 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2796,16 +2796,19 @@ config.queue_length = Queue Length
config.deliver_timeout = Deliver Timeout
config.skip_tls_verify = Skip TLS Verification

config.mailer_config = SMTP Mailer Configuration
config.mailer_config = Mailer Configuration
config.mailer_enabled = Enabled
config.mailer_disable_helo = Disable HELO
config.mailer_enable_helo = Enable HELO
config.mailer_name = Name
config.mailer_host = Host
config.mailer_protocol = Protocol
config.mailer_smtp_addr = SMTP Addr
config.mailer_smtp_port = SMTP Port
config.mailer_user = User
config.mailer_use_sendmail = Use Sendmail
config.mailer_sendmail_path = Sendmail Path
config.mailer_sendmail_args = Extra Arguments to Sendmail
config.mailer_sendmail_timeout = Sendmail Timeout
config.mailer_use_dummy = Dummy
config.test_email_placeholder = Email (e.g. [email protected])
config.send_test_mail = Send Testing Email
config.test_mail_failed = Failed to send a testing email to '%s': %v
Expand Down
19 changes: 13 additions & 6 deletions templates/admin/config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,7 @@
{{if .MailerEnabled}}
<dt>{{.locale.Tr "admin.config.mailer_name"}}</dt>
<dd>{{.Mailer.Name}}</dd>
{{if eq .Mailer.MailerType "smtp"}}
<dt>{{.locale.Tr "admin.config.mailer_disable_helo"}}</dt>
<dd>{{if .DisableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
<dt>{{.locale.Tr "admin.config.mailer_host"}}</dt>
<dd>{{.Mailer.Host}}</dd>
{{else if eq .Mailer.MailerType "sendmail"}}
{{if eq .Mailer.Protocol "sendmail"}}
<dt>{{.locale.Tr "admin.config.mailer_use_sendmail"}}</dt>
<dd>{{svg "octicon-check"}}</dd>
<dt>{{.locale.Tr "admin.config.mailer_sendmail_path"}}</dt>
Expand All @@ -232,6 +227,18 @@
<dd>{{.Mailer.SendmailArgs}}</dd>
<dt>{{.locale.Tr "admin.config.mailer_sendmail_timeout"}}</dt>
<dd>{{.Mailer.SendmailTimeout}} {{.locale.Tr "tool.raw_seconds"}}</dd>
{{else if eq .Mailer.Protocol "dummy"}}
<dt>{{.locale.Tr "admin.config.mailer_use_dummy"}}</dt>
<dd>{{svg "octicon-check"}}</dd>
{{else}}{{/* SMTP family */}}
<dt>{{.locale.Tr "admin.config.mailer_protocol"}}</dt>
<dd>{{.Mailer.Protocol}}</dd>
<dt>{{.locale.Tr "admin.config.mailer_enable_helo"}}</dt>
<dd>{{if .Mailer.EnableHelo}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
<dt>{{.locale.Tr "admin.config.mailer_smtp_addr"}}</dt>
<dd>{{.Mailer.SMTPAddr}}</dd>
<dt>{{.locale.Tr "admin.config.mailer_smtp_port"}}</dt>
<dd>{{.Mailer.SMTPPort}}</dd>
{{end}}
<dt>{{.locale.Tr "admin.config.mailer_user"}}</dt>
<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd><br>
Expand Down

0 comments on commit 5abf809

Please sign in to comment.