Status: <%= @match.status %>

Tournament stage: <%= @match.tournament_stage %>

Teams/users

<% unless @match.winner.nil? %>

Winner: <%= @match.winner.users.collect{|u| u.user_name}.join(", ") %>

<% end %>
<%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %> <% case @match.status %> <% when 0 %> <% if @tournament.hosts.include? current_user %> <%= submit_tag("Start Match", :disabled => @match.teams.count < @tournament.min_teams_per_match) %> <% else %>

Match is waiting to start.

<% end %> <% when 1 %> <%= raw @match.tournament_stage.tournament.sampling_method.camelcase.constantize.render_user_interaction(@match, current_user) %> <% when 2 %> <% users = []; @match.teams.each{|t| users.concat(t.users)}; %> <% if users.include? current_user %> <% @match.teams.each do |team| %> <% if team.users.include?(current_user) %>
    <% team.users.reject{ |u| (u.user_name == @current_user.user_name) }.collect {|u| u.user_name }.each do |k| %>
  1. <%= k%>
    <% if (@tournament.game_id == 1) %> <%= if @blue2["#{k}"] == nil "Level: #{@purp2["#{k}"]["level"]} K/D/A: #{@purp2["#{k}"]["championsKilled"]}/#{@purp2["#{k}"]["numDeaths"]}/#{@purp2["#{k}"]["assists"]} Gold:#{@purp2["#{k}"]["goldEarned"]}" else "Level: #{@blue2["#{k}"]["level"]} K/D/A: #{@blue2["#{k}"]["championsKilled"]}/#{@blue2["#{k}"]["numDeaths"]}/#{@blue2["#{k}"]["assists"]} Gold:#{@blue2["#{k}"]["goldEarned"]}" end %> <% end %>
  2. <% end %>
<% end %> <% end %> <%= submit_tag("Submit peer evaluation", :onsubmit => "score_peers()") %> <% else %> Waiting for peer evaluations to be submitted. <% end %> <% when 3 %> This match is done. <%= submit_tag("Reset Status") %> <% end # case %> <% end # form %>