<% # Copyright (C) 2014 Andrew Murrell # Copyright (C) 2014 Davis Webb # Copyright (C) 2014 Guntas Grewal # Copyright (C) 2014 Luke Shumaker # Copyright (C) 2014 Nathaniel Foy # Copyright (C) 2014 Tomer Kimia # # This file is part of Leaguer. # # Leaguer is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Leaguer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the Affero GNU General Public License # along with Leaguer. If not, see . %>

Status: <%= @match.status %>

Tournament stage: <%= @tournament.stages.order(:id).index(@match.tournament_stage)+1 %>

<%# 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 %> <%= link_to "Back to Tournament", @match.tournament_stage.tournament %>