Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 09:54:24 +01:00

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.test_email_placeholder = Email (e.g. test@example.com)
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_sent = A testing email has been sent to "%s".

View file

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

View file

@ -16,9 +16,9 @@
<h4 class="ui top attached header">
{{.locale.Tr "admin.dashboard.operations"}}
</h4>
<form method="post" action="{{AppSubUrl}}/admin">
{{.CsrfTokenHtml}}
<div class="ui attached table segment">
<div class="ui attached table segment">
<form method="post" action="{{AppSubUrl}}/admin">
{{.CsrfTokenHtml}}
<table class="ui very basic table gt-px-4">
<tbody>
<tr>
@ -71,8 +71,8 @@
</tr>
</tbody>
</table>
</div>
</form>
</form>
</div>
<h4 class="ui top attached header">
{{.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">
<h4 class="ui top attached header">
{{.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">
<h4 class="ui top attached header">
{{.locale.Tr "admin.repos.unadopted"}}
@ -18,47 +18,44 @@
{{if .search}}
<div class="ui attached segment settings">
{{if .Dirs}}
<div class="ui middle aligned divided list">
<div class="ui aligned divided list">
{{range $dirI, $dir := .Dirs}}
<div class="item">
<div class="content">
<span class="icon">{{svg "octicon-file-directory-fill"}}</span>
<span class="name">{{$dir}}</span>
<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="header">
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
</div>
<div class="content">
<p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
</div>
<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
{{$.CsrfTokenHtml}}
<input type="hidden" name="id" value="{{$dir}}">
<input type="hidden" name="action" value="adopt">
<input type="hidden" name="q" value="{{$.Keyword}}">
<input type="hidden" name="page" value="{{$.CurrentPage}}">
{{template "base/modal_actions_confirm" (dict "locale" $.locale)}}
</form>
<div class="item gt-df gt-ac">
<span class="gt-f1"> {{svg "octicon-file-directory-fill"}} {{$dir}}</span>
<div>
<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="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}">
<div class="header">
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
</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>
<div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}">
<div class="header">
<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>
</div>
<div class="content">
<p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p>
</div>
<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
{{$.CsrfTokenHtml}}
<input type="hidden" name="id" value="{{$dir}}">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="q" value="{{$.Keyword}}">
<input type="hidden" name="page" value="{{$.CurrentPage}}">
{{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonColors" "yellow")}}
</form>
<div class="content">
<p>{{$.locale.Tr "repo.adopt_preexisting_content" $dir}}</p>
</div>
<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
{{$.CsrfTokenHtml}}
<input type="hidden" name="id" value="{{$dir}}">
<input type="hidden" name="action" value="adopt">
<input type="hidden" name="q" value="{{$.Keyword}}">
<input type="hidden" name="page" value="{{$.CurrentPage}}">
{{template "base/modal_actions_confirm" (dict "locale" $.locale)}}
</form>
</div>
<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="header">
<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>
</div>
<div class="content">
<p>{{$.locale.Tr "repo.delete_preexisting_content" $dir}}</p>
</div>
<form class="ui form" method="POST" action="{{AppSubUrl}}/admin/repos/unadopted">
{{$.CsrfTokenHtml}}
<input type="hidden" name="id" value="{{$dir}}">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="q" value="{{$.Keyword}}">
<input type="hidden" name="page" value="{{$.CurrentPage}}">
{{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonColors" "yellow")}}
</form>
</div>
</div>
</div>

View file

@ -1,7 +1,7 @@
<h4 class="ui top attached header">
{{.Title}}
<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="menu">
<a class="item" href="{{.BaseLinkNew}}/gitea/new">

View file

@ -9,7 +9,7 @@
<div class="ui middle aligned divided list">
{{range $dirI, $dir := .Dirs}}
{{$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">
{{if $repo}}
{{if $repo.IsPrivate}}
@ -30,11 +30,11 @@
<span><a href="{{$repo.BaseRepo.Link}}">{{$repo.BaseRepo.OwnerName}}/{{$repo.BaseRepo.Name}}</a></span>
{{end}}
{{else}}
<span class="icon">{{svg "octicon-file-directory-fill"}}</span>
<span class="name">{{$.ContextUser.Name}}/{{$dir}}</span>
<div class="right floated content">
<span class="icon gt-dib gt-pt-3">{{svg "octicon-file-directory-fill"}}</span>
<span class="name gt-dib gt-pt-3">{{$.ContextUser.Name}}/{{$dir}}</span>
<div class="ui right">
{{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="header">
<span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span>
@ -51,7 +51,7 @@
</div>
{{end}}
{{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="header">
<span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span>

View file

@ -4,18 +4,7 @@
margin: 12px -1rem -1rem;
}
.admin .settings .button.adopt,
.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 {
.admin.user table.table .email {
max-width: 200px;
}
@ -51,12 +40,12 @@
}
}
.admin.config #test-mail-btn {
margin-left: 5px;
}
.admin code,
.admin pre {
white-space: pre-wrap;
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;
}
.runner-container .ui.table.segment {
overflow-x: auto;
}
.runner-container .runner-ops > a {
margin-left: 0.5em;
}

View file

@ -90,17 +90,6 @@
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) {
padding-top: 15px;
padding-bottom: 5px;