<% challenge = @collection.challenge %> <% zone = (challenge.time_zone || Time.zone.name) %> <% if challenge.signup_open %>
<%= ts("Sign-up:")%>
<%= link_to ts("Open"), new_collection_signup_path(@collection) %>
<%= ts("Sign-up Closes:")%>
<%= time_in_zone(challenge.signups_close_at, zone) %>
<% elsif Time.now < (challenge.signups_open_at || 1.day.ago) %>
<%= ts("Sign-up Opens:")%>
<%= time_in_zone(challenge.signups_open_at, zone) %>
<%= ts("Sign-up Closes:")%>
<%= time_in_zone(challenge.signups_close_at, zone) %>
<% elsif Time.now < (challenge.signups_close_at || 1.day.ago) %>
<%= ts("Sign-up:")%>
<%= ts("Closed")%>
<% end %>
<%= ts("Assignments Due:")%>
<%= time_in_zone(challenge.assignments_due_at, zone) %>
<% if @collection.unrevealed? %>
<%= ts("Works Revealed:")%>
<%= time_in_zone(challenge.works_reveal_at, zone) %>
<% end %> <% if @collection.anonymous? %>
<%= ts("Creators Revealed:")%>
<%= time_in_zone(challenge.authors_reveal_at, zone) %>
<% end %>
<%= ts("Signed up:") %>
<%= signup_count = @collection.signups.count %> <% if signup_count < 6 %> <%= ts("Too few sign-ups to display names") %> <% else %> <% num_to_show = 20 # arbitrary number for how many names to list %> <% if signup_count > num_to_show %> <%= content_for :footer_js do %> <%= javascript_tag do %> $j(document).ready(function(){ $j('#show_signups').click(function() { $j('#more_signups').show(); $j('#hide_signups').show(); $j(this).hide(); }); $j('#hide_signups').click(function() { $j('#more_signups').hide(); $j('#show_signups').show(); $j(this).hide(); }); }) <% end %> <% end %> <% end %> <% end %>