From 5a2add64e733aabdc8d799246173f4013a8d02ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Sun, 5 Jun 2022 18:59:07 +0200 Subject: [PATCH 1/2] Improve UX on modal for deleting an access token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before, both action buttons where coloured on hover. Otherwise they appeared as ghost buttons. UX tells us, that call to action must not be displayed as ghost button. Using red is perceived as warning colour in Western cultures. It was used for the non-destructive action before. This PR swaps the colour and turns the cancel button into a filled one, so it is saver to do nothing then to accidentally delete an access button. We want the person to do this consciously. In another iteration the wording here could be improved. See the associated issue for further details. Signed-off-by: André Jaenisch --- templates/user/settings/applications.tmpl | 142 +++++++++++----------- 1 file changed, 74 insertions(+), 68 deletions(-) diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 811ce5d64397..1dde74c502f8 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -1,77 +1,83 @@ {{template "base/head" .}}
- {{template "user/settings/navbar" .}} -
- {{template "base/alert" .}} -

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

-
-
-
- {{.i18n.Tr "settings.tokens_desc"}} -
- {{range .Tokens}} -
-
- -
- -
- {{.Name}} -
- {{$.i18n.Tr "settings.add_on"}} {{.CreatedUnix.FormatShort}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{.UpdatedUnix.FormatShort}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} -
-
-
- {{end}} -
-
-
-
- {{.i18n.Tr "settings.generate_new_token"}} -
-

{{.i18n.Tr "settings.new_token_desc"}}

-
- {{.CsrfTokenHtml}} -
- - -
- -
-
+ {{template "user/settings/navbar" .}} +
+ {{template "base/alert" .}} +

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

+
+
+
+ {{.i18n.Tr "settings.tokens_desc"}} +
+ {{range .Tokens}} +
+
+ +
+ +
+ {{.Name}} +
+ {{$.i18n.Tr "settings.add_on"}} {{.CreatedUnix.FormatShort}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{.UpdatedUnix.FormatShort}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} +
+
+
+ {{end}} +
+
+
+
+ {{.i18n.Tr "settings.generate_new_token"}} +
+

{{.i18n.Tr "settings.new_token_desc"}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ +
+
- {{if .EnableOAuth2}} - {{template "user/settings/grants_oauth2" .}} - {{template "user/settings/applications_oauth2" .}} - {{end}} -
+ {{if .EnableOAuth2}} + {{template "user/settings/grants_oauth2" .}} + {{template "user/settings/applications_oauth2" .}} + {{end}} +
From 7a877a3e9d0c8f4c4fd3779d5614f635ef53975f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Sun, 5 Jun 2022 19:18:40 +0200 Subject: [PATCH 2/2] Use tabs instead of spaces. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linter does not complain anymore. I was expecting the formatter to pick this up but it didn't. Signed-off-by: André Jaenisch --- templates/user/settings/applications.tmpl | 148 +++++++++++----------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 1dde74c502f8..6386eb3391d1 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -1,83 +1,83 @@ {{template "base/head" .}}
- {{template "user/settings/navbar" .}} -
- {{template "base/alert" .}} -

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

-
-
-
- {{.i18n.Tr "settings.tokens_desc"}} -
- {{range .Tokens}} -
-
- -
- -
- {{.Name}} -
- {{$.i18n.Tr "settings.add_on"}} {{.CreatedUnix.FormatShort}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{.UpdatedUnix.FormatShort}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} -
-
-
- {{end}} -
-
-
-
- {{.i18n.Tr "settings.generate_new_token"}} -
-

{{.i18n.Tr "settings.new_token_desc"}}

-
- {{.CsrfTokenHtml}} -
- - -
- -
-
+ {{template "user/settings/navbar" .}} +
+ {{template "base/alert" .}} +

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

+
+
+
+ {{.i18n.Tr "settings.tokens_desc"}} +
+ {{range .Tokens}} +
+
+ +
+ +
+ {{.Name}} +
+ {{$.i18n.Tr "settings.add_on"}} {{.CreatedUnix.FormatShort}} — {{svg "octicon-info"}} {{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{.UpdatedUnix.FormatShort}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}} +
+
+
+ {{end}} +
+
+
+
+ {{.i18n.Tr "settings.generate_new_token"}} +
+

{{.i18n.Tr "settings.new_token_desc"}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ +
+
- {{if .EnableOAuth2}} - {{template "user/settings/grants_oauth2" .}} - {{template "user/settings/applications_oauth2" .}} - {{end}} -
+ {{if .EnableOAuth2}} + {{template "user/settings/grants_oauth2" .}} + {{template "user/settings/applications_oauth2" .}} + {{end}} +