<%= render 'shared/my_school_menu' if can?(:read, :my_school_menu) && current_user.school.visible? %>

<% if current_user && current_user.default_scoreboard %>
  <li class="nav-item"><%= link_to "Scoreboard", scoreboard_path(current_user.default_scoreboard), class: 'nav-link' %></li>
<% end %>

<% if current_user && current_user.school_group %>
  <li class="nav-item">
    <%= link_to "#{current_user.school_group.name} Schools", school_group_path(current_user.school_group), class: 'nav-link' %>
  </li>
  <li class="nav-item">
    <%= link_to "All Schools", schools_path, class: 'nav-link' %>
  </li>
<% else %>
  <li class="nav-item">
    <%= link_to "Schools", schools_path, class: 'nav-link' %>
  </li>
<% end %>

<li class="nav-item">
  <% if current_user && current_user.school %>
    <%= link_to "Activities", school_activity_categories_path(current_user.school), class: 'nav-link' %>
  <% else %>
    <%= link_to "Activities", activity_categories_path, class: 'nav-link' %>
  <% end %>
</li>

<%= render 'shared/about_menu' %>

<li class="nav-item">
  <%= link_to "Contact", contact_path, class: 'nav-link' %>
</li>

<%= render 'shared/manage_menu' if can?(:manage, :admin_functions) %>

<%= render 'shared/my_school_menu' if can?(:read, :my_school_menu) && current_user.school.visible? %>

<% if current_user && current_user.default_scoreboard %>
  <li class="nav-item"><%= link_to "Scoreboard", scoreboard_path(current_user.default_scoreboard), class: 'nav-link' %></li>
<% end %>

<% if current_user && current_user.school_group %>
  <li class="nav-item">
    <%= link_to "#{current_user.school_group.name} Schools", school_group_path(current_user.school_group), class: 'nav-link' %>
  </li>
  <li class="nav-item">
    <%= link_to "All Schools", schools_path, class: 'nav-link' %>
  </li>
<% else %>
  <li class="nav-item">
    <%= link_to "Schools", schools_path, class: 'nav-link' %>
  </li>
<% end %>

<li class="nav-item">
  <%= link_to "Activities", activity_categories_path_url(current_user&.school), class: 'nav-link' %>
</li>

<%= render 'shared/about_menu' %>

<li class="nav-item">
  <%= link_to "Contact", contact_path, class: 'nav-link' %>
</li>

<%= render 'shared/manage_menu' if can?(:manage, :admin_functions) %>

Use safe navigation to tidy link render
Use safe navigation to tidy link render
