Skip to content

Commit

Permalink
Improve accessibility of navigation bar and footer (go-gitea#22635)
Browse files Browse the repository at this point in the history
Added ARIA navigation landmark to navigation bar and aria label for both
nav bar and footer.

Contributed by @forgejo.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
fsologureng and lunny committed Jan 29, 2023
1 parent c001597 commit 2b1e47e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ never = Never

rss_feed = RSS Feed

[aria]
navbar = Navigation Bar
footer = Footer
footer.software = About Software
footer.links = Links

[filter]
string.asc = A - Z
string.desc = Z - A
Expand Down
6 changes: 3 additions & 3 deletions templates/base/footer_content.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<footer>
<footer role="group" aria-label="{{.locale.Tr "aria.footer"}}">
<div class="ui container">
<div class="ui left">
<div class="ui left" role="contentinfo" aria-label="{{.locale.Tr "aria.footer.software"}}">
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.locale.Tr "powered_by" "Gitea"}}</a>
{{if (or .ShowFooterVersion .PageIsAdmin)}}
{{.locale.Tr "version"}}:
Expand All @@ -15,7 +15,7 @@
{{.locale.Tr "template"}}{{if .TemplateName}} {{.TemplateName}}{{end}}: <strong>{{call .TemplateLoadTimes}}</strong>
{{end}}
</div>
<div class="ui right links">
<div class="ui right links" role="group" aria-label="{{.locale.Tr "aria.footer.links"}}">
{{if .ShowFooterBranding}}
<a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea">{{svg "octicon-mark-github"}}<span class="sr-only">GitHub</span></a>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/base/head_navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="ui container" id="navbar">
<div class="ui container" id="navbar" role="navigation" aria-label="{{.locale.Tr "aria.navbar"}}">
{{$notificationUnreadCount := 0}}
{{if .IsSigned}}
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
Expand Down

0 comments on commit 2b1e47e

Please sign in to comment.