<% if logged_in? %>
<h4 class="landmark heading"><%= ts("Gift Exchange") %></h4>
  <ul class="navigation actions">
  <!-- added automatically to the collection sidebar for challenges. 
        all items should be enclosed in <li> </li> and linked with span_if_current! 
        @collection is defined, @challenge may not be. -->
  <!-- signup form or link -->
  <% if (@challenge_signup = ChallengeSignup.in_collection(@collection).by_user(current_user).first) %>
    <li><%= span_if_current ts("My Sign-up"), collection_signup_path(@collection, @challenge_signup) %></li>
  <% elsif @collection.challenge.user_allowed_to_sign_up?(current_user) || @collection.user_is_posting_participant?(current_user) %>
    <li><%= span_if_current ts("Sign-up Form"), new_collection_signup_path(@collection) %></li>
  <% end %>

  <!-- assignment link -->
  <% unless @collection.challenge.assignments_sent_at.nil? %>
    <% @challenge_assignments = ChallengeAssignment.in_collection(@collection).by_offering_user(current_user) %>
    <% if @challenge_assignments.size == 1 %>
      <li><%= span_if_current ts("My Assignment"), collection_assignment_path(@collection, @challenge_assignments.first) %></li>
    <% elsif @challenge_assignments.size > 1 %>
      <li><%= span_if_current ts("My Assignments"), user_assignments_path(current_user, :collection_id => @collection.name) %>
    <% end %>
  <% end %>

  <% if @collection.challenge.user_allowed_to_see_signups?(current_user) %>
    <li>
      <%= span_if_current ts("Sign-ups (%{count})", :count => @collection.signups.count), collection_signups_path(@collection) %>
    </li>
  <% end %>
  <li>
    <%= span_if_current ts("Sign-up Summary"), summary_collection_signups_path(@collection) %>
  </li>
  <% if @collection.challenge.user_allowed_to_see_requests_summary?(current_user) %>
    <li>
      <%= span_if_current ts("Requests Summary"), collection_requests_path(@collection) %>
    </li>
  <% end %>

  <% if @collection.challenge.user_allowed_to_see_assignments?(current_user) %>
    <% if @collection.challenge.assignments_sent_at.nil? %>
      <li><%= span_if_current ts("Matching"), collection_potential_matches_path(@collection) %></li>
    <% else %>
      <li><%= span_if_current ts("Assignments"), collection_assignments_path(@collection) %></li>
    <% end %>
  <% end %>
</ul>
<% end %>
