diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb
index 1dd858a..0e15f7f 100644
--- a/app/controllers/tournaments_controller.rb
+++ b/app/controllers/tournaments_controller.rb
@@ -1,5 +1,5 @@
class TournamentsController < ApplicationController
- before_action :set_tournament, only: [:weigh_in,:weigh_in_weight,:create_custom_weights,:show,:edit,:update,:destroy,:up_matches,:no_matches,:team_scores,:brackets,:generate_matches,:bracket,:results,:all_brackets]
+ before_action :set_tournament, only: [:weigh_in,:weigh_in_weight,:create_custom_weights,:show,:edit,:update,:destroy,:up_matches,:no_matches,:team_scores,:brackets,:generate_matches,:bracket,:all_brackets]
before_filter :check_access, only: [:weigh_in,:weigh_in_weight,:create_custom_weights,:update,:edit,:destroy,:generate_matches]
before_filter :check_for_matches, only: [:up_matches,:bracket]
@@ -36,10 +36,6 @@ class TournamentsController < ApplicationController
end
- def results
- @matches = @tournament.matches
- end
-
def bracket
if params[:weight]
@weight = Weight.where(:id => params[:weight]).includes(:matches,:wrestlers).first
diff --git a/app/controllers/wrestlers_controller.rb b/app/controllers/wrestlers_controller.rb
index 61d867b..f3f6273 100644
--- a/app/controllers/wrestlers_controller.rb
+++ b/app/controllers/wrestlers_controller.rb
@@ -7,6 +7,7 @@ class WrestlersController < ApplicationController
# GET /wrestlers/1.json
def show
@school = @wrestler.school
+ @tournament = @wrestler.tournament
end
# GET /wrestlers/new
diff --git a/app/models/tournament.rb b/app/models/tournament.rb
index 09c6dd7..5249631 100644
--- a/app/models/tournament.rb
+++ b/app/models/tournament.rb
@@ -13,7 +13,7 @@ class Tournament < ActiveRecord::Base
["Pool to bracket"]
end
- def createCustomWeights(value)
+ def createCustomWeights(value)
weights.destroy_all
if value == 'hs'
Weight::HS_WEIGHT_CLASSES.each do |w|
@@ -48,4 +48,8 @@ class Tournament < ActiveRecord::Base
end
end
end
+
+ def totalRounds
+ self.matches.sort_by{|m| m.bout_number}.last.round
+ end
end
diff --git a/app/views/tournaments/results.html.erb b/app/views/tournaments/results.html.erb
deleted file mode 100644
index 6f4b178..0000000
--- a/app/views/tournaments/results.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %>
-
-
-
Will be displayed here.
diff --git a/app/views/wrestlers/show.html.erb b/app/views/wrestlers/show.html.erb index e658175..7908fd8 100644 --- a/app/views/wrestlers/show.html.erb +++ b/app/views/wrestlers/show.html.erb @@ -1,10 +1,11 @@<%= notice %>
-<%= link_to "Back to #{@school.name}", "/schools/#{@school.id}" %> | +<%= link_to "Back to #{@school.name}", "/schools/#{@school.id}", :class=>"btn btn-default" %> <% if tournament_permissions(@wrestler.tournament) %> - <%= link_to "Edit #{@wrestler.name}", edit_wrestler_path(@wrestler) %> | + | <%= link_to "Edit #{@wrestler.name}", edit_wrestler_path(@wrestler), :class=>"btn btn-primary" %> <% end %> - +
Name:
<%= @wrestler.name %>
@@ -27,7 +28,8 @@
-
+