<div class="navbar navbar-default navbar-fixed-top">
  <div class="container-fluid">
    <div class="navbar-header" data-navbar="static">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-menu">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <div class="navbar-toggle collapsed navbar-livereload">
        <%= ecr "_poll_link" %>
      </div>
      <a class="navbar-brand" href="<%= root_path %>">
        <%= Sidekiq::NAME %>
        <%= ecr "_status" %>
      </a>
    </div>

    <div class="collapse navbar-collapse" id="navbar-menu">
      <ul class="nav navbar-nav" data-navbar="static">
        <% Sidekiq::Web.default_tabs.each do |title, url| %>
          <% if url == "" %>
            <li class="<%= x.current_path == url ? "active" : "" %>">
            <a href="<%= x.root_path %><%= url %>"><%= x.t(title) %></a>
            </li>
          <% else %>
            <li class="<%= x.current_path.starts_with?(url) ? "active" : "" %>">
            <a href="<%= x.root_path %><%= url %>"><%= x.t(title) %></a>
            </li>
          <% end %>
        <% end %>

        <li class="dropdown" data-navbar="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
            <%= x.t("Plugins") %> <span class="caret"></span>
          </a>
          <ul class="dropdown-menu" role="menu">
            <% Sidekiq::Web.custom_tabs.each do |title, url| %>
              <li>
                <a href="<%= x.root_path %><%= url %>"><%= x.t(title) %></a>
              </li>
            <% end %>
          </ul>
        </li>

        <% Sidekiq::Web.custom_tabs.each do |title, url| %>
          <li class="<%= x.current_path.starts_with?(url) ? "active" : "" %>" data-navbar="custom-tab">
            <a href="<%= x.root_path %><%= url %>"><%= x.t(title) %></a>
          </li>
        <% end %>
      </ul>
      <ul class="nav navbar-nav navbar-right navbar-livereload" data-navbar="static">
        <li>
          <div class="poll-wrapper pull-right">
            <%= ecr "_poll_link" %>
          </div>
        </li>
      </ul>
    </div>
  </div>
</div>
