Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use <nav> instead of <div> in the global navbar #23125

Merged
merged 8 commits into from
Mar 17, 2023
20 changes: 10 additions & 10 deletions 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" role="navigation" aria-label="{{.locale.Tr "aria.navbar"}}">
<nav class="ui container" id="navbar" aria-label="{{.locale.Tr "aria.navbar"}}">
{{$notificationUnreadCount := 0}}
{{if .IsSigned}}
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
Expand Down Expand Up @@ -121,13 +121,13 @@
<a href="{{AppSubUrl}}/notifications" class="item tooltip not-mobile gt-mx-0" data-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
<span class="fitted item">
{{svg "octicon-bell"}}
<span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">
<span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}"><!-- Nested because the rendering breaks otherwise-->
delvh marked this conversation as resolved.
Show resolved Hide resolved
{{$notificationUnreadCount}}
</span>
</span>
</a>

<div class="ui dropdown jump item tooltip gt-mx-0" data-content="{{.locale.Tr "create_new"}}">
<button class="ui dropdown jump item tooltip gt-mx-0" role="menu" data-content="{{.locale.Tr "create_new"}}">
delvh marked this conversation as resolved.
Show resolved Hide resolved
<span class="text">
<span class="fitted">{{svg "octicon-plus"}}</span>
<span class="sr-mobile-only">{{.locale.Tr "create_new"}}</span>
Expand All @@ -148,9 +148,9 @@
</a>
{{end}}
</div><!-- end content create new menu -->
</div><!-- end dropdown menu create new -->
</button><!-- end dropdown menu create new -->

<div class="ui dropdown jump item tooltip gt-mx-0" tabindex="-1" data-content="{{.locale.Tr "user_profile_and_more"}}">
<button class="ui dropdown jump item tooltip gt-mx-0" role="menu" data-content="{{.locale.Tr "user_profile_and_more"}}">
<span class="text">
{{avatar $.Context .SignedUser 24 "tiny"}}
<span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span>
Expand Down Expand Up @@ -190,17 +190,17 @@

<a class="{{if .PageIsAdmin}}active {{end}}item" href="{{AppSubUrl}}/admin">
{{svg "octicon-server"}}
{{.locale.Tr "admin_panel"}}<!-- Admin Panel -->
{{.locale.Tr "admin_panel"}}
</a>
{{end}}

<div class="divider"></div>
<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
{{svg "octicon-sign-out"}}
{{.locale.Tr "sign_out"}}<!-- Sign Out -->
{{.locale.Tr "sign_out"}}
</a>
</div><!-- end content avatar menu -->
</div><!-- end dropdown avatar menu -->
</button><!-- end dropdown avatar menu -->
</div><!-- end signed user right menu -->
{{else}}
<a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.locale.Tr "help"}}</a>
Expand All @@ -213,6 +213,6 @@
<a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
{{svg "octicon-sign-in"}} {{.locale.Tr "sign_in"}}
</a>
</div><!-- end anonymous right menu -->
</div><!-- end anonymous user right menu -->
{{end}}
</div>
</nav>