Skip to content

Commit

Permalink
Fix admin-dl-horizontal (go-gitea#25512) (go-gitea#25535)
Browse files Browse the repository at this point in the history
Backport go-gitea#25512 by @wxiaoguang


![image](https://github.com/go-gitea/gitea/assets/2114189/fb731e07-da30-4470-8200-73b5ca8b78f1)


![image](https://github.com/go-gitea/gitea/assets/2114189/85930b6f-5df7-437f-863f-423f3b81dd26)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: HesterG <hestergong@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
  • Loading branch information
4 people authored Jun 27, 2023
1 parent 345a25d commit 614d6df
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 31 deletions.
24 changes: 12 additions & 12 deletions templates/admin/config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{.locale.Tr "admin.config.server_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.app_name"}}</dt>
<dd>{{AppName}}</dd>
<dt>{{.locale.Tr "admin.config.app_ver"}}</dt>
Expand Down Expand Up @@ -53,7 +53,7 @@
{{.locale.Tr "admin.config.ssh_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.ssh_enabled"}}</dt>
<dd>{{if not .SSH.Disabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
{{if not .SSH.Disabled}}
Expand Down Expand Up @@ -88,7 +88,7 @@
{{.locale.Tr "admin.config.lfs_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.lfs_enabled"}}</dt>
<dd>{{if .LFS.StartServer}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
{{if .LFS.StartServer}}
Expand All @@ -104,7 +104,7 @@
{{.locale.Tr "admin.config.db_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.db_type"}}</dt>
<dd>{{.DbCfg.Type}}</dd>
{{if not (eq .DbCfg.Type "sqlite3")}}
Expand Down Expand Up @@ -132,7 +132,7 @@
{{.locale.Tr "admin.config.service_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.register_email_confirm"}}</dt>
<dd>{{if .Service.RegisterEmailConfirm}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
<dt>{{.locale.Tr "admin.config.disable_register"}}</dt>
Expand Down Expand Up @@ -186,7 +186,7 @@
{{.locale.Tr "admin.config.webhook_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.queue_length"}}</dt>
<dd>{{.Webhook.QueueLength}}</dd>
<dt>{{.locale.Tr "admin.config.deliver_timeout"}}</dt>
Expand All @@ -200,7 +200,7 @@
{{.locale.Tr "admin.config.mailer_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.mailer_enabled"}}</dt>
<dd>{{if .MailerEnabled}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
{{if .MailerEnabled}}
Expand Down Expand Up @@ -249,7 +249,7 @@
{{.locale.Tr "admin.config.cache_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.cache_adapter"}}</dt>
<dd>{{.CacheAdapter}}</dd>
{{if eq .CacheAdapter "memory"}}
Expand All @@ -269,7 +269,7 @@
{{.locale.Tr "admin.config.session_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.session_provider"}}</dt>
<dd>{{.SessionConfig.Provider}}</dd>
<dt>{{.locale.Tr "admin.config.provider_config"}}</dt>
Expand All @@ -289,7 +289,7 @@
{{.locale.Tr "admin.config.picture_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.disable_gravatar"}}</dt>
<dd>
<div class="ui toggle checkbox">
Expand All @@ -310,7 +310,7 @@
{{.locale.Tr "admin.config.git_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.config.git_disable_diff_highlight"}}</dt>
<dd>{{if .Git.DisableDiffHighlight}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
<dt>{{.locale.Tr "admin.config.git_max_diff_lines"}}</dt>
Expand Down Expand Up @@ -341,7 +341,7 @@
{{.locale.Tr "admin.config.log_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
{{if .Loggers.xorm.IsEnabled}}
<dt>{{$.locale.Tr "admin.config.xorm_log_sql"}}</dt>
<dd>{{if $.LogSQL}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</dd>
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/dashboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{{.locale.Tr "admin.dashboard.system_status"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dl class="admin-dl-horizontal">
<dt>{{.locale.Tr "admin.dashboard.server_uptime"}}</dt>
<dd><relative-time format="duration" datetime="{{.SysStatus.StartTime}}">{{.SysStatus.StartTime}}</relative-time></dd>
<dt>{{.locale.Tr "admin.dashboard.current_goroutine"}}</dt>
Expand Down
31 changes: 13 additions & 18 deletions web_src/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,27 @@
flex-wrap: wrap;
}

.admin dl.admin-dl-horizontal dd {
margin-left: auto;
width: calc(100% - 245px);
}

@media (max-width: 767.98px) {
.admin dl.admin-dl-horizontal dd {
width: calc(100% - 185px);
}
}

/* divider needs explicit width to become visible here */
/* divider needs explicit width because the parent container is "display: flex" */
.admin dl.admin-dl-horizontal .ui.divider {
width: 100%;
}

.admin dl.admin-dl-horizontal dt,
.admin dl.admin-dl-horizontal dd {
line-height: 1;
padding: 5px 0;
}

.admin dl.admin-dl-horizontal dt {
width: 300px;
max-width: calc(100% - 100px - 1em);
font-weight: var(--font-weight-semibold);
width: 220px;
margin-right: 5px;
}

@media (max-width: 767.98px) {
.admin dl.admin-dl-horizontal dt {
width: 160px;
}
.admin dl.admin-dl-horizontal dd {
margin-left: auto;
width: calc(100% - 300px - 1em);
min-width: 100px;
}

.admin code,
Expand Down

0 comments on commit 614d6df

Please sign in to comment.