Skip to content

Commit 2b1e47e

Browse files
fsologurenglunny
andauthored
Improve accessibility of navigation bar and footer (#22635)
Added ARIA navigation landmark to navigation bar and aria label for both nav bar and footer. Contributed by @forgejo. --------- Co-authored-by: Lunny Xiao <[email protected]>
1 parent c001597 commit 2b1e47e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

options/locale/locale_en-US.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ never = Never
111111

112112
rss_feed = RSS Feed
113113

114+
[aria]
115+
navbar = Navigation Bar
116+
footer = Footer
117+
footer.software = About Software
118+
footer.links = Links
119+
114120
[filter]
115121
string.asc = A - Z
116122
string.desc = Z - A

templates/base/footer_content.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<footer>
1+
<footer role="group" aria-label="{{.locale.Tr "aria.footer"}}">
22
<div class="ui container">
3-
<div class="ui left">
3+
<div class="ui left" role="contentinfo" aria-label="{{.locale.Tr "aria.footer.software"}}">
44
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.locale.Tr "powered_by" "Gitea"}}</a>
55
{{if (or .ShowFooterVersion .PageIsAdmin)}}
66
{{.locale.Tr "version"}}:
@@ -15,7 +15,7 @@
1515
{{.locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
1616
{{end}}
1717
</div>
18-
<div class="ui right links">
18+
<div class="ui right links" role="group" aria-label="{{.locale.Tr "aria.footer.links"}}">
1919
{{if .ShowFooterBranding}}
2020
<a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">{{svg "octicon-mark-github"}}<span class="sr-only">GitHub</span></a>
2121
{{end}}

templates/base/head_navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui container" id="navbar">
1+
<div class="ui container" id="navbar" role="navigation" aria-label="{{.locale.Tr "aria.navbar"}}">
22
{{$notificationUnreadCount := 0}}
33
{{if .IsSigned}}
44
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}

0 commit comments

Comments
 (0)