summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-06 19:54:48 -0400
committernfoy <nfoy@purdue.edu>2014-04-06 19:54:48 -0400
commite7bf049624246a1248d09c571db31ef26260ae08 (patch)
treefe22ea682512de877630232f71e3c4b5b609096e /app/controllers
parent2fd131ea6c6a1810d27941d85bcf5a5eb2d8669f (diff)
parentf85943114dba527a1f87abb03229553472f57c0c (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/matches_controller.rb4
-rw-r--r--app/controllers/tournaments_controller.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb
index 31fc9ad..e773667 100644
--- a/app/controllers/matches_controller.rb
+++ b/app/controllers/matches_controller.rb
@@ -8,6 +8,10 @@ class MatchesController < ApplicationController
def index
@matches = @tournament.matches
+ # width of SVG
+ @width = 300 * (Math.log2(@matches.count).floor + 1) + 300;
+ # height of SVG
+ @height = 200 * 2**Math.log2(@matches.count).floor + 100;
end
def get_riot_info
diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index a9e91b0..2fc82ed 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -99,7 +99,7 @@ class TournamentsController < ApplicationController
format.html { redirect_to @tournament, notice: 'You have joined this tournament.' }
format.json { head :no_content }
else
- format.html { render action: 'permission_denied', status: :forbidden }
+ format.html { redirect_to @tournament, notice: "You don't have permission to start this tournament." }
format.json { render json: "Permission denied", status: :forbidden }
end
end