<% content_for(:secondary_links) do %>
  <menu>
    <li><%= render "forum_posts/quick_search" %></li>
    <li><%= link_to "Listing", forum_topics_path %></li>
    
    <% if CurrentUser.is_member? %>
      <li><%= link_to "New", new_forum_topic_path %></li>
      <li><%= link_to "Mark all as read", mark_all_as_read_forum_topics_path, :method => :post %></li>
    <% end %>
    
    <li><%= link_to "Search", search_forum_posts_path %></li>
    <li><%= link_to "Help", wiki_pages_path(:title => "help:forum") %></li>
    <% if CurrentUser.is_member? && @forum_topic && !@forum_topic.new_record? %>
      <li>|</li>
      <li><%= link_to "Reply", new_forum_post_path(:topic_id => @forum_topic.id) %></li>
      <% if !@forum_topic.new_record? && @forum_topic.editable_by?(CurrentUser.user) %>
        <li><%= link_to "Edit", edit_forum_topic_path(@forum_topic) %></li>
        <% if CurrentUser.is_janitor? %>
          <li><%= link_to "Delete", forum_topic_path(@forum_topic), :remote => true, :method => :delete, :confirm => "Are you sure you want to delete this forum topic?" %></li>
          <% if @forum_topic.is_locked? %>
            <li><%= link_to "Unlock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => false}), :method => :put %></li>
          <% else %>
            <li><%= link_to "Lock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => true}), :method => :put, :confirm => "Are you sure you want to lock this forum topic?" %></li>
          <% end %>
          <% if @forum_topic.is_sticky? %>
            <li><%= link_to "Unsticky", forum_topic_path(@forum_topic, :forum_topic => {:is_sticky => false}), :method => :put %></li>
          <% else %>
            <li><%= link_to "Sticky", forum_topic_path(@forum_topic, :forum_topic => {:is_sticky => true}), :method => :put, :confirm => "Are you sure you want to sticky this forum topic?" %></li>
          <% end %>
        <% end %>
      <% end %>
    <% end %>
  </menu>
<% end %>
