Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2958,6 +2958,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
silverwind marked this conversation as resolved.
Show resolved Hide resolved
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".

Expand Down
18 changes: 10 additions & 8 deletions templates/admin/config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
10 changes: 5 additions & 5 deletions templates/admin/dashboard.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -71,8 +71,8 @@
</tr>
</tbody>
</table>
</div>
</form>
</form>
</div>

<h4 class="ui top attached header">
{{.locale.Tr "admin.dashboard.system_status"}}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
@@ -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}})
Expand Down
75 changes: 36 additions & 39 deletions templates/admin/repo/unadopted.tmpl
Original file line number Diff line number Diff line change
@@ -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"}}
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/settings/webhook/base_list.tmpl
Original file line number Diff line number Diff line change
@@ -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">
Expand Down
12 changes: 6 additions & 6 deletions templates/user/settings/repos.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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>
Expand All @@ -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>
Expand Down
21 changes: 5 additions & 16 deletions web_src/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 */
}
4 changes: 4 additions & 0 deletions web_src/css/runner.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
padding-bottom: 30px;
}

.runner-container .ui.table.segment {
overflow-x: auto;
}

.runner-container .runner-ops > a {
margin-left: 0.5em;
}
Expand Down
11 changes: 0 additions & 11 deletions web_src/css/user.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down