Skip to content

Improve SSH Key / GPG Key / Deploy Key UI #26949

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

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions templates/repo/settings/deploy_keys.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
{{.locale.Tr "repo.settings.deploy_keys"}}
<div class="ui right">
{{if not .DisableSSH}}
<button class="ui primary tiny show-panel button" data-panel="#add-deploy-key-panel">{{.locale.Tr "repo.settings.add_deploy_key"}}</button>
<button class="ui primary tiny show-panel toggle button" data-panel="#add-deploy-key-panel">{{.locale.Tr "repo.settings.add_deploy_key"}}</button>
{{else}}
<button class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</button>
{{end}}
</div>
</h4>
<div class="ui attached segment">
<div class="{{if not .HasError}}gt-hidden{{end}}" id="add-deploy-key-panel">
<div class="{{if not .HasError}}gt-hidden{{end}} gt-mb-4" id="add-deploy-key-panel">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="field">
Expand Down
30 changes: 15 additions & 15 deletions templates/user/settings/keys_gpg.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<h4 class="ui top attached header">
{{.locale.Tr "settings.manage_gpg_keys"}}
<div class="ui right">
<button class="ui primary tiny show-panel button" data-panel="#add-gpg-key-panel">{{.locale.Tr "settings.add_key"}}</button>
<button class="ui primary tiny show-panel toggle button" data-panel="#add-gpg-key-panel">{{.locale.Tr "settings.add_key"}}</button>
</div>
</h4>
<div class="ui attached segment">
<div class="{{if not .HasGPGError}}gt-hidden{{end}}" id="add-gpg-key-panel">
<div class="{{if not .HasGPGError}}gt-hidden{{end}} gt-mb-4" id="add-gpg-key-panel">
<form class="ui form{{if .HasGPGError}} error{{end}}" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="title" value="none">
Expand Down Expand Up @@ -41,7 +41,10 @@
</div>
<div class="flex-list">
<div class="flex-item">
{{.locale.Tr "settings.gpg_desc"}}
<p>
{{.locale.Tr "settings.gpg_desc"}}<br>
{{.locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}
</p>
</div>
{{range .GPGKeys}}
<div class="flex-item">
Expand Down Expand Up @@ -107,17 +110,14 @@
{{end}}
{{end}}
</div>
</div>
<br>
<p>{{.locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}</p>

<div class="ui g-modal-confirm delete modal" id="delete-gpg">
<div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.gpg_key_deletion"}}
</div>
<div class="content">
<p>{{.locale.Tr "settings.gpg_key_deletion_desc"}}</p>
<div class="ui g-modal-confirm delete modal" id="delete-gpg">
<div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.gpg_key_deletion"}}
</div>
<div class="content">
<p>{{.locale.Tr "settings.gpg_key_deletion_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/modal_actions_confirm" .}}
</div>
30 changes: 15 additions & 15 deletions templates/user/settings/keys_ssh.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<h4 class="ui top attached header">
{{.locale.Tr "settings.manage_ssh_keys"}}
<div class="ui right">
<button id="add-ssh-button" class="ui primary tiny show-panel button" data-panel="#add-ssh-key-panel">
<button id="add-ssh-button" class="ui primary tiny show-panel toggle button" data-panel="#add-ssh-key-panel">
{{.locale.Tr "settings.add_key"}}
</button>
</div>
</h4>
<div class="ui attached segment">
<div class="{{if not .HasSSHError}}gt-hidden{{end}}" id="add-ssh-key-panel">
<div class="{{if not .HasSSHError}}gt-hidden{{end}} gt-mb-4" id="add-ssh-key-panel">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="field {{if .Err_Title}}error{{end}}">
Expand All @@ -29,7 +29,10 @@
</div>
<div id="keys-ssh" class="flex-list">
<div class="flex-item">
{{.locale.Tr "settings.ssh_desc"}}
<p>
{{.locale.Tr "settings.ssh_desc"}}<br>
{{.locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}
</p>
</div>
{{if .DisableSSH}}
<div class="flex-item">
Expand Down Expand Up @@ -95,17 +98,14 @@
{{end}}
{{end}}
</div>
</div>
<br>
<p>{{.locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}</p>

<div class="ui g-modal-confirm delete modal" id="delete-ssh">
<div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.ssh_key_deletion"}}
</div>
<div class="content">
<p>{{.locale.Tr "settings.ssh_key_deletion_desc"}}</p>
<div class="ui g-modal-confirm delete modal" id="delete-ssh">
<div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.ssh_key_deletion"}}
</div>
<div class="content">
<p>{{.locale.Tr "settings.ssh_key_deletion_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>
{{template "base/modal_actions_confirm" .}}
</div>
6 changes: 3 additions & 3 deletions web_src/css/shared/flex-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@
border-top: 1px solid var(--color-secondary);
}

/* Fomantic UI segment has default "padding: 1em", so here it removes the padding-top and padding-bottom accordingly.
/* Fomantic UI segment has default "padding: 1em", so here it removes the padding-top and padding-bottom accordingly (there might also be some `gt-hidden` siblings).
Developers could also use "flex-space-fitted" class to remove the first item's padding-top and the last item's padding-bottom */
.flex-list.flex-space-fitted > .flex-item:first-child,
.ui.segment > .flex-list:first-child > .flex-item:first-child {
.ui.segment > .flex-list > .flex-item:first-child {
padding-top: 0;
}

.flex-list.flex-space-fitted > .flex-item:last-child,
.ui.segment > .flex-list:last-child > .flex-item:last-child {
.ui.segment > .flex-list > .flex-item:last-child {
padding-bottom: 0;
}

Expand Down