From dacab01db3ac4b9d9e2281daff74230a003f138e Mon Sep 17 00:00:00 2001 From: tkimia Date: Thu, 3 Apr 2014 16:45:05 -0400 Subject: small change in form (Set Rounds no longer viewable). AJAX fixed so that start tournament button enables or disables based on players here. --- app/views/tournaments/show.html.erb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/views/tournaments/show.html.erb') diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index b771701..d246f7a 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -134,11 +134,18 @@ function donehandle( tournament ) { $("#prog-bar").width( (pct_complete * 100) +"%"); $("#players-needed").text(here + " " + (here==1?"player has":"players have") + " signed up. " + needed + " players needed. "); players = ""; + + //creates the present user list for (var i = 0; i < tournament["players"].length; i++) { players = players+"
  • "+tournament["players"][i]["user_name"]+"
  • " } + + //updates the user list $("#tournament-users").html(players); + //if there are enough players to start, enable the button, else disable it. + $("input[value=\"Start Tournament\"]").prop('disabled', (pct_complete >= 1)? false : true); + } setTimeout(function(){$.ajax({url: "<%= url_for @tournament %>.json"}).done(donehandle)}, 3000); } -- cgit v1.2.3-54-g00ecf