Skip to content

Commit 7fd5d38

Browse files
authored
Improve checkbox accessibility a bit by adding the title attribute (#22593)
EDIT: The main change of this PR was resolved by #22599. This complements that PR for some cases without label and complicated layout to be added. NOTE: Contributed by @forgejo.
1 parent faa9655 commit 7fd5d38

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

options/locale/locale_en-US.ini

+3
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ editor.commit_directly_to_this_branch = Commit directly to the <strong class="br
11311131
editor.create_new_branch = Create a <strong>new branch</strong> for this commit and start a pull request.
11321132
editor.create_new_branch_np = Create a <strong>new branch</strong> for this commit.
11331133
editor.propose_file_change = Propose file change
1134+
editor.new_branch_name = Name the new branch for this commit
11341135
editor.new_branch_name_desc = New branch name…
11351136
editor.cancel = Cancel
11361137
editor.filename_cannot_be_empty = The filename cannot be empty.
@@ -1336,6 +1337,8 @@ issues.action_milestone = Milestone
13361337
issues.action_milestone_no_select = No milestone
13371338
issues.action_assignee = Assignee
13381339
issues.action_assignee_no_select = No assignee
1340+
issues.action_check = Check/Uncheck
1341+
issues.action_check_all = Check/Uncheck all items
13391342
issues.opened_by = opened %[1]s by <a href="%[2]s">%[3]s</a>
13401343
pulls.merged_by = by <a href="%[2]s">%[3]s</a> was merged %[1]s
13411344
pulls.merged_by_fake = by %[2]s was merged %[1]s

templates/admin/config.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,14 @@
303303
<dt>{{.locale.Tr "admin.config.disable_gravatar"}}</dt>
304304
<dd>
305305
<div class="ui toggle checkbox">
306-
<input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}}>
306+
<input type="checkbox" name="picture.disable_gravatar" version="{{.SystemSettings.GetVersion "picture.disable_gravatar"}}"{{if .SystemSettings.GetBool "picture.disable_gravatar"}} checked{{end}} title="{{.locale.Tr "admin.config.disable_gravatar"}}">
307307
</div>
308308
</dd>
309309
<div class="ui divider"></div>
310310
<dt>{{.locale.Tr "admin.config.enable_federated_avatar"}}</dt>
311311
<dd>
312312
<div class="ui toggle checkbox">
313-
<input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}}>
313+
<input type="checkbox" name="picture.enable_federated_avatar" version="{{.SystemSettings.GetVersion "picture.enable_federated_avatar"}}"{{if .SystemSettings.GetBool "picture.enable_federated_avatar"}} checked{{end}} title="{{.locale.Tr "admin.config.enable_federated_avatar"}}">
314314
</div>
315315
</dd>
316316
</dl>

templates/org/team/new.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<tr>
7979
<th>{{.locale.Tr "units.unit"}}</th>
8080
<th class="center aligned">{{.locale.Tr "org.teams.none_access"}}
81-
<span class="tooltip vm" data-content="{{.locale.Tr "org.teams.none_access_helper"}}">{{svg "octicon-question" 16 "ml-2"}}</th>
81+
<span class="tooltip vm" data-content="{{.locale.Tr "org.teams.none_access_helper"}}">{{svg "octicon-question" 16 "ml-2"}}</span></th>
8282
<th class="center aligned">{{.locale.Tr "org.teams.read_access"}}
8383
<span class="tooltip vm" data-content="{{.locale.Tr "org.teams.read_access_helper"}}">{{svg "octicon-question" 16 "ml-2"}}</span></th>
8484
<th class="center aligned">{{.locale.Tr "org.teams.write_access"}}
@@ -99,17 +99,17 @@
9999
</td>
100100
<td class="center aligned">
101101
<div class="ui radio checkbox">
102-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}}>
102+
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}} title="{{$.locale.Tr "org.teams.none_access"}}">
103103
</div>
104104
</td>
105105
<td class="center aligned">
106106
<div class="ui radio checkbox">
107-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
107+
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.read_access"}}">
108108
</div>
109109
</td>
110110
<td class="center aligned">
111111
<div class="ui radio checkbox">
112-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
112+
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}} title="{{$.locale.Tr "org.teams.write_access"}}">
113113
</div>
114114
</td>
115115
</tr>

templates/repo/editor/commit_form.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<div class="quick-pull-branch-name {{if not (eq .commit_choice "commit-to-new-branch")}}hide{{end}}">
6262
<div class="new-branch-name-input field {{if .Err_NewBranchName}}error{{end}}">
6363
{{svg "octicon-git-branch"}}
64-
<input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="{{.locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}}>
64+
<input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="{{.locale.Tr "repo.editor.new_branch_name_desc"}}" {{if eq .commit_choice "commit-to-new-branch"}}required{{end}} title="{{.locale.Tr "repo.editor.new_branch_name"}}">
6565
<span class="text-muted js-quick-pull-normalization-info"></span>
6666
</div>
6767
</div>

templates/repo/issue/list.tmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
<div class="six wide column">
3131
{{if $.CanWriteIssuesOrPulls}}
3232
<div class="ui checkbox issue-checkbox-all vm">
33-
<input type="checkbox"></input>
34-
<label></label>
33+
<input type="checkbox" title="{{.locale.Tr "repo.issues.action_check_all"}}">
3534
</div>
3635
{{end}}
3736
{{template "repo/issue/openclose" .}}

templates/shared/issuelist.tmpl

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<div class="issue-item-left df">
66
{{if $.CanWriteIssuesOrPulls}}
77
<div class="ui checkbox issue-checkbox">
8-
<input type="checkbox" data-issue-id={{.ID}}></input>
9-
<label></label>
8+
<input type="checkbox" data-issue-id={{.ID}} title="{{$.locale.Tr "repo.issues.action_check"}} «{{.Title}}»">
109
</div>
1110
{{end}}
1211
<div class="issue-item-icon">

0 commit comments

Comments
 (0)