diff options
author | nfoy <nfoy@purdue.edu> | 2014-04-03 16:49:07 -0400 |
---|---|---|
committer | nfoy <nfoy@purdue.edu> | 2014-04-03 16:49:07 -0400 |
commit | ef0cc1035632d7b59a5977038ac30fe1292d0128 (patch) | |
tree | cc4b6f1105defaa7ac56afa141d2416a7f956f9d /app/views/tournaments | |
parent | 9d2e1394bc09d4df3fce97d6151f5bfc3546fbe8 (diff) | |
parent | d6009eddd6f67a9414ff7d707ae82c053e6653ad (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
Diffstat (limited to 'app/views/tournaments')
-rw-r--r-- | app/views/tournaments/_selected.html.erb | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 8734b14..8a704b5 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -4,7 +4,7 @@ <% @chosen = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> - <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") or (name == "set_rounds") %> <% next %> <% end %> <p> 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+"<li><span class=\"black\">"+tournament["players"][i]["user_name"]+"</span></li>" } + + //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); } |