summaryrefslogtreecommitdiff
path: root/app/views/matches/show.html.erb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-03-25 17:38:38 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-03-25 17:38:38 -0400
commit53b4f8028fc987b0cf26a7a073fec7064b4b6d8a (patch)
treed277b31519df83e8a1c060b04c6ea6cf50b5c361 /app/views/matches/show.html.erb
parent0c22c4bd9a0b4a0b0ff5840c1af41c0b320e3529 (diff)
revert Guntas
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r--app/views/matches/show.html.erb34
1 files changed, 20 insertions, 14 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index f3fc822..b6930ea 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,13 +1,6 @@
-<p id="notice"><%= notice %></p>
-
-<p>
- <strong>Status:</strong>
- <%= @match.status %>
-</p>
-
<p>
<strong>Tournament:</strong>
- <%= @match.tournament %>
+ <%= @match.tournament.id %>
</p>
<p>
@@ -15,10 +8,23 @@
<%= @match.name %>
</p>
-<p>
- <strong>Winner:</strong>
- <%= @match.winner %>
-</p>
+<% 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 %>
+<%= link_to 'Back', tournament_matches_path %>