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 <meta name="viewport"> 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
This commit is contained in:
SIkebe
2020-09-14 10:42:50 +09:00
committed by GitHub
parent b35d0792aa
commit 0590cb7048
37 changed files with 143 additions and 138 deletions

6
.gitignore vendored
View File

@@ -28,4 +28,8 @@ project/plugins/project/
# Metals specific
.metals
.bloop
project/metals.sbt
**/metals.sbt
# Visual Studio Code specific
.vscode

View File

@@ -45,11 +45,11 @@ trait AvatarImageProvider { self: RequestCache =>
if (tooltip) {
Html(
s"""<img src="${src}" class="${if (size > 20) { "avatar" } else { "avatar-mini" }}" style="width: ${size}px; height: ${size}px;" data-toggle="tooltip" title="${userName}"/>"""
s"""<img src="${src}" class="${if (size > 20) { "avatar" } else { "avatar-mini" }}" style="width: ${size}px; height: ${size}px;" data-toggle="tooltip" title="${userName}" alt="@${userName}" />"""
)
} else {
Html(
s"""<img src="${src}" class="${if (size > 20) { "avatar" } else { "avatar-mini" }}" style="width: ${size}px; height: ${size}px;" />"""
s"""<img src="${src}" class="${if (size > 20) { "avatar" } else { "avatar-mini" }}" style="width: ${size}px; height: ${size}px;" alt="@${userName}" />"""
)
}
}

View File

@@ -34,7 +34,7 @@
<fieldset class="form-group" id="extraMailAddresses">
<span class="strong">Additional Mail Address:</span>
@extraMailAddresses.zipWithIndex.map { case (mail, idx) =>
<input type="text" name="extraMailAddresses[@idx]" id="extraMailAddresses[@idx]" class="form-control extraMailAddress" value="@mail"/>
<input type="text" name="extraMailAddresses[@idx]" id="extraMailAddresses[@idx]" class="form-control extraMailAddress" value="@mail" aria-label="Additional mail address"/>
<span id="error-extraMailAddresses_@idx" class="error"></span>
}
</fieldset>

View File

