summaryrefslogtreecommitdiff
path: root/app/views/matches/show.html.erb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-03-07 00:41:47 -0500
committerAndrewMurrell <amurrel@purdue.edu>2014-03-07 00:41:47 -0500
commitfd213819fa004209fc466b19ee65d83b1f918068 (patch)
treeecfe47daa486da7d878207ac6a799b6fab79deab /app/views/matches/show.html.erb
parent5ca9bd493d0348d56a3a8ce56923a72230515fe0 (diff)
parent8fc6b48caccdb8fbfe04e41282444e0b916883b3 (diff)
Merge branch 'master' of http://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r--app/views/matches/show.html.erb24
1 files changed, 23 insertions, 1 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index e95cd07..f5a3686 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -1,6 +1,6 @@
<p>
<strong>Tournament:</strong>
- <%= @match.tournament %>
+ <%= @match.tournament.id %>
</p>
<p>
@@ -8,5 +8,27 @@
<%= @match.name %>
</p>
+<% if @tournament.hosts.include?(current_user) %>
+ <%= form_for(@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 %>
+
<%= link_to 'Edit', edit_tournament_match_path(@tournament, @match) %> |
<%= link_to 'Back', tournament_matches_path %>
+
+<% 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 %>
+