From 42d6e3b1cc05ef5172081682b53675e4827254d3 Mon Sep 17 00:00:00 2001 From: tkimia Date: Tue, 29 Apr 2014 16:41:35 -0400 Subject: elimination works SOMETIMES... other times it just can't put down a damned winner --- app/views/matches/index.html.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/views/matches') diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 784d7db..e0e69b5 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -18,12 +18,13 @@ <%= "Match #{match.id}" %> <%= match.status %> <%= (match.winner.nil? ? "-" : "Team #{match.winner.id}") %> - <%= link_to "Show", tournament_match_path(@tournament, match) %> - <%# If user is the host, let them start the tournment %> - <% if @tournament.hosts.include?(current_user) %> + <%= link_to "See Match", tournament_match_path(@tournament, match) %> + + <%# NOTE: - fix this permission, if split up by match, this does not work %> + <% if @tournament.check_permission(current_user, :edit) %> <%= form_tag(tournament_match_path(@tournament, match), method: "put") do %> - <% @startable = (match.status == 0) and (match.teams.count >= @tournament.min_teams_per_match) %> + <% @startable = (match.status == 1) and (match.teams.count >= @tournament.min_teams_per_match) %> <%= submit_tag("Start Match", :disabled => ! @startable) %> <% end %> <% end %> -- cgit v1.2.3-2-g168b