@@ -17,14 +17,14 @@
}
</fieldset>
<fieldset class="form-group">
<label class="strong">URL (Optional)</label>
<label class="strong" for="url">URL (Optional)</label>
<div>
<span id="error-url" class="error"></span>
</div>
<input type="text" name="url" id="url" class="form-control" value="@account.map(_.url)"/>
</fieldset>
<fieldset class="form-group">
<label for="groupDescription" class="strong">Description (Optional)</label>
<label for="description" class="strong">Description (Optional)</label>
<div>
<textarea name="description" id="description" class="form-control">@account.map(_.description)</textarea>
</div>
@@ -119,7 +119,7 @@ $(function(){
.append(' ')
.append($('<a>').attr('href', '@context.path/' + userName).text(userName))
.append(' ')
.append($('<a href="#" class="remove pull-right"><span class="octicon octicon-x"></span></a>')));
.append($('<a href="#" class="remove pull-right"><span class="octicon octicon-x" aria-label="Remove"></span></a>')));
}
function updateMembers(){

View File

@@ -13,7 +13,7 @@
<p>
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 <a href="https://github.com/gitbucket/gitbucket/wiki/API-WebHook" target="_blank">GitBucket Wiki</a>.
Learn more about this feature on the <a href="https://github.com/gitbucket/gitbucket/wiki/API-WebHook" target="_blank" rel="noopener">GitBucket Wiki</a>.
</p>
<a href="@helpers.url(account.userName)/_hooks/new" class="btn btn-success pull-right" style="margin-bottom: 10px;">Add webhook</a>
@@ -27,10 +27,10 @@
</td><td>
<div class="btn-group pull-right">
<a href="@helpers.url(account.userName)/_hooks/edit?url=@helpers.urlEncode(webHook.url)" class="btn btn-default">
<span class="octicon octicon-pencil"></span>
<span class="octicon octicon-pencil" aria-label="Edit hook"></span>
</a>
<a href="@helpers.url(account.userName)/_hooks/delete?url=@helpers.urlEncode(webHook.url)" class="btn btn-danger" onclick="return confirm('delete webhook for @webHook.url ?')">
<span class="octicon octicon-x"></span>
<span class="octicon octicon-x" aria-label="Remove hook"></span>
</a>
</div>
</td></tr>

View File

@@ -32,7 +32,7 @@ isCreateRepoOptionPublic: Boolean)(implicit context: gitbucket.core.controller.C
<dl>
<dt>Repository name</dt>
<dd style="margin-left: 0px;">
<input type="text" name="name" id="name" class="form-control" style="width: 300px; display: inline;" autofocus/>
<input type="text" name="name" id="name" class="form-control" style="width: 300px; display: inline;" autofocus aria-label="Repository name"/>
<span id="error-name" class="error"></span>
</dd>
</dl>
@@ -86,7 +86,7 @@ isCreateRepoOptionPublic: Boolean)(implicit context: gitbucket.core.controller.C
Create a new repository by cloning an existing git repository.
</div>
</label>
<input type="text" class="form-control" name="sourceUrl" id="sourceUrl" disabled placeholder="Source git repository URL..."/>
<input type="text" class="form-control" name="sourceUrl" id="sourceUrl" disabled placeholder="Source git repository URL..." aria-label="Source URL"/>
<span id="error-sourceUrl" class="error"></span>
</fieldset>
<fieldset class="border-top form-actions">

View File

@@ -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") {
<div class="panel panel-default">
<div class="panel-heading strong">Export</div>
<div class="panel-body">
<form class="form form-horizontal" action="@context.path/admin/export" method="POST">
@tableNames.map { tableName =>
<div class="checkbox">
<label>
<input type="checkbox" name="tableNames" id="@tableName" value="@tableName" checked/> @tableName
</label>
</div>
}
<input type="submit" class="btn btn-success pull-right" value="Export">
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading strong">Import</div>
<div class="panel-body">
<form class="form form-horizontal" action="@context.path/upload/import" method="POST" enctype="multipart/form-data" id="import-form">
<input type="file" name="file" id="file">
<input type="submit" class="btn btn-success pull-right" value="Import" id="import">
</form>
</div>
</div>
}
}
<script>
$(function(){
$('#import-form').submit(function(){
if($('#file').val() == ''){
alert('Choose an import SQL file.');
return false;
} else if(!$('#file').val().endsWith(".sql")){
alert('Import is available for only the SQL file.');
return false;
}
return confirm('All existing data is deleted before importing.\nAre you sure?');
})
})
</script>
@(tableNames: Seq[String])(implicit context: gitbucket.core.controller.Context)
@gitbucket.core.html.main("Data export / import"){
@gitbucket.core.admin.html.menu("data") {
<div class="panel panel-default">
<div class="panel-heading strong">Export</div>
<div class="panel-body">
<form class="form form-horizontal" action="@context.path/admin/export" method="POST">
@tableNames.map { tableName =>
<div class="checkbox">
<label>
<input type="checkbox" name="tableNames" id="@tableName" value="@tableName" checked/> @tableName
</label>
</div>
}
<input type="submit" class="btn btn-success pull-right" value="Export">
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading strong">Import</div>
<div class="panel-body">
<form class="form form-horizontal" action="@context.path/upload/import" method="POST" enctype="multipart/form-data" id="import-form">
<input type="file" name="file" id="file" aria-label="Upload file">
<input type="submit" class="btn btn-success pull-right" value="Import" id="import">
</form>
</div>
</div>
}
}
<script>
$(function(){
$('#import-form').submit(function(){
if($('#file').val() == ''){
alert('Choose an import SQL file.');
return false;
} else if(!$('#file').val().endsWith(".sql")){
alert('Import is available for only the SQL file.');
return false;
}
return confirm('All existing data is deleted before importing.\nAre you sure?');
})
})
</script>

View File

