Fix layouts of admin table / adapt repo / email test (#24370)

Ref:
https://github.com/go-gitea/gitea/pull/24315#pullrequestreview-1403034993

And fix the incorrect layout for "dasbboard", the "form" shouldn't
follow `<h4 class="ui top attached header">`, so move it to inner.

Diff with ignoring spaces:
https://github.com/go-gitea/gitea/pull/24370/files?diff=unified&w=1

A known bug: the adapt/delete button doesn't work due to a historical
messy logic, will fix it in next PR (#24374)

![image](https://user-images.githubusercontent.com/2114189/234754656-d160b098-b8d4-4783-962a-27d5c764863c.png)

![image](https://user-images.githubusercontent.com/2114189/234762327-3e77e2e4-a156-4498-8a8b-092e14cf9204.png)

![image](https://user-images.githubusercontent.com/2114189/234767811-74b7272c-e40c-4850-8e3c-499e3b53b827.png)

![image](https://user-images.githubusercontent.com/2114189/234761247-e6aad889-dcad-443c-948f-2d44df68725b.png)
This commit is contained in:
wxiaoguang 2023-04-28 09:48:41 +08:00 committed by GitHub
parent 63a401ac40
commit 83022013c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 69 additions and 87 deletions

View file

@ -2959,6 +2959,7 @@ config.mailer_sendmail_timeout = Sendmail Timeout
config.mailer_use_dummy = Dummy config.mailer_use_dummy = Dummy
config.test_email_placeholder = Email (e.g. test@example.com) config.test_email_placeholder = Email (e.g. test@example.com)
config.send_test_mail = Send Testing Email config.send_test_mail = Send Testing Email
config.send_test_mail_submit = Send
config.test_mail_failed = Failed to send a testing email to "%s": %v config.test_mail_failed = Failed to send a testing email to "%s": %v
config.test_mail_sent = A testing email has been sent to "%s". config.test_mail_sent = A testing email has been sent to "%s".

View file

@ -238,16 +238,18 @@
<dd>{{.Mailer.SMTPPort}}</dd> <dd>{{.Mailer.SMTPPort}}</dd>
{{end}} {{end}}
<dt>{{.locale.Tr "admin.config.mailer_user"}}</dt> <dt>{{.locale.Tr "admin.config.mailer_user"}}</dt>
<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd><br> <dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd>
<div class="ui divider"></div>
<dt class="gt-py-2">{{.locale.Tr "admin.config.send_test_mail"}}</dt>
<dd>
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post"> <form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="inline field ui left"> <div class="ui tiny input">
<div class="ui input">
<input type="email" name="email" placeholder="{{.locale.Tr "admin.config.test_email_placeholder"}}" size="29" required> <input type="email" name="email" placeholder="{{.locale.Tr "admin.config.test_email_placeholder"}}" size="29" required>
</div> </div>
</div> <button class="ui tiny green button">{{.locale.Tr "admin.config.send_test_mail_submit"}}</button>
<button class="ui green button" id="test-mail-btn">{{.locale.Tr "admin.config.send_test_mail"}}</button>
</form> </form>
</dd>
{{end}} {{end}}
</dl> </dl>
</div> </div>

View file

@ -16,9 +16,9 @@
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.dashboard.operations"}} {{.locale.Tr "admin.dashboard.operations"}}
</h4> </h4>
<div class="ui attached table segment">
<form method="post" action="{{AppSubUrl}}/admin"> <form method="post" action="{{AppSubUrl}}/admin">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="ui attached table segment">
<table class="ui very basic table gt-px-4"> <table class="ui very basic table gt-px-4">
<tbody> <tbody>
<tr> <tr>
@ -71,8 +71,8 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</form> </form>
</div>
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.dashboard.system_status"}} {{.locale.Tr "admin.dashboard.system_status"}}

View file

@ -1,4 +1,4 @@
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin")}}
<div class="admin-setting-content"> <div class="admin-setting-content">
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) {{.locale.Tr "admin.repos.repo_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})

View file

@ -1,4 +1,4 @@
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin user")}} {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin")}}
<div class="admin-setting-content"> <div class="admin-setting-content">
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.repos.unadopted"}} {{.locale.Tr "admin.repos.unadopted"}}
@ -18,14 +18,12 @@
{{if .search}} {{if .search}}
<div class="ui attached segment settings"> <div class="ui attached segment settings">
{{if .Dirs}} {{if .Dirs}}
<div class="ui middle aligned divided list"> <div class="ui aligned divided list">
{{range $dirI, $dir := .Dirs}} {{range $dirI, $dir := .Dirs}}
<div class="item"> <div class="item gt-df gt-ac">
<div class="content"> <span class="gt-f1"> {{svg "octicon-file-directory-fill"}} {{$dir}}</span>
<span class="icon">{{svg "octicon-file-directory-fill"}}</span> <div>
<span class="name">{{$dir}}</span> <button class="ui button green show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}">{{svg "octicon-plus"}} {{$.locale.Tr "repo.adopt_preexisting_label"}}</button>
<div class="right floated content">
<button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button>
<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}"> <div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
<div class="header"> <div class="header">
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
@ -42,7 +40,7 @@
{{template "base/modal_actions_confirm" (dict "locale" $.locale)}} {{template "base/modal_actions_confirm" (dict "locale" $.locale)}}
</form> </form>
</div> </div>
<button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button> <button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}">{{svg "octicon-x"}} {{$.locale.Tr "repo.delete_preexisting_label"}}</button>
<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}"> <div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
<div class="header"> <div class="header">
<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>
@ -61,7 +59,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
{{end}} {{end}}
</div> </div>
{{template "base/paginate" .}} {{template "base/paginate" .}}

View file

@ -1,7 +1,7 @@
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.Title}} {{.Title}}
<div class="ui right"> <div class="ui right">
<div class="ui floating1 jump dropdown"> <div class="ui jump dropdown">
<div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div> <div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div>
<div class="menu"> <div class="menu">
<a class="item" href="{{.BaseLinkNew}}/gitea/new"> <a class="item" href="{{.BaseLinkNew}}/gitea/new">

