From fd3308f9aacc9efb2a2692dbff8090dfcd663c88 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Mon, 7 Apr 2014 00:51:27 -0400 Subject: Matches move forward more --- app/views/matches/show.html.erb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 109aa70..cd30926 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -26,6 +26,7 @@ Note:- The change of status from 1 to 2 is coming from League Data Pull (RIOT API) --> + <% if (@match.status== 0) || !@tournament.players.include?(current_user) %> <% @match.teams.each do |team| %>
    @@ -37,7 +38,7 @@ <% elsif (@match.status==1) %> <% if @tournament.hosts.include?(current_user) && @scores.empty? %> @@ -87,7 +88,16 @@ <% if team.users.include?(current_user) %>
      <% team.users.collect{|u| u.user_name}.each do |k| %> -
    1. <%= k %>
    2. +
    3. <%= k%> +
      + <% if (@tournament.game_id == 1) %> + <%= if @blue2["#{k}"] == nil + "Level: #{@purp2["#{k}"]["level"]} K/D/A: #{@purp2["#{k}"]["championsKilled"]}/#{@purp2["#{k}"]["numDeaths"]}/#{@purp2["#{k}"]["assists"]} Gold:#{@purp2["#{k}"]["goldEarned"]}" + else + "Level: #{@blue2["#{k}"]["level"]} K/D/A: #{@blue2["#{k}"]["championsKilled"]}/#{@blue2["#{k}"]["numDeaths"]}/#{@blue2["#{k}"]["assists"]} Gold:#{@blue2["#{k}"]["goldEarned"]}" + end %> + <% end %> +
    4. <% end %>
    <% end %> @@ -104,7 +114,7 @@

    <% end %> -<% if @tournament.hosts.include?(current_user) %> +<% if @tournament.players.include?(current_user) %>
    <%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %> @@ -118,9 +128,11 @@ <% when 2 %> <%= submit_tag("End Match") %> + <% when 3 %> + + <%= submit_tag("Reset Status") %> <% end %> <% end %> -
    <% end %> -- cgit v1.2.3-54-g00ecf From c524bba025ffd09044ce35efc85ee720f3179111 Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 7 Apr 2014 01:06:50 -0400 Subject: lol# On branch master --- app/controllers/matches_controller.rb | 5 +- app/views/matches/index.html.erb | 90 ++++++++++++++++++++------------ app/views/tournaments/_selected.html.erb | 1 - 3 files changed, 61 insertions(+), 35 deletions(-) (limited to 'app/views') diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index f196978..1d4ee27 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -9,10 +9,11 @@ class MatchesController < ApplicationController def index @matches = @tournament.matches - # width of SVG - @width = 300 * (Math.log2(@matches.count).floor + 1); + # depth of SVG tree + @depth = Math.log2(@matches.count).floor+1; # height of SVG @height = 200 * 2**Math.log2(@matches.count).floor + 100; + @h_sector = 2**(@depth-1)+1 end # For compatability with the router assumptions made by ApplicationController#check_permission diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 052d176..1941179 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -37,8 +37,19 @@
    + <% lastrx = 0 + lastry = 0 + lastrh = 0 + lastrw = 0 %> + + + + + + <% (1..@matches.count).each do |i| %> - - - <% when 0 %> - <% if @matches[i-1].teams.count < @tournament.min_teams_per_match %> - stroke="red" - fill-opacity="0.6" - <% else %> - stroke="green" - <% end %> - <% when 1 %> - stroke="orange" - <% when 2 %> - stroke="yellow" - <% when 3 %> - stroke="grey" - <% end %> + + + <% when 0 %> + <% if @matches[i-1].teams.count < @tournament.min_teams_per_match %> + stroke="red" + fill-opacity="0.6" + <% else %> + stroke="green" + <% end %> + <% when 1 %> + stroke="orange" + <% when 2 %> + stroke="yellow" + <% when 3 %> + stroke="grey" + <% end %> /> + + + <% if @matches[i-1].teams.first %> + Team <%= @matches[i-1].teams.first.id %> + <% end %> + + VS + + + + <% if @matches[i-1].teams[1] %> + Team <%= @matches[i-1].teams[1].id %> + <% end %> + + + <% if i > 1 %> + + <% end %> + <% lastrx = rx + lastry = ry + lastrh = rh + lastrw = rw %> - <% if i > 1 %> - - <% end %> + <% end %>
    diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index b66acb0..c3a1736 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -17,5 +17,4 @@

    <% end %> - <%= f.submit %> <% end %> -- cgit v1.2.3-54-g00ecf