@@ -35,7 +35,7 @@
<!-- Base URL -->
<!--====================================================================-->
<hr>
<label><span class="strong">Base URL</span> (e.g. <code>http://example.com/gitbucket</code>)</label>
<label for="baseUrl"><span class="strong">Base URL</span> (e.g. <code>http://example.com/gitbucket</code>)</label>
<fieldset>
<div class="controls">
<input type="text" name="baseUrl" id="baseUrl" class="form-control" value="@context.settings.baseUrl"/>
@@ -51,9 +51,9 @@
<!-- Information -->
<!--====================================================================-->
<hr>
<label><span class="strong">Site notification</span> (Supports HTML)</label>
<label for="information"><span class="strong">Site notification</span> (Supports HTML)</label>
<fieldset>
<textarea name="information" class="form-control" style="height: 100px;">@context.settings.information</textarea>
<textarea id="information" name="information" class="form-control" style="height: 100px;">@context.settings.information</textarea>
</fieldset>
<!--====================================================================-->
<!-- AdminLTE SkinName -->
@@ -97,9 +97,9 @@
<!-- User-defined CSS -->
<!--====================================================================-->
<hr>
<label><span class="strong">User-defined CSS</span></label>
<label for="userDefinedCss"><span class="strong">User-defined CSS</span></label>
<fieldset>
<textarea name="userDefinedCss" class="form-control" style="height: 100px;">@context.settings.userDefinedCss</textarea>
<textarea id="userDefinedCss" name="userDefinedCss" class="form-control" style="height: 100px;">@context.settings.userDefinedCss</textarea>
</fieldset>
<!--====================================================================-->
<!-- Account registration -->

View File

@@ -53,7 +53,7 @@
<fieldset class="form-group" id="extraMailAddresses">
<span class="strong">Additional Mail Address:</span>
@extraMailAddresses.zipWithIndex.map { case (mail, idx) =>
<input type="text" name="extraMailAddresses[@idx]" id="extraMailAddresses[@idx]" class="form-control extraMailAddress" value="@mail"/>
<input type="text" name="extraMailAddresses[@idx]" id="extraMailAddresses[@idx]" class="form-control extraMailAddress" value="@mail" aria-label="Additional mail address"/>
<span id="error-extraMailAddresses_@idx" class="error"></span>
}
</fieldset>
@@ -67,14 +67,14 @@
</label>
</fieldset>
<fieldset class="form-group">
<label class="strong">URL (Optional):</label>
<label class="strong" for="url">URL (Optional):</label>
<div>
<span id="error-url" class="error"></span>
</div>
<input type="text" name="url" id="url" class="form-control" value="@account.map(_.url)"/>
</fieldset>
<fieldset class="form-group">
<label class="strong">Bio (Optional):</label>
<label class="strong" for="description">Bio (Optional):</label>
<div>
<span id="error-description" class="error"></span>
</div>

View File

@@ -22,9 +22,9 @@
<td style="padding-top: 12px; padding-bottom: 12px;">
<a href="@context.path/@issue.userName/@issue.repositoryName">@issue.userName/@issue.repositoryName</a>&nbsp;&#xFF65;
@if(issue.isPullRequest){
<a href="@context.path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
<a id="issue_@(issue.issueId)_link" href="@context.path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
} else {
<a href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a>
<a id="issue_@(issue.issueId)_link" href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a>
}
@gitbucket.core.issues.html.commitstatus(issue, commitStatus)
@labels.map { label =>

View File

@@ -7,7 +7,7 @@
@gitbucket.core.dashboard.html.tab("repos")
<div class="container">
<div class="btn-group" id="owner-dropdown">
<button id="test" class="dropdown-toggle btn btn-default" data-toggle="dropdown" aria-expanded="false">
<button class="dropdown-toggle btn btn-default" data-toggle="dropdown" aria-expanded="false">
<span class="strong">All</span>
<span class="caret"></span>
</button>

View File

@@ -7,7 +7,7 @@
@if(recentRepositories.isEmpty){
<li>No repositories</li>
} else {
<li><form class="sidebar-form"><input type="text" id="filter-box" class="form-control input-sm" placeholder="Find a repository"/></form></li>
<li><form class="sidebar-form"><input type="text" id="filter-box" class="form-control input-sm" placeholder="Find a repository" aria-label="Search"/></form></li>
@recentRepositories.zipWithIndex.map { case (repository, i) =>
<li class="repo-link menu-item-hover">
<a href="@helpers.url(repository)">@gitbucket.core.helper.html.repositoryicon(repository, false) <span>@repository.owner/<span class="strong">@repository.name</span></span></a>

View File

@@ -1,6 +1,6 @@
@(id: String, width: Int, user: Boolean, group: Boolean)(implicit context: gitbucket.core.controller.Context)
<span style="margin-right: 0px;">
<input type="text" name="@id" id="@id" class="form-control" autocomplete="off" style="width: @{width}px; margin-bottom: 0px; display: inline; vertical-align: middle;"/>
<input type="text" name="@id" id="@id" class="form-control" autocomplete="off" style="width: @{width}px; margin-bottom: 0px; display: inline; vertical-align: middle;" aria-label="@id"/>
</span>
<script>
$(function(){

View File

@@ -15,8 +15,8 @@
<span class="muted">@gitbucket.core.helper.html.datetimeago(comment.registeredDate)</span>
<span class="pull-right">
@if(hasWritePermission || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil"></i></a>&nbsp;
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x"></i></a>
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil" aria-label="Edit"></i></a>&nbsp;
<a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x" aria-label="Remove"></i></a>
}
</span>
</div>

View File

@@ -1,13 +1,13 @@
@(name: String, value: Option[java.util.Date])
@import gitbucket.core.view.helpers
<div id="@name" class="input-group date" data-date="@value.map(helpers.date)" style="width: 180px;">
<input class="form-control" name="@name" type="text" value="@value.map(helpers.date)"/>
<span class="input-group-addon"><i class="octicon octicon-calendar"></i></span>
</div>
<script>
$(function(){
$('#@name').datetimepicker({
format: 'YYYY-MM-DD'
});
});
</script>
@(name: String, value: Option[java.util.Date])
@import gitbucket.core.view.helpers
<div class="input-group date" data-date="@value.map(helpers.date)" style="width: 180px;">
<input id="@name" class="form-control" name="@name" type="text" value="@value.map(helpers.date)"/>
<span class="input-group-addon"><i class="octicon octicon-calendar"></i></span>
</div>
<script>
$(function(){
$('#@name').datetimepicker({
format: 'YYYY-MM-DD'
});
});
</script>

View File

@@ -6,8 +6,7 @@
filter: (String, String) = ("",""))(body: Html)
@defining(if(filter._1.isEmpty) "" else filter._1 + "-" + scala.util.Random.alphanumeric.take(4).mkString){ filterId =>
<div class="btn-group" @if(style.nonEmpty){style="@style"}>
<button id = "test"
class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
<button class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
@if(value.isEmpty){
<i class="octicon octicon-gear"></i>
} else {

View File

@@ -9,6 +9,7 @@
style: String = "",
styleClass: String = "",
placeholder: String = "Leave a comment",
ariaLabel: String = "Comment body",
elastic: Boolean = false,
focus: Boolean = false,
tabIndex: Int = -2,
@@ -23,7 +24,7 @@
<div class="tab-pane active" style="margin-top: 4px;" id="tab@uid">
<span id="error-content" class="error"></span>
@textarea = {
<textarea id="content@uid" class="form-control" name="content" placeholder="@placeholder" style="resize: vertical; @style"
<textarea id="content@uid" class="form-control" name="content" placeholder="@placeholder" style="resize: vertical; @style" aria-label="@ariaLabel"
@if(tabIndex > -2){ tabindex="@tabIndex"}
@if(styleClass.nonEmpty){ class="@styleClass" }>@content</textarea>
}

View File

@@ -28,7 +28,7 @@
<input type="hidden" id="action" name="action" value="comment"/>
<div class="btn-group dropup">
<input type="submit" class="btn btn-success" tabindex="2" formaction="@helpers.url(repository)/issue_comments/new" value="Comment" id="submit-button"/>
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="Select method">
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">

View File

@@ -26,10 +26,10 @@
</ul>
<form method="GET" action="@helpers.url(repository)/search" id="search-filter-form" class="form-inline pull-right" autocomplete="off">
<div class="input-group">
<input type="text" class="form-control" name="q" placeholder="Search..."/>
<input type="text" class="form-control" name="q" placeholder="Search..." aria-label="Search all issues"/>
<input type="hidden" name="type" value="@target"/>
<span class="input-group-btn">
<button type="submit" id="search-btn" class="btn btn-default"><i class="fa fa-search"></i></button>
<button type="submit" id="search-btn" class="btn btn-default" aria-label="Search all issues"><i class="fa fa-search"></i></button>
</span>
</div>
@if(isEditable){

View File

@@ -26,7 +26,7 @@
<thead>
<tr>
<th style="background-color: #eee;">
<input type="checkbox"/>
<input type="checkbox" aria-label="Select all issues"/>
<span id="table-issues-control">
@gitbucket.core.helper.html.dropdown("Author", filter = ("author", "Find Author...")) {
@collaborators.map { collaborator =>
@@ -210,7 +210,7 @@
<tr>
<td style="padding-top: 12px; padding-bottom: 12px;">
@if(isManageable){
<input type="checkbox" value="@issue.issueId"/>
<input type="checkbox" value="@issue.issueId" aria-labelledby="issue_@(issue.issueId)_link"/>
}
@*
<i class="octicon octicon-issue-@(if(issue.closed) "closed" else "opened")" style="margin-right: 3px;"></i>
@@ -219,9 +219,9 @@
<a href="@context.path/@issue.userName/@issue.repositoryName">@issue.repositoryName</a>&nbsp;&#xFF65;
}
@if(target == "issues"){
<a href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a>
<a id="issue_@(issue.issueId)_link" href="@context.path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a>
} else {
<a href="@context.path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
<a id="issue_@(issue.issueId)_link" href="@context.path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
}
@gitbucket.core.issues.html.commitstatus(issue, commitStatus)
@labels.map { label =>

View File

@@ -10,7 +10,7 @@
<hr style="margin-top: 12px; margin-bottom: 18px;" class="fill-width"/>
<form method="POST" action="@helpers.url(repository)/issues/milestones/@if(milestone.isEmpty){new}else{@milestone.get.milestoneId/edit}" validate="true" autocomplete="off">
<fieldset class="form-group">
<input type="text" id="title" name="title" class="form-control" style="width: 500px;" value="@milestone.map(_.title)" placeholder="Title"/>
<input type="text" id="title" name="title" class="form-control" style="width: 500px;" value="@milestone.map(_.title)" placeholder="Title" aria-label="Title"/>
<span id="error-title" class="error"></span>
</fieldset>
<fieldset class="form-group">

View File

@@ -2,10 +2,10 @@
@import gitbucket.core.plugin.PluginRegistry
@import gitbucket.core.view.helpers
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#">
<html prefix="og: http://ogp.me/ns#" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>@title</title>
<meta property="og:title" content="@title" />
@@ -78,7 +78,7 @@
}
<form id="search" action="@context.path/search" method="GET" class="pc navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" name="query" id="navbar-search-input" class="form-control" placeholder="Find a repository"/>
<input type="text" name="query" id="navbar-search-input" class="form-control" placeholder="Find a repository" aria-label="Search"/>
</div>
</form>
<ul class="pc nav navbar-nav">
@@ -96,7 +96,7 @@
<ul class="nav navbar-nav">
@if(context.loginAccount.isDefined){
<li class="dropdown notifications-menu">
<a class="dropdown-toggle menu" data-toggle="dropdown" href="#">
<a class="dropdown-toggle menu" data-toggle="dropdown" href="#" aria-label="Create new…">
<i class="octicon octicon-plus" style="color: black;"></i><span class="caret" style="color: black; vertical-align: middle;"></span>
</a>
<ul class="dropdown-menu pull-right" style="width: auto;">

View File

@@ -128,7 +128,7 @@
<label class="btn btn-sm btn-default" id="repository-url-ssh"><input type="radio">SSH</label>
}
</div>
<input type="text" class="form-control input-sm" value="@forkedRepository.httpUrl" id="repository-url" readonly />
<input type="text" class="form-control input-sm" value="@forkedRepository.httpUrl" id="repository-url" readonly aria-label="repository-url"/>
}
<div style="margin-top: 10px;">
<p>

View File

@@ -15,9 +15,10 @@
<h3>Update release for @tag.name</h3>
}
<span id="error-name" class="error"></span>
<input type="text" id="release-name" name="name" class="form-control" value="@(release.map { case (release, _) => release.name }.getOrElse(tag.name))" placeholder="Title" style="margin-bottom: 6px;" autofocus/>
<input type="text" id="release-name" name="name" class="form-control" value="@(release.map { case (release, _) => release.name }.getOrElse(tag.name))" placeholder="Title" style="margin-bottom: 6px;" autofocus aria-label="Release name"/>
<div class="pull-right">
Previous tag: <select id="insert-changelog-tag">
<label for="insert-changelog-tag">Previous tag: </label>
<select id="insert-changelog-tag">
@tags.map { tag =>
<option value="@tag">@tag</option>
}
@@ -36,7 +37,8 @@
completionContext = "releases",
style = "height: 200px; max-height: 500px;",
elastic = true,
placeholder = "Describe this release"
placeholder = "Describe this release",
ariaLabel = "Release content"
)
<ul id="assets-list" class="collaborator">
@release.map { case (release, assets) =>

View File

@@ -69,10 +69,10 @@
}
<a class="btn btn-sm btn-default" href="@helpers.url(repository)/commits/@helpers.encodeRefName((branch :: pathList).mkString("/"))">History</a>
@if(hasWritePermission && content.viewType == "text" && repository.branchList.contains(branch)){
<a class="btn btn-sm" style="padding-right: 4px;" href="@helpers.url(repository)/edit/@helpers.encodeRefName((branch :: pathList).mkString("/"))"><i class="octicon octicon-pencil"></i></a>
<a class="btn btn-sm" style="padding-right: 4px;" href="@helpers.url(repository)/edit/@helpers.encodeRefName((branch :: pathList).mkString("/"))"><i class="octicon octicon-pencil" aria-label="Edit"></i></a>
}
@if(hasWritePermission && repository.branchList.contains(branch)){
<a class="btn btn-sm" style="padding-right: 4px;" href="@helpers.url(repository)/remove/@helpers.encodeRefName((branch :: pathList).mkString("/"))"><i class="octicon octicon-trashcan"></i></a>
<a class="btn btn-sm" style="padding-right: 4px;" href="@helpers.url(repository)/remove/@helpers.encodeRefName((branch :: pathList).mkString("/"))"><i class="octicon octicon-trashcan" aria-label="Remove"></i></a>
}
</div>
</div>

View File

@@ -23,7 +23,7 @@
@pathList.zipWithIndex.map { case (section, i) =>
<a href="@helpers.url(repository)/tree/@helpers.encodeRefName((branch :: pathList.take(i + 1)).mkString("/"))">@section</a> /
}
<input type="text" name="newFileName" id="newFileName" class="form-control" placeholder="Name your file..." value="@fileName" style="display: inline; width: 300px;"/>
<input type="text" name="newFileName" id="newFileName" class="form-control" placeholder="Name your file..." value="@fileName" style="display: inline; width: 300px;" aria-label="New file name"/>
<input type="hidden" name="oldFileName" id="oldFileName" value="@fileName"/>
<input type="hidden" name="branch" id="branch" value="@branch"/>
<input type="hidden" name="path" id="path" value="@pathList.mkString("/")"/>
@@ -32,7 +32,7 @@
<tr>
<th>
<div class="pull-right">
<select id="wrap" class="form-control" style="margin-bottom: 0px; padding: 0px;">
<select id="wrap" class="form-control" style="margin-bottom: 0px; padding: 0px;" aria-label="Wrap">
<optgroup label="Line Wrap Mode">
<option value="false">No wrap</option>
<option value="true">Soft wrap</option>
@@ -40,7 +40,7 @@
</select>
</div>
<div class="pull-right">
<select id="theme" class="form-control" style="margin-bottom: 0px; padding: 0px;">
<select id="theme" class="form-control" style="margin-bottom: 0px; padding: 0px;" aria-label="Theme">
<optgroup label="Editor Theme">
<option value="ambiance">Ambiance</option>
<option value="chaos">Chaos</option>
@@ -96,11 +96,9 @@
</table>
<div class="panel panel-default issue-comment-box">
<div class="panel-body">
<div>
<strong>Commit changes</strong>
</div>
<label for="message" class="strong">Commit changes</label>
<div class="form-group">
<input type="text" name="message" class="form-control"/>
<input type="text" id="message" name="message" class="form-control"/>
</div>
<div style="text-align: right;">
@if(fileName.isEmpty){

View File

@@ -34,7 +34,7 @@
<div class="pull-right">
<div class="btn-group">
<a href="@{helpers.url(repository)}/archive@if(pathList.length > 0){/@pathList.map(helpers.urlEncode).mkString("/")}/@{helpers.urlEncode(branch)}.zip" class="btn btn-sm btn-default pc"><i class="octicon octicon-cloud-download"></i> Download ZIP</a>
<a href="@helpers.url(repository)/find/@helpers.encodeRefName(branch)" class="btn btn-sm btn-default" data-hotkey="t"><i class="octicon octicon-search"></i></a>
<a href="@helpers.url(repository)/find/@helpers.encodeRefName(branch)" class="btn btn-sm btn-default" data-hotkey="t" title="Search files"><i class="octicon octicon-search" aria-label="Search files"></i></a>
<a href="@helpers.url(repository)/commits/@helpers.encodeRefName((branch :: pathList).mkString("/"))" class="btn btn-sm btn-default"><i class="octicon octicon-history"></i> @if(commitCount > 10000){10000+} else {@commitCount} @helpers.plural(commitCount, "commit")</a>
</div>
<a href="@helpers.url(repository)/tree/@helpers.encodeRefName((latestCommit.id :: pathList).mkString("/"))" data-hotkey="y" style="display: none;">Transfer to URL with SHA</a>
@@ -43,7 +43,7 @@
<div class="pull-right pc" style="margin-right: 5px;">
<div class="btn-group">
@if(context.platform != "linux" && context.platform != null){
<a href="@RepositoryService.openRepoUrl(repository.httpUrl)" id="repository-clone-url" class="btn btn-sm btn-default"><i class="octicon octicon-desktop-download"></i></a>
<a href="@RepositoryService.openRepoUrl(repository.httpUrl)" id="repository-clone-url" class="btn btn-sm btn-default" title="Open with GitHub Desktop"><i class="octicon octicon-desktop-download" aria-label="Open with GitHub Desktop"></i></a>
}
</div>
</div>
@@ -71,7 +71,7 @@
</ul>
</div>
}
<input type="text" value="@repository.httpUrl" id="repository-url" class="form-control input-sm" readonly>
<input type="text" value="@repository.httpUrl" id="repository-url" class="form-control input-sm" readonly aria-label="repository-url">
}
</div>
</div>
@@ -203,7 +203,7 @@
@filePath.last
@if(hasWritePermission){
<div class="btn-group pull-right">
<a class="btn btn-sm" style="padding-right: 4px;" href="@helpers.url(repository)/edit/@helpers.encodeRefName((branch :: filePath).mkString("/"))"><i class="octicon octicon-pencil"></i></a>
<a class="btn btn-sm" style="padding-right: 4px;" href="@helpers.url(repository)/edit/@helpers.encodeRefName((branch :: filePath).mkString("/"))"><i class="octicon octicon-pencil" aria-label="Edit"></i></a>
</div>
}
</div>

View File

@@ -10,7 +10,7 @@
<div class="find-input">
<span class="bold"><a href="@helpers.url(repository)/tree/@helpers.encodeRefName(branch)">@repository.name</a></span>
/
<input type="text" name="query" class="form-control" style="display: inline; width: 300px;" autocomplete="off" spellcheck="false" autofocus id="tree-finder-field" />
<input type="text" name="query" class="form-control" style="display: inline; width: 300px;" autocomplete="off" spellcheck="false" autofocus id="tree-finder-field" aria-label="query"/>
</div>
</div>

View File

@@ -21,7 +21,7 @@
<p>The default branch is considered the “base” branch in your repository, against which all pull requests and code commits are automatically made (unless you specify a different branch).</p>
<form id="form" method="post" action="@helpers.url(repository)/settings/update_default_branch" validate="true" class="form-inline">
<span class="error" id="error-defaultBranch"></span>
<select name="defaultBranch" id="defaultBranch" class="form-control">
<select name="defaultBranch" id="defaultBranch" class="form-control" aria-label="Default branch">
@repository.branchList.map { branch =>
<option @if(branch==repository.repository.defaultBranch){ selected}>@branch</option>
}
@@ -36,7 +36,7 @@
<div class="panel-body">
<p>Protect branches to disable force pushing, prevent branches from being deleted, and optionally, require status checks before merging.
<form class="form-inline">
<select name="protectBranch" id="protectBranch" onchange="location=$(this).val()" class="form-control">
<select name="protectBranch" id="protectBranch" onchange="location=$(this).val()" class="form-control" aria-label="Protect branch">
<option>Choose a branch...</option>
@repository.branchList.map { branch =>
<option value="@helpers.url(repository)/settings/branches/@helpers.urlEncode(branch)">@branch</option>

View File

@@ -23,7 +23,7 @@
<div>
Rename this repository. This will make the current URL unavailable.
<div class="pull-right">
<input type="text" name="repositoryName" id="repositoryName" class="form-control" style="width: 200px; display: inline; vertical-align: middle;" value="@repository.name"/>
<input type="text" name="repositoryName" id="repositoryName" class="form-control" style="width: 200px; display: inline; vertical-align: middle;" value="@repository.name" aria-label="Repository name"/>
<input type="submit" class="btn btn-danger" value="Rename"/>
<div>
<span id="error-repositoryName" class="error"></span>

View File

@@ -16,7 +16,7 @@
<div class="panel-body">
<form method="POST" validate="true" autocomplete="off">
<fieldset class="form-group">
<label class="strong">Payload URL</label>
<label class="strong" for="url">Payload URL</label>
<div>
<span class="error" id="error-url"></span>
</div>
@@ -29,15 +29,15 @@
<button class="btn btn-default" id="test-hook">Test Hook</button>
</fieldset>
<fieldset class="form-group">
<label class="strong">Content type</label>
<label class="strong" for="ctype">Content type</label>
<div></div>
<select name="ctype" class="form-control" style="width: 500px;">
<select name="ctype" id="ctype" class="form-control" style="width: 500px;">
<option value="@WebHookContentType.FORM.code" @if(webHook.ctype == WebHookContentType.FORM){selected}>@WebHookContentType.FORM.ctype</option>
<option value="@WebHookContentType.JSON.code" @if(webHook.ctype == WebHookContentType.JSON){selected}>@WebHookContentType.JSON.ctype</option>
</select>
</fieldset>
<fieldset class="form-group">
<label class="strong">Security Token</label>
<label class="strong" for="token">Security Token</label>
<div></div>
<input type="text" name="token" id="token" placeholder="leave blank for no X-Hub-Signature usage" value="@webHook.token" class="form-control" style="display: inline; width: 500px; vertical-align: middle;" />
</fieldset>

View File

@@ -14,7 +14,7 @@
<p>
Webhooks notify external services when certain events occur within this repository.
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 <a href="https://github.com/gitbucket/gitbucket/wiki/API-WebHook" target="_blank">GitBucket Wiki</a>.
Learn more about this feature on the <a href="https://github.com/gitbucket/gitbucket/wiki/API-WebHook" target="_blank" rel="noopener">GitBucket Wiki</a>.
</p>
<a href="@helpers.url(repository)/settings/hooks/new" class="btn btn-success pull-right" style="margin-bottom: 10px;">Add webhook</a>

View File

@@ -14,7 +14,7 @@
<h1 class="wiki-title"><span class="muted">Editing</span> @if(pageName.isEmpty){New Page} else {@pageName}</h1>
<form action="@helpers.url(repository)/wiki/@if(page.isEmpty){_new} else {_edit}" method="POST" validate="true" autocomplete="off">
<span id="error-pageName" class="error"></span>
<input type="text" name="pageName" value="@pageName" class="form-control" style="font-weight: bold; margin-bottom: 10px;" placeholder="Input a page name."/>
<input type="text" name="pageName" value="@pageName" class="form-control" style="font-weight: bold; margin-bottom: 10px;" placeholder="Input a page name." aria-label="Page name"/>
<div class="muted attachable">
@gitbucket.core.helper.html.preview(
repository = repository,
@@ -28,6 +28,7 @@
style = "height: 400px;",
styleClass = "monospace",
placeholder = "",
ariaLabel = "Page content",
uid = 1
)
</div>

View File

@@ -36,7 +36,7 @@
<tbody>
@commits.map { commit =>
<tr>
<td style="width: 32px; text-align: center ;"><input type="checkbox" name="commitId" value="@commit.id"></td>
<td style="width: 32px; text-align: center ;"><input type="checkbox" name="commitId" value="@commit.id" aria-label="Revision"></td>
<td style="width: 200px;">@helpers.avatarLink(commit, 20)&nbsp;@helpers.user(commit.authorName, commit.authorEmailAddress)</td>
<td>
<span class="muted">@gitbucket.core.helper.html.datetimeago(commit.authorTime):</span>&nbsp;@commit.shortMessage

View File

@@ -12,10 +12,10 @@
<div>
<form method="GET" action="@helpers.url(repository)/search" id="search-filter-form" class="form-inline pull-right">
<div class="input-group">
<input type="text" class="form-control" name="q" placeholder="Search..."/>
<input type="text" class="form-control" name="q" placeholder="Search..." aria-label="Search all pages"/>
<input type="hidden" name="type" value="wiki"/>
<span class="input-group-btn">
<button type="submit" id="search-btn" class="btn btn-default"><i class="fa fa-search"></i></button>
<button type="submit" id="search-btn" class="btn btn-default" aria-label="Search all pages"><i class="fa fa-search"></i></button>
</span>
</div>
<a class="btn btn-default" href="@helpers.url(repository)/wiki/@helpers.urlEncode(pageName)/_history">Page History</a>
@@ -72,7 +72,7 @@
<strong>Clone this wiki locally</strong>
</div>
@gitbucket.core.helper.html.copy("repository-url", "repository-url-copy", WikiService.wikiHttpUrl(repository)){
<input type="text" value="@WikiService.wikiHttpUrl(repository)" id="repository-url" class="form-control input-sm" readonly>
<input type="text" value="@WikiService.wikiHttpUrl(repository)" id="repository-url" class="form-control input-sm" readonly aria-label="repository-url">
}
@if(WikiService.wikiSshUrl(repository).isDefined) {
<div class="small">

View File

@@ -705,7 +705,7 @@ var imageDiff ={
function addExtraMailAddress() {
var fieldset = $('#extraMailAddresses');
var count = $('.extraMailAddress').length;
var html = '<input type="text" name="extraMailAddresses[' + count + ']" id="extraMailAddresses[' + count + ']" class="form-control extraMailAddress"/>'
var html = '<input type="text" name="extraMailAddresses[' + count + ']" id="extraMailAddresses[' + count + ']" class="form-control extraMailAddress" aria-label="Additional mail address"/>'
+ '<span id="error-extraMailAddresses_' + count + '" class="error"></span>';
fieldset.append(html);
}

View File

@@ -35,7 +35,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 32).toString ==
"<img src=\"https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=32&d=retro&r=g\" class=\"avatar\" style=\"width: 32px; height: 32px;\" />"
"""<img src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=32&d=retro&r=g" class="avatar" style="width: 32px; height: 32px;" alt="@user" />"""
)
}
@@ -47,7 +47,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 32).toString ==
s"""<img src="/user/_avatar?${date}" class="avatar" style="width: 32px; height: 32px;" />"""
s"""<img src="/user/_avatar?${date}" class="avatar" style="width: 32px; height: 32px;" alt="@user" />"""
)
}
@@ -59,7 +59,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 32).toString ==
s"""<img src="/user/_avatar?${date}" class="avatar" style="width: 32px; height: 32px;" />"""
s"""<img src="/user/_avatar?${date}" class="avatar" style="width: 32px; height: 32px;" alt="@user" />"""
)
}
@@ -69,7 +69,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 20, "hoge@hoge.com").toString ==
"<img src=\"https://www.gravatar.com/avatar/4712f9b0e63f56ad952ad387eaa23b9c?s=20&d=retro&r=g\" class=\"avatar-mini\" style=\"width: 20px; height: 20px;\" />"
"""<img src="https://www.gravatar.com/avatar/4712f9b0e63f56ad952ad387eaa23b9c?s=20&d=retro&r=g" class="avatar-mini" style="width: 20px; height: 20px;" alt="@user" />"""
)
}
@@ -79,7 +79,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 20).toString ==
"<img src=\"/_unknown/_avatar\" class=\"avatar-mini\" style=\"width: 20px; height: 20px;\" />"
"""<img src="/_unknown/_avatar" class="avatar-mini" style="width: 20px; height: 20px;" alt="@user" />"""
)
}
@@ -89,7 +89,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 20, "hoge@hoge.com").toString ==
"<img src=\"/_unknown/_avatar\" class=\"avatar-mini\" style=\"width: 20px; height: 20px;\" />"
"""<img src="/_unknown/_avatar" class="avatar-mini" style="width: 20px; height: 20px;" alt="@user" />"""
)
}
@@ -99,7 +99,7 @@ class AvatarImageProviderSpec extends AnyFunSpec {
assert(
provider.toHtml("user", 20, "hoge@hoge.com", true).toString ==
"<img src=\"/_unknown/_avatar\" class=\"avatar-mini\" style=\"width: 20px; height: 20px;\" data-toggle=\"tooltip\" title=\"user\"/>"
"""<img src="/_unknown/_avatar" class="avatar-mini" style="width: 20px; height: 20px;" data-toggle="tooltip" title="user" alt="@user" />"""
)
}
}