Status: <%= @match.status %>

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

<%# Match Status 0 => Created, waiting to be scheduled Match Status 1 => Scheduled, waiting to start Match Status 2 => Started, waiting to finish Match Status 3 => Finished Four views:- (status is Match status) A. Pairings, when status is 1 for either Host or Player Or when status is 2 for player B. A page the host will see if status is 2 OR 3 C. The Peer review page that the players will see if status is 3. D. The page everyone will see when status is 4. Note: The change of status from 2 to 3 for League of Legends is coming from League Data Pull (RIOT API) %>

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 %>

This match has not yet been scheduled.

<% when 1 %> <% if @tournament.hosts.include? current_user %> <%= submit_tag("Start Match") %> <% else %>

Match is waiting to start.

<% end %> <% when 2 %> <%= @match.render_sampling(current_user) %> <% when 3 %>

This match is finished.

<% if @tournament.hosts.include? current_user %> <%= submit_tag("Reset Status") %> <% end %> <% end %> <% end %>