summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-03 17:17:12 -0400
committertkimia <tkimia@purdue.edu>2014-04-03 17:17:12 -0400
commit051e61877b4c77a17fd4fa68dfca4d5e74a687df (patch)
tree50830d69ff08b5cd636955b785b4bcc840ae82f5 /app/views
parent25cfa69883a5c74b2a6e6a5021c53fd95202c234 (diff)
fixed some of andrews weird stuff with starting a tournament
Diffstat (limited to 'app/views')
-rw-r--r--app/views/matches/index.html.erb4
-rw-r--r--app/views/tournaments/show.html.erb8
2 files changed, 7 insertions, 5 deletions
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 0f86da6..babf45e 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -1,6 +1,6 @@
<h1><%= @tournament.name %> Matches</h1>
-<!--
+
<table>
<thead>
<tr>
@@ -29,7 +29,7 @@
</table>
<br>
--->
+
<SVG version="1.1"
baseProfile="full"
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index 9939d02..b654804 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -79,8 +79,8 @@
<%# If user is the host, let them start the tournment %>
<% if @tournament.hosts.include?(current_user) %>
- <%= form_tag(tournaments_path.to_s + "/" + @tournament.id.to_s + "/edit", method: "get") do %>
- <input type="hidden" name="close_action" value="close">
+ <%= form_tag(tournament_path(@tournament), method: "put") do %>
+ <input type="hidden" name="update_action" value="start">
<% if @tournament.players.count >= @tournament.min_players_per_team * @tournament.min_teams_per_match %>
<%= submit_tag("Start Tournament") %>
<% else %>
@@ -117,8 +117,10 @@ function donehandle( tournament ) {
//if there are enough players to start, enable the button, else disable it.
$("input[value=\"Start Tournament\"]").prop('disabled', (pct_complete >= 1)? false : true);
+ if (tournament["status"] == 1)
+ window.location.reload(true);
}
- setTimeout(function(){$.ajax({url: "<%= url_for @tournament %>.json"}).done(donehandle)}, 3000);
+ setTimeout(function(){$.ajax({url: "<%= url_for @tournament %>.json"}).done(donehandle)}, 2000);
}
$.ajax({url: "<%= url_for @tournament %>.json"})