diff options
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r-- | app/views/matches/show.html.erb | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 1ee7f1d..53c3b38 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,7 +5,7 @@ <p> <strong>Tournament:</strong> - <%= @match.tournament %> + <%= @match.tournament.id %> </p> <p> @@ -15,15 +13,22 @@ <%= @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 %> -<p> - <strong>Remote:</strong> - <%= @match.remote_id %> -</p> +<% 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 %> |