summaryrefslogtreecommitdiff
path: root/app/views/matches/show.html.erb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-25 11:20:29 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-25 11:20:29 -0400
commitc584cd3127ad47a9c093356aee46394c6b35cc3e (patch)
tree149940f8cd7e6465f40e429b0d14470edc84a808 /app/views/matches/show.html.erb
parentd3cfd8683e842ce60ba339d6e6c7342738ec4cf8 (diff)
parent3a87a43fb993c08b780be484fa3d89bc3c568e64 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts: app/views/matches/show.html.erb
Diffstat (limited to 'app/views/matches/show.html.erb')
-rw-r--r--app/views/matches/show.html.erb34
1 files changed, 19 insertions, 15 deletions
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index e87ce5d..7a82527 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 %>
<li><%= user.user_name %></li>
<% else %>
- <li><%= user.user_name %> - SCORE: <%= user.statistics.where(:name => "score", :match => @match).first.value %></li>
+ <% score = user.statistics.where(:name => "score", :match => @match).first %>
+ <li><%= user.user_name %> - SCORE: <%= score ? score.value : 0 %></li>
<% end %>
<% end %>
</ul></li>
@@ -76,21 +77,24 @@ function score_peers() {
<% when 1 %>
<!-- Started, waiting to finish -->
<!-- This will depend on the Sampling Method Eventually instead of always being Manual -->
- <% if @tournament.hosts.include? current_user %>
- <input type="hidden" name="update_action" value="finish">
- <% @match.teams.each do |team| %>
- <fieldset><legend>Team <%= team.id.to_s %></legend>
- <% team.users.collect{|u| u.user_name}.each do |k| %><label>
- Score for <%= k %><br>
- <% @player_score = 0 %>
- <% current_user.statistics.where(:match => @match, :user => current_user).each{ |s| @player_score+=s.value } %>
- <%= text_field_tag("scores[#{k}]", @player_score, size: 3) %>
- </label><% end %>
- </fieldset>
+
+ <% case @tournament.sampling_method %>
+ <% when "Manual" %>
+ <% if @tournament.hosts.include? current_user %>
+ <input type="hidden" name="update_action" value="finish">
+ <% @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 %>
+ <p>The match is running; the host has yet to post the scores of the match.</p>
<% end %>
- <%= submit_tag("Finish match") %>
- <% else %>
- <p>The match is running; the host has yet to post the scores of the match.</p>
+ <% when "Double Blind" %>
+ <p>Double Blind isn't implemented yet.</p>
+ <% when "RiotAPI" %>
+ <p>Riot API is being called for Statistics. Results will appear shortly.</p>
<% end %>
<% when 2 %>
<!-- Finished, waiting for peer reviews -->