<nav id="greeting" aria-label="<%= t(".nav.label") %>">
  <% if logged_in? %>
    <ul class="user navigation actions">
      <li class="dropdown">
        <%= link_to t(".nav.greeting", current_user: current_user.login), user_path(current_user) %>
        <ul class="menu">
          <li><%= link_to t(".nav.dashboard"), user_path(current_user) %></li>
          <% if @current_user_subscriptions_count > 0 %>
            <li><%= link_to t(".nav.subscriptions"), user_subscriptions_path(current_user) %></li>
          <% end %>
          <% if @current_user_visible_work_count > 0 %>
            <li><%= link_to t(".nav.works"), user_works_path(@current_user) %></li>
          <% end %>
          <% if @current_user_bookmarks_count > 0 %>
            <li><%= link_to t(".nav.bookmarks"), user_bookmarks_path(current_user) %></li>
          <% end %>
          <% if @current_user_owned_collections_count > 0 %>
            <li><%= link_to t(".nav.collections"), user_collections_path(current_user) %></li>
          <% end %>
          <% if @current_user_challenge_signups_count > 0 %>
            <li><%= link_to t(".nav.sign_ups"), user_signups_path(current_user) %></li>
          <% end %>
          <% if @current_user_offer_assignments > 0 %>
            <li><%= link_to t(".nav.assignments"), user_assignments_path(current_user) %></li>
          <% end %>
          <% if @current_user.preference.try(:history_enabled?) %>
            <li><%= link_to t(".nav.history"), user_readings_path(current_user) %></li>
          <% end %>
          <li><%= link_to t(".nav.preferences"), user_preferences_path(current_user) %></li>
          <% if permit?("opendoors") %>
            <li><%= link_to t(".nav.open_doors"), opendoors_tools_path %></li>
          <% end %>
          <% if current_user.is_tag_wrangler? %>
            <li><%= link_to t(".nav.tag_wrangling"), tag_wrangler_path(current_user) %></li>
          <% end %>
        </ul>
      </li>
      <li class="dropdown">
        <%= link_to t(".nav.post"), new_work_path %>
        <ul class="menu">
          <li><%= link_to t(".nav.new_work"), new_work_path %></li>
          <li><%= link_to t(".nav.import"), new_work_path(import: "true") %></li>
          <li><%= link_to t("New Status"), new_user_status_path(@current_user) %></li>
          <% if @current_user_unposted_works_size > 0 %>
            <li><%= link_to t(".nav.post_draft"), drafts_user_works_path(@current_user) %></li>
          <% end %>
        </ul>
      </li>
      <li><%= link_to t(".nav.log_out"), destroy_user_session_path, method: :delete %></li>
    </ul>

    <% elsif logged_in_as_admin? %>
      <ul class="user navigation actions">
        <li><%= link_to t(".nav.greeting", current_user: current_admin.login), admins_path %></li>
        <li><%= link_to t(".nav.log_out"), destroy_admin_session_path, method: :delete %></li>
      </ul>
    <% end %>
  <p class="icon"><%= icon_display(current_user) %></p>
</nav>

