From 0590cb7048adfb4bde52372dc2b332e65f22b7b0 Mon Sep 17 00:00:00 2001 From: SIkebe Date: Mon, 14 Sep 2020 10:42:50 +0900 Subject: [PATCH] Improve accessibility (#2552) * Document language missing * Missing form label * Image elements do not have [alt] attributes * Fix metals specific configuration * [user-scalable="no"] is used in the element or the [maximum-scale] attribute is less than 5 * Fix AvatarImageProviderSpec * [id] attributes on active, focusable elements are not unique * Links do not have a discernible name * Links to cross-origin destinations are unsafe --- .gitignore | 6 +- .../core/view/AvatarImageProvider.scala | 4 +- .../gitbucket/core/account/edit.scala.html | 2 +- .../core/account/groupform.scala.html | 6 +- .../gitbucket/core/account/hooks.scala.html | 6 +- .../gitbucket/core/account/newrepo.scala.html | 4 +- .../gitbucket/core/admin/data.scala.html | 88 +++++++++---------- .../core/admin/settings_system.scala.html | 10 +-- .../gitbucket/core/admin/user.scala.html | 6 +- .../core/dashboard/issueslist.scala.html | 4 +- .../gitbucket/core/dashboard/repos.scala.html | 2 +- .../core/dashboard/sidebar.scala.html | 2 +- .../gitbucket/core/helper/account.scala.html | 2 +- .../core/helper/commitcomment.scala.html | 4 +- .../core/helper/datepicker.scala.html | 26 +++--- .../gitbucket/core/helper/dropdown.scala.html | 3 +- .../gitbucket/core/helper/preview.scala.html | 3 +- .../core/issues/commentform.scala.html | 2 +- .../gitbucket/core/issues/list.scala.html | 4 +- .../core/issues/listparts.scala.html | 8 +- .../core/issues/milestones/edit.scala.html | 2 +- src/main/twirl/gitbucket/core/main.scala.html | 8 +- .../core/pulls/mergeguide.scala.html | 2 +- .../gitbucket/core/releases/form.scala.html | 8 +- .../twirl/gitbucket/core/repo/blob.scala.html | 4 +- .../gitbucket/core/repo/editor.scala.html | 12 ++- .../gitbucket/core/repo/files.scala.html | 8 +- .../twirl/gitbucket/core/repo/find.scala.html | 2 +- .../core/settings/branches.scala.html | 4 +- .../gitbucket/core/settings/danger.scala.html | 2 +- .../core/settings/edithookform.scala.html | 8 +- .../gitbucket/core/settings/hooks.scala.html | 2 +- .../twirl/gitbucket/core/wiki/edit.scala.html | 3 +- .../gitbucket/core/wiki/history.scala.html | 2 +- .../twirl/gitbucket/core/wiki/page.scala.html | 6 +- src/main/webapp/assets/common/js/gitbucket.js | 2 +- .../core/view/AvatarImageProviderSpec.scala | 14 +-- 37 files changed, 143 insertions(+), 138 deletions(-) diff --git a/.gitignore b/.gitignore index d2cedb993..5769fee83 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,8 @@ project/plugins/project/ # Metals specific .metals .bloop -project/metals.sbt \ No newline at end of file +**/metals.sbt + +# Visual Studio Code specific +.vscode + diff --git a/src/main/scala/gitbucket/core/view/AvatarImageProvider.scala b/src/main/scala/gitbucket/core/view/AvatarImageProvider.scala index 3df7c8602..cd1b0966e 100644 --- a/src/main/scala/gitbucket/core/view/AvatarImageProvider.scala +++ b/src/main/scala/gitbucket/core/view/AvatarImageProvider.scala @@ -45,11 +45,11 @@ trait AvatarImageProvider { self: RequestCache => if (tooltip) { Html( - s"""""" + s"""@${userName}""" ) } else { Html( - s"""""" + s"""@${userName}""" ) } } diff --git a/src/main/twirl/gitbucket/core/account/edit.scala.html b/src/main/twirl/gitbucket/core/account/edit.scala.html index 25c3dc028..2ba6424dc 100644 --- a/src/main/twirl/gitbucket/core/account/edit.scala.html +++ b/src/main/twirl/gitbucket/core/account/edit.scala.html @@ -34,7 +34,7 @@
Additional Mail Address: @extraMailAddresses.zipWithIndex.map { case (mail, idx) => - + }
diff --git a/src/main/twirl/gitbucket/core/account/groupform.scala.html b/src/main/twirl/gitbucket/core/account/groupform.scala.html index 6d74cc179..6d5ebc2bc 100644 --- a/src/main/twirl/gitbucket/core/account/groupform.scala.html +++ b/src/main/twirl/gitbucket/core/account/groupform.scala.html @@ -17,14 +17,14 @@ }
- +
- +
@@ -119,7 +119,7 @@ $(function(){ .append(' ') .append($('').attr('href', '@context.path/' + userName).text(userName)) .append(' ') - .append($(''))); + .append($(''))); } function updateMembers(){ diff --git a/src/main/twirl/gitbucket/core/account/hooks.scala.html b/src/main/twirl/gitbucket/core/account/hooks.scala.html index 66c0e607a..5b2bd1731 100644 --- a/src/main/twirl/gitbucket/core/account/hooks.scala.html +++ b/src/main/twirl/gitbucket/core/account/hooks.scala.html @@ -13,7 +13,7 @@

These webhooks notify external services when certain events occur within any of your repositories. When any of the specified events occur, GitBucket will send a POST request to all of the endpoints (URLs) you provide. - Learn more about this feature on the GitBucket Wiki. + Learn more about this feature on the GitBucket Wiki.

Add webhook @@ -27,10 +27,10 @@ diff --git a/src/main/twirl/gitbucket/core/account/newrepo.scala.html b/src/main/twirl/gitbucket/core/account/newrepo.scala.html index 4fcaaf4ad..4b8be892f 100644 --- a/src/main/twirl/gitbucket/core/account/newrepo.scala.html +++ b/src/main/twirl/gitbucket/core/account/newrepo.scala.html @@ -32,7 +32,7 @@ isCreateRepoOptionPublic: Boolean)(implicit context: gitbucket.core.controller.C
Repository name
- +
@@ -86,7 +86,7 @@ isCreateRepoOptionPublic: Boolean)(implicit context: gitbucket.core.controller.C Create a new repository by cloning an existing git repository. - +
diff --git a/src/main/twirl/gitbucket/core/admin/data.scala.html b/src/main/twirl/gitbucket/core/admin/data.scala.html index fadc0f384..92de87e72 100644 --- a/src/main/twirl/gitbucket/core/admin/data.scala.html +++ b/src/main/twirl/gitbucket/core/admin/data.scala.html @@ -1,44 +1,44 @@ -@(tableNames: Seq[String])(implicit context: gitbucket.core.controller.Context) -@gitbucket.core.html.main("Data export / import"){ - @gitbucket.core.admin.html.menu("data") { -
-
Export
-
-
- @tableNames.map { tableName => -
- -
- } - -
-
-
- -
-
Import
-
-
- - -
-
-
- } -} - \ No newline at end of file +@(tableNames: Seq[String])(implicit context: gitbucket.core.controller.Context) +@gitbucket.core.html.main("Data export / import"){ + @gitbucket.core.admin.html.menu("data") { +
+
Export
+
+
+ @tableNames.map { tableName => +
+ +
+ } + +
+
+
+ +
+
Import
+
+
+ + +
+
+
+ } +} + diff --git a/src/main/twirl/gitbucket/core/admin/settings_system.scala.html b/src/main/twirl/gitbucket/core/admin/settings_system.scala.html index f728a0c71..3babcebeb 100644 --- a/src/main/twirl/gitbucket/core/admin/settings_system.scala.html +++ b/src/main/twirl/gitbucket/core/admin/settings_system.scala.html @@ -35,7 +35,7 @@
- +
@@ -51,9 +51,9 @@
- +
- +
@@ -97,9 +97,9 @@
- +
- +
diff --git a/src/main/twirl/gitbucket/core/admin/user.scala.html b/src/main/twirl/gitbucket/core/admin/user.scala.html index ae791bb35..f74193297 100644 --- a/src/main/twirl/gitbucket/core/admin/user.scala.html +++ b/src/main/twirl/gitbucket/core/admin/user.scala.html @@ -53,7 +53,7 @@
Additional Mail Address: @extraMailAddresses.zipWithIndex.map { case (mail, idx) => - + }
@@ -67,14 +67,14 @@
- +
- +
diff --git a/src/main/twirl/gitbucket/core/dashboard/issueslist.scala.html b/src/main/twirl/gitbucket/core/dashboard/issueslist.scala.html index 74493e9d9..5476ad5bb 100644 --- a/src/main/twirl/gitbucket/core/dashboard/issueslist.scala.html +++ b/src/main/twirl/gitbucket/core/dashboard/issueslist.scala.html @@ -22,9 +22,9 @@ @issue.userName/@issue.repositoryName ・ @if(issue.isPullRequest){ - @issue.title + @issue.title } else { - @issue.title + @issue.title } @gitbucket.core.issues.html.commitstatus(issue, commitStatus) @labels.map { label => diff --git a/src/main/twirl/gitbucket/core/dashboard/repos.scala.html b/src/main/twirl/gitbucket/core/dashboard/repos.scala.html index 5a9b5a0b7..3e268d986 100644 --- a/src/main/twirl/gitbucket/core/dashboard/repos.scala.html +++ b/src/main/twirl/gitbucket/core/dashboard/repos.scala.html @@ -7,7 +7,7 @@ @gitbucket.core.dashboard.html.tab("repos")
- diff --git a/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html b/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html index 8de6f5bbc..35a40452d 100644 --- a/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html +++ b/src/main/twirl/gitbucket/core/dashboard/sidebar.scala.html @@ -7,7 +7,7 @@ @if(recentRepositories.isEmpty){
  • No repositories
  • } else { -
  • +
  • @recentRepositories.zipWithIndex.map { case (repository, i) =>