From e1ef99a9ade5723c7bc65977546b4e1fdaab9688 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Thu, 24 Apr 2014 21:55:49 -0400 Subject: Mixed things up a bit on the matches controller and show view. --- app/views/matches/show.html.erb | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'app/views/matches') diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index e1fe29e..2ec0ea6 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -47,7 +47,8 @@ function score_peers() { <% if @match.status <= 1 %>
  • <%= user.user_name %>
  • <% else %> -
  • <%= user.user_name %> - SCORE: <%= Statistic.where(:name => "score", :user => user, :match => @match).first.value %>
  • + <% score = Statistic.where(:name => "score", :user => user, :match => @match).first%> +
  • <%= user.user_name %> - SCORE: <%= score ? score.value : 0 %>
  • <% end %> <% end %> @@ -76,21 +77,24 @@ function score_peers() { <% when 1 %> - <% if @tournament.hosts.include? current_user %> - - <% @match.teams.each do |team| %> -
    Team <%= team.id.to_s %> - <% team.users.collect{|u| u.user_name}.each do |k| %><% end %> -
    + + <% case @tournament.sampling_method %> + <% when "Manual" %> + <% if @tournament.hosts.include? current_user %> + + <% @match.teams.each do |team| %> + <%= tag :input, {"type" => "radio", "name" => "winner", "value" => "#{team.id}" } %> + <%= "Team #{team.id} Won" %> + <% end %> + <%= submit_tag("Finish match") %> + <%= @tournament.settings['ScoringMethod'] %> + <% else %> +

    The match is running; the host has yet to post the scores of the match.

    <% end %> - <%= submit_tag("Finish match") %> - <% else %> -

    The match is running; the host has yet to post the scores of the match.

    + <% when "Double Blind" %> +

    Double Blind isn't implemented yet.

    + <% when "RiotAPI" %> +

    Riot API is being called for Statistics. Results will appear shortly.

    <% end %> <% when 2 %> -- cgit v1.2.3-54-g00ecf