summaryrefslogtreecommitdiff
path: root/app/views/common
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-28 22:01:00 -0400
committertkimia <tkimia@purdue.edu>2014-04-28 22:01:00 -0400
commitbc8be5e217279012cd4dc62e3fc2fe2bd9308b1c (patch)
tree00db3861642ba3ebfb51b85db92478019b62dad7 /app/views/common
parent927e21c067673a46c68e9ecfa191983ebb3874e7 (diff)
bracket update works
Diffstat (limited to 'app/views/common')
-rw-r--r--app/views/common/_show_tournament.html.erb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb
index 02852cf..f4d02ec 100644
--- a/app/views/common/_show_tournament.html.erb
+++ b/app/views/common/_show_tournament.html.erb
@@ -33,7 +33,8 @@
<% elsif target.players.include?(current_user)%>
<p class="message">You've signed up for this tournament!</p>
<% end %>
- <% if target.status == 1 && target.stages.order(:id).first.scheduling_method == "elimination" && target.stages.order(:id).first.matches.order(:id).first.status < 2 %>
+ <% @user_bracket = target.brackets.find_by(user: current_user) %>
+ <% if target.status == 1 && target.stages.order(:id).first.scheduling_method == "elimination" && target.stages.order(:id).first.matches.order(:id).first.status < 2 && !@user_bracket %>
<%= form_tag(tournament_brackets_path(target), method: "post") do %>
<%= submit_tag("Make Bracket") %>
<% end %>