<nav class="navbar navbar-expand-lg">

  <a class="navbar-brand" href="/">
    <%= image_tag "logo_medium.png", size: "48" %>
    <%= image_tag "joss.svg" %>
  </a>

  <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup"
    aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
  </button>


  <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
    <div class="navbar-nav ml-auto">

      <%- if current_user&.aeic? %>
      <%= active_link_to "AEiC", aeic_dashboard_path, class: "nav-item nav-link" %>
      <%- end %>

      <%- if current_user&.editor && !current_user.editor.pending? %>
      <%= active_link_to "Dashboard", "/dashboard/#{current_user.editor.login}", class: "nav-item nav-link" %>
      <%- end %>

      <%= active_link_to "About", about_path, class: "nav-item nav-link" %>
      <%= active_link_to "Papers", published_papers_path, class: "nav-item nav-link" %>
      <%= active_link_to "Docs", "https://joss.readthedocs.io/en/latest/index.html", target: '_blank', class: "nav-item nav-link" %>
      <%= link_to "Blog", "http://blog.joss.theoj.org/", class: "nav-item nav-link" %>
      <%= active_link_to "Submit", new_paper_path, class: "nav-item nav-link" %>
      <% if current_user %>
      <%= active_link_to "My Profile", profile_path, class: "nav-item nav-link" %>
      <%= link_to "Log out", signout_path, class: "nav-item nav-link" %>
      <% else %>
      <%= button_to "Log in with ORCID", "/auth/orcid", method: :post, class: "nav-item nav-link btn orcid", data: { turbo: false } %>
      <% end %>
      <%= link_to image_tag("github.svg"), "https://github.com/openjournals/joss", target: '_blank', class: "nav-item nav-link" %>
    </div>

    <div class="rss-dropdown dropdown">
      <%= link_to image_tag("rss-sm.svg"), "#", class: "dropdown-toggle", size: "48", id: "dropdownMenuLink",
                                                "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false" %>
      <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
        <%= link_to "This Search", url_for(q: params[:q].presence, format: :atom), class: "dropdown-item" if @filtering %>
        <%= link_to "Active Papers", active_papers_path(format: :atom), class: "dropdown-item" %>
        <%= link_to "Published Papers", published_papers_path(format: :atom), class: "dropdown-item" %>
      </div>
    </div>

  </div>
</nav>
