<%= content_for :ready_function do %>
  $("#advanced_tabs_trigger").click(function() {
    $("#advanced_tabs").show();
    $("#advanced_list_item").hide();
  });
<% end %>

<div class="box-header header-tabs" id="package_tabs">
  <ul>
    <% if @package.name == "patchinfo" %>
      <%= tab 'details', 'Details', :controller => '/webui/patchinfo', :action => 'show' %>
    <% end %>
    <%= tab 'overview', 'Overview', :controller => '/webui/package', :action => 'show' %>
    <% unless @spider_bot -%>
      <%= tab 'repositories', 'Repositories', :controller => '/webui/repositories', :action => 'index' %>
      <%= tab 'revisions', 'Revisions', :controller => '/webui/package', :action => 'revisions' %>
      <%= tab 'requests', "Requests", :controller => '/webui/package', :action => 'requests' %>
      <%= tab 'users', 'Users', :controller => '/webui/package', :action => 'users' %>
    <% end -%>
    <% if is_advanced_tab? %>
      <%= content_for :ready_function do %>
        $("#advanced_tabs").show();
      <% end %>
    <% else %>
      <li id="advanced_list_item"><a href="#" id="advanced_tabs_trigger">Advanced</a></li>
    <% end %>
  </ul>
  <% unless @spider_bot -%>
    <div id="advanced_tabs" class="hidden">
      <ul>
        <%= tab 'attributes', 'Attributes', controller: '/webui/attribute', :package => @package, :project => @project, :action => 'index' %>
        <%= tab 'meta', 'Meta', :controller => '/webui/package', :action => 'meta' %>
      </ul>
    </div>
  <% end -%>
</div>
