summaryrefslogtreecommitdiff
path: root/app/views/matches/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r--app/views/matches/show.html.erb50
1 files changed, 37 insertions, 13 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index 1ee7f1d..4973dc3 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,5 +1,3 @@
-<p id="notice"><%= notice %></p>
-
<p>
<strong>Status:</strong>
<%= @match.status %>
@@ -7,23 +5,49 @@
<p>
<strong>Tournament:</strong>
- <%= @match.tournament %>
+ <%= @match.tournament.id %>
</p>
<p>
<strong>Name:</strong>
<%= @match.name %>
</p>
+<!--
+ Match Status 0 => Pairings Stage
+ Match Status 1 => Match Active
+ Match Status 2 => Match Finished (Peer Review Starts)
+ Match Status 3 => Match Completed (Scores Completed OR Results Page)
-<p>
- <strong>Winner:</strong>
- <%= @match.winner %>
-</p>
+ Four views:- (status is Match status)
+ A. Pairings, when status is 0 for either Host or Player Or when status is 1 for player
+ B. A page the host will see if status is 1 OR 2
+ C. The Peer review page that the players will see if status is 2.
+ D. The page everyone will see when status is 3.
-<p>
- <strong>Remote:</strong>
- <%= @match.remote_id %>
-</p>
+ Note:- The change of status from 1 to 2 is coming from League Data Pull (RIOT API)
+
+-->
+<!--
+ This is what the HOST will see when the Match Status is NOT 3
+-->
+<% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %>
+ <%= form_for([@tournament, @match], method: "put") do |f| %>
+ <ul>
+ <% @match.teams.each do |team| %>
+ <li><label><%= f.radio_button(:winner, team.id) %>
+ <%= team.users.collect{|u| u.user_name}.join(", ") %></label></li>
+ <% end %>
+ </ul>
+ <%= f.submit("Select winner") %>
+ <% end %>
+<% end %>
+
+
+
+<% unless @match.winner.nil? %>
+ <p>
+ <strong>Winner:</strong>
+ <%= @match.winner.users.collect{|u| u.user_name}.join(", ") %>
+ </p>
+<% end %>
-<%= link_to 'Edit', edit_match_path(@match) %> |
-<%= link_to 'Back', matches_path %>