From 8371f94d06cefbd65392af3b5c0f1fd1057429f7 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Wed, 26 Apr 2017 15:10:43 +0200 Subject: Rework SSH key management UI to add GPG (#1293) * Rework SSH key management UI to add GPG * Add more detail to gpg key display * Update CHANGELOG.md * Implement deletion UI * Implement adding gpg UI * Various fixes - Fix duplicate entry in locale - Re-generate hash before verification since they are consumed * Add missing translation * Split template * Catch not found/verified email error --- templates/user/settings/keys.tmpl | 12 ++++++ templates/user/settings/keys_gpg.tmpl | 67 +++++++++++++++++++++++++++++++ templates/user/settings/keys_ssh.tmpl | 67 +++++++++++++++++++++++++++++++ templates/user/settings/navbar.tmpl | 4 +- templates/user/settings/sshkeys.tmpl | 74 ----------------------------------- 5 files changed, 148 insertions(+), 76 deletions(-) create mode 100644 templates/user/settings/keys.tmpl create mode 100644 templates/user/settings/keys_gpg.tmpl create mode 100644 templates/user/settings/keys_ssh.tmpl delete mode 100644 templates/user/settings/sshkeys.tmpl (limited to 'templates') diff --git a/templates/user/settings/keys.tmpl b/templates/user/settings/keys.tmpl new file mode 100644 index 0000000000..86d2204eb1 --- /dev/null +++ b/templates/user/settings/keys.tmpl @@ -0,0 +1,12 @@ +{{template "base/head" .}} +
+ {{template "user/settings/navbar" .}} +
+ {{template "base/alert" .}} + {{template "user/settings/keys_ssh" .}} +
+ {{template "user/settings/keys_gpg" .}} +
+
+ +{{template "base/footer" .}} diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl new file mode 100644 index 0000000000..b0c3e1bda7 --- /dev/null +++ b/templates/user/settings/keys_gpg.tmpl @@ -0,0 +1,67 @@ +

+ {{.i18n.Tr "settings.manage_gpg_keys"}} +
+
{{.i18n.Tr "settings.add_key"}}
+
+

+
+
+
+ {{.i18n.Tr "settings.gpg_desc"}} +
+ {{range .GPGKeys}} +
+
+ +
+ +
+ {{range .Emails}}{{.Email}} {{end}} +
+ {{$.i18n.Tr "settings.key_id"}}: {{.KeyID}} + {{$.i18n.Tr "settings.subkeys"}}: {{range .SubsKey}} {{.KeyID}} {{end}} +
+
+ {{$.i18n.Tr "settings.add_on"}} {{DateFmtShort .Added}} + - + {{$.i18n.Tr "settings.valid_until"}} {{DateFmtShort .Expired}} +
+
+
+ {{end}} +
+
+
+

{{.i18n.Tr "settings.gpg_helper" "https://help.github.com/articles/about-gpg/" | Str2html}}

+
+

+ {{.i18n.Tr "settings.add_new_gpg_key"}} +

+
+
+ {{.CsrfTokenHtml}} + +
+ + +
+ + +
+
+
+ + diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl new file mode 100644 index 0000000000..1bdf0b15b1 --- /dev/null +++ b/templates/user/settings/keys_ssh.tmpl @@ -0,0 +1,67 @@ +

+ {{.i18n.Tr "settings.manage_ssh_keys"}} +
+
{{.i18n.Tr "settings.add_key"}}
+
+

+
+
+
+ {{.i18n.Tr "settings.ssh_desc"}} +
+ {{range .Keys}} +
+
+ +
+ +
+ {{.Name}} +
+ {{.Fingerprint}} +
+
+ {{$.i18n.Tr "settings.add_on"}} {{DateFmtShort .Created}} {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{DateFmtShort .Updated}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} +
+
+
+ {{end}} +
+
+
+

{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}

+
+

+ {{.i18n.Tr "settings.add_new_key"}} +

+
+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+ + +
+
+
+ + diff --git a/templates/user/settings/navbar.tmpl b/templates/user/settings/navbar.tmpl index d798d40219..4aac9effb5 100644 --- a/templates/user/settings/navbar.tmpl +++ b/templates/user/settings/navbar.tmpl @@ -16,8 +16,8 @@ OpenID {{end}} - - {{.i18n.Tr "settings.ssh_keys"}} + + {{.i18n.Tr "settings.ssh_gpg_keys"}} {{.i18n.Tr "settings.applications"}} diff --git a/templates/user/settings/sshkeys.tmpl b/templates/user/settings/sshkeys.tmpl deleted file mode 100644 index 7942afde41..0000000000 --- a/templates/user/settings/sshkeys.tmpl +++ /dev/null @@ -1,74 +0,0 @@ -{{template "base/head" .}} -
- {{template "user/settings/navbar" .}} -
- {{template "base/alert" .}} -

- {{.i18n.Tr "settings.manage_ssh_keys"}} -
-
{{.i18n.Tr "settings.add_key"}}
-
-

-
-
-
- {{.i18n.Tr "settings.ssh_desc"}} -
- {{range .Keys}} -
-
- -
- -
- {{.Name}} -
- {{.Fingerprint}} -
-
- {{$.i18n.Tr "settings.add_on"}} {{DateFmtShort .Created}} {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{DateFmtShort .Updated}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} -
-
-
- {{end}} -
-
-
-

{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}

-
-

- {{.i18n.Tr "settings.add_new_key"}} -

-
-
- {{.CsrfTokenHtml}} -
- - -
-
- - -
- -
-
-
-
-
- - -{{template "base/footer" .}} -- cgit v1.2.3