summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-04-03 17:56:24 -0400
committerDavisLWebb <davislwebb@ymail.com>2014-04-03 17:56:24 -0400
commit8b3fae332f81b42671bd2a4f332626c75fdeb976 (patch)
tree917b5d74695b69670a75f83f0ba3deeb83e44f07 /app/views
parent6289593da4b6ad30c893b61caf4ac142b590710a (diff)
parent0c1583c0b31504dfdbbbec3e6dcc240acb059891 (diff)
Merge branch 'master' of https://github.com/LukeShu/Leaguer
Diffstat (limited to 'app/views')
-rw-r--r--app/views/matches/index.html.erb4
-rw-r--r--app/views/tournaments/_selected.html.erb2
-rw-r--r--app/views/tournaments/index.html.erb2
-rw-r--r--app/views/tournaments/show.html.erb44
4 files changed, 16 insertions, 36 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/_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/index.html.erb b/app/views/tournaments/index.html.erb
index 6a86955..e174de7 100644
--- a/app/views/tournaments/index.html.erb
+++ b/app/views/tournaments/index.html.erb
@@ -6,7 +6,7 @@
<%# Each tournament has a div for its listing %>
<% @tournaments.each do |t| %>
<div class="row tournament-listing">
- <div class="col-md-2 ">Gravatar of Host Goes Here</div>
+ <div class="col-md-2 "><%= image_tag 'http://www.gravatar.com/avatar/' + Digest::MD5.hexdigest(t.hosts.first.email) + '?s=100&d=mm' %></div>
<div class="col-md-8">
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index b771701..b654804 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -40,35 +40,6 @@
<%= @tournament.max_teams_per_match %>
</p>
-<p>
- <strong>Set rounds:</strong>
- <%= @tournament.set_rounds %>
-</p>
-
-<p>
- <strong>Min players per team:</strong>
- <%= @tournament.min_players_per_team %>
-</p>
-
-<p>
- <strong>Max players per team:</strong>
- <%= @tournament.max_players_per_team %>
-</p>
-
-<p>
- <strong>Min teams per match:</strong>
- <%= @tournament.min_teams_per_match %>
-</p>
-
-<p>
- <strong>Max teams per match:</strong>
- <%= @tournament.max_teams_per_match %>
-</p>
-
-<p>
- <strong>Set rounds:</strong>
- <%= @tournament.set_rounds %>
-</p>
<p>
<strong>Randomized teams:</strong>
@@ -108,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 %>
@@ -134,13 +105,22 @@ 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);
+
+ 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"})