View file

@ -9,7 +9,7 @@
<div class="ui middle aligned divided list"> <div class="ui middle aligned divided list">
{{range $dirI, $dir := .Dirs}} {{range $dirI, $dir := .Dirs}}
{{$repo := index $.ReposMap $dir}} {{$repo := index $.ReposMap $dir}}
<div class="item"> <div class="item {{if not $repo}}gt-py-2{{end}}">{{/* if not repo, then there are "adapt" buttons, so the padding shouldn't be that default large*/}}
<div class="content"> <div class="content">
{{if $repo}} {{if $repo}}
{{if $repo.IsPrivate}} {{if $repo.IsPrivate}}
@ -30,11 +30,11 @@
<span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span> <span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span>
{{end}} {{end}}
{{else}} {{else}}
<span class="icon">{{svg "octicon-file-directory-fill"}}</span> <span class="icon gt-dib gt-pt-3">{{svg "octicon-file-directory-fill"}}</span>
<span class="name">{{$.ContextUser.Name}}/{{$dir}}</span> <span class="name gt-dib gt-pt-3">{{$.ContextUser.Name}}/{{$dir}}</span>
<div class="right floated content"> <div class="ui right">
{{if $.allowAdopt}} {{if $.allowAdopt}}
<button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button> <button class="ui button green show-modal gt-p-3" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button>
<div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}"> <div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
<div class="header"> <div class="header">
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
@ -51,7 +51,7 @@
</div> </div>
{{end}} {{end}}
{{if $.allowDelete}} {{if $.allowDelete}}
<button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button> <button class="ui button red show-modal gt-p-3" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button>
<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}"> <div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
<div class="header"> <div class="header">
<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>

View file

@ -4,18 +4,7 @@
margin: 12px -1rem -1rem; margin: 12px -1rem -1rem;
} }
.admin .settings .button.adopt, .admin.user table.table .email {
.admin .settings .button.delete {
margin-top: -15px;
margin-bottom: -15px;
}
.admin .settings .button.adopt .label,
.admin .settings .button.delete .label {
vertical-align: middle;
}
.admin.user .email {
max-width: 200px; max-width: 200px;
} }
@ -51,12 +40,12 @@
} }
} }
.admin.config #test-mail-btn {
margin-left: 5px;
}
.admin code, .admin code,
.admin pre { .admin pre {
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
.admin .ui.table.segment {
overflow-x: auto; /* if the screen width is small, many wide tables (eg: user list) need scroll bars */
}

View file

@ -2,6 +2,10 @@
padding-bottom: 30px; padding-bottom: 30px;
} }
.runner-container .ui.table.segment {
overflow-x: auto;
}
.runner-container .runner-ops > a { .runner-container .runner-ops > a {
margin-left: 0.5em; margin-left: 0.5em;
} }

View file

@ -90,17 +90,6 @@
padding: 8px 15px; padding: 8px 15px;
} }
.user .button.adopt,
.user .button.delete {
margin-top: -15px;
margin-bottom: -15px;
}
.user .button.adopt .label,
.user .button.delete .label {
vertical-align: middle;
}
.user.link-account:not(.icon) { .user.link-account:not(.icon) {
padding-top: 15px; padding-top: 15px;
padding-bottom: 5px; padding-bottom: 5px;