Challenge:
<%= namelink @challenge.contester1.team %> vs <%= namelink @challenge.contester2.team %>

<% if @challenge.mandatory %> <%= cascade @challenge, ["match_time", "default_time", "mandatory", :server] %> <% else %> <%= cascade @challenge, ["match_time", "mandatory", :server] %> <% end %>

Contest: <%= namelink @challenge.contester1.contest %>

Maps: <%= namelink @challenge.map1 %> <% if @challenge.map2 %> , <%= namelink @challenge.map2 %> <% end %>

Status: <% if @challenge.match %> <%= link_to @challenge.statuses[@challenge.status], @challenge.match %> <% else %> <%= @challenge.statuses[@challenge.status] %> <% end %>

<% if @challenge.contester1.team.is_leader? cuser and @challenge.response %>

Details:
<%= @challenge.response.bbcode_to_html %>

<% elsif @challenge.contester2.team.is_leader? cuser and @challenge.details %>

Details:
<%= @challenge.details.bbcode_to_html %>

<% end %> <% if @challenge.status == Challenge::STATUS_PENDING and @challenge.mandatory %>

<% if @challenge.autodefault.future? %> Match will be forfeited for <%= namelink @challenge.contester1.team %> on <%= longtime @challenge.autodefault %> <% elsif @challenge.status == Challenge::STATUS_ACCEPTED %> Match was accepted and match arranged. <% elsif @challenge.status == Challenge::STATUS_FORFEIT %> Match was forfeited for <%= namelink @challenge.contester2.team %>. <% end %>

<% end %>
<% if @challenge.can_destroy? cuser %>

<%= link_to "Cancel challenge", @challenge, :confirm => 'Are you sure?', :method => :delete %>

<% end %> <% if @challenge.can_update? cuser %> <%= form_for @challenge do |f| %>

<%= f.label :response %>
<%= f.text_area :response, :rows => 5, :cols => 40 %>

<%= f.label :map2_id, "Your Map" %>
<%= f.select :map2_id, @challenge.contester1.contest.maps.basic.collect{|m| [m.name, m.id]} %>

<%= submit_tag "Accept" %> <% if @challenge.mandatory %> <%= submit_tag "Default time" %> <%= submit_tag "Forfeit" %> <% else%> <%= submit_tag "Decline" %> <% end %> <% end %> <% end %>
<%= link_to 'Back to the contest', @challenge.contester1.contest %>