From bc8be5e217279012cd4dc62e3fc2fe2bd9308b1c Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 28 Apr 2014 22:01:00 -0400 Subject: bracket update works --- app/views/common/_show_tournament.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/views/common/_show_tournament.html.erb') 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)%>

You've signed up for this tournament!

<% 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 %> -- cgit v1.2.3 From 40c112d42922c14063759d381f834724f22a340d Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 28 Apr 2014 22:54:35 -0400 Subject: made svg smaller --- app/views/common/_show_tournament.html.erb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/views/common/_show_tournament.html.erb') diff --git a/app/views/common/_show_tournament.html.erb b/app/views/common/_show_tournament.html.erb index f4d02ec..c0237b1 100644 --- a/app/views/common/_show_tournament.html.erb +++ b/app/views/common/_show_tournament.html.erb @@ -38,6 +38,11 @@ <%= form_tag(tournament_brackets_path(target), method: "post") do %> <%= submit_tag("Make Bracket") %> <% end %> + <% elsif @user_bracket && target.status == 4 %> + <%= form_tag(tournament_bracket_path(@tournament, @bracket), method: 'put') do %> + + <%= submit_tag("Bracket Results") %> + <% end %> <% end %> <% end %> -- cgit v1.2.3