-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor navbar to be menubar (#3300)
Refactor navigation bar to follow the menubar pattern for accessibility reasons. This changes the semantic structure of the navigation bar to be ul, li and a tags. --------- Co-authored-by: Aday Bujeda <[email protected]>
- Loading branch information
Showing
17 changed files
with
211 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<li class="nav-item" title="<%= t('dashboard.nav_all_apps') %>"> | ||
<%= tag.a class: 'nav-link', href: apps_index_path, aria: ({ current: ('page' if (current_page?(controller: '/apps', action: 'index' ))) }) do %> | ||
<i class="fas fa-th" aria-hidden="true"></i><span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_all_apps') %></span> | ||
<% end %> | ||
<%- | ||
aria = if current_page?(controller: '/apps', action: 'index') | ||
"aria-current=page" | ||
else | ||
"" | ||
end | ||
-%> | ||
|
||
<li class="nav-item" role="none"> | ||
<a title="<%= t('dashboard.nav_all_apps') %>" class="nav-link" | ||
role="menuitem" href="<%= apps_index_path %>" | ||
<%= aria %> | ||
> | ||
<i class="fas fa-th" aria-hidden="true"></i> | ||
<span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_all_apps') %></span> | ||
</a> | ||
</li> |
4 changes: 2 additions & 2 deletions
4
apps/dashboard/app/views/layouts/nav/_develop_dropdown.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<li class="nav-item dropdown" title="<%= group.title %>"> | ||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
<li class="nav-item dropdown" role="none"> | ||
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" role="menuitem" title="<%= group.title %>"> | ||
<%= icon_tag(group.icon_uri, classes: 'menu-icon') if group.icon_uri %><span> <%= group.title %></span><span class="caret"></span> | ||
</a> | ||
|
||
<ul class="dropdown-menu <%= local_assigns.fetch(:menu_alignment, '') %>"> | ||
<ul class="dropdown-menu <%= local_assigns.fetch(:menu_alignment, '') %>" title="<%= group.title %>" role="menu"> | ||
<%= render partial: 'layouts/nav/group_items', locals: local_assigns %> | ||
</ul> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<li class="nav-item"> | ||
<a class="nav-link" href="/logout"><i class="fas fa-sign-out-alt" aria-hidden="true"></i><span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_logout') %></span></a> | ||
<li class="nav-item" role="none"> | ||
<a class="nav-link" href="/logout" title="<%= t('dashboard.nav_logout') %>" role="menuitem"> | ||
<i class="fas fa-sign-out-alt" aria-hidden="true"></i> | ||
<span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_logout') %></span> | ||
</a> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
<%- | ||
aria = current_page?(root_path) ? "aria-current=page" : '' | ||
-%> | ||
|
||
<li role="none" > | ||
<% if @user_configuration.dashboard_header_img_logo %> | ||
<a class="navbar-brand navbar-brand-logo" href="<%= root_path %>" <%= aria %> role='menuitem'> | ||
<img class="img-fluid" src="<%= @user_configuration.dashboard_header_img_logo %>" alt="<%= @user_configuration.dashboard_title %>"> | ||
</a> | ||
<% else %> | ||
<a class="navbar-brand" <%= aria %> role='menuitem' href="<%= root_path %>"><%= @user_configuration.dashboard_title %></a> | ||
<% end %> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
<li class="nav-item" title="<%= t('dashboard.breadcrumbs_my_sessions') %>"> | ||
<%= tag.a class: 'nav-link', href: batch_connect_sessions_path, aria: ({ current: ('page' if (current_page?(controller: 'batch_connect/sessions', action: 'index'))) }) do %> | ||
<i class="fas fa-window-restore" aria-hidden="true"></i><span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_sessions') %></span> | ||
<% end %> | ||
<%- | ||
aria = if current_page?(controller: 'batch_connect/sessions', action: 'index') | ||
"aria-current=page" | ||
else | ||
"" | ||
end | ||
-%> | ||
|
||
<li class="nav-item" role="none"> | ||
<a title="<%= t('dashboard.breadcrumbs_my_sessions') %>" class="nav-link" | ||
role="menuitem" href="<%= batch_connect_sessions_path %>" | ||
<%= aria %> | ||
> | ||
<i class="fas fa-window-restore" aria-hidden="true"></i> | ||
<span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_sessions') %></span> | ||
</a> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<li class="nav-item" data-container="body" data-toggle="popover" data-content="<%= t('dashboard.nav_user', username: @user.name) %>" data-placement="bottom"> | ||
<a class="nav-link disabled"> | ||
<i class="fas fa-user" aria-hidden="true" title="<%= t('dashboard.nav_user', username: @user.name) %>" aria-hidden="true"></i><span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_user', username: @user.name) %></span> | ||
<li class="nav-item" data-container="body" data-toggle="popover" | ||
data-content="<%= t('dashboard.nav_user', username: @user.name) %>" data-placement="bottom" | ||
role="none"> | ||
<a class="nav-link disabled" role="menuitem" title="<%= t('dashboard.nav_user', username: @user.name) %>" href="#"> | ||
<i class="fas fa-user" aria-hidden="true" aria-hidden="true"></i><span class="d-sm-none d-md-none d-lg-inline"> <%= t('dashboard.nav_user', username: @user.name) %></span> | ||
</a> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.