diff options
author | Luke Shumaker <shumakl@purdue.edu> | 2014-04-04 20:44:43 -0400 |
---|---|---|
committer | Luke Shumaker <shumakl@purdue.edu> | 2014-04-04 20:44:43 -0400 |
commit | 38d6960be1efdb6345445ab293a8cd605193785f (patch) | |
tree | df37e79b5744b570aded5aa4d7fe38cd772a49fe /app/views | |
parent | bcfa571b0328a4b3e94479a31c027621ceb86ad5 (diff) | |
parent | d14dcf9af11a0f2eab2609efb7d9e59a9cc18bb0 (diff) |
Merge branch 'master' into luke
Conflicts:
app/controllers/application_controller.rb
app/controllers/tournaments_controller.rb
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/matches/index.html.erb | 22 | ||||
-rw-r--r-- | app/views/matches/show.html.erb | 19 | ||||
-rw-r--r-- | app/views/tournaments/index.html.erb | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 37 | ||||
-rw-r--r-- | app/views/users/new.html.erb | 2 |
5 files changed, 36 insertions, 46 deletions
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 0f86da6..d4ddb0e 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -1,35 +1,30 @@ -<h1><%= @tournament.name %> Matches</h1> +<h1><%= @tournament.name %> - Matches</h1> -<!-- -<table> + +<table class="table"> <thead> <tr> <th>Status</th> - <th>Tournament</th> <th>Name</th> <th>Winner</th> - <th>Remote</th> - <th></th> - <th></th> <th></th> </tr> </thead> - <tbody> + <tbody class="table-hover"> <% @tournament.matches.each do |match| %> <tr> - <td><%= match.tournament.id %></td> <td><%= match.status %></td> - <td><%= match.tournament %></td> + <td><%= match.id%></td> <td><%= match.name %></td> - <td><%= match.winner %></td> + <td><%= link_to "Show", tournament_match_path(@tournament, match) %> </tr> <% end %> </tbody> </table> <br> ---> + <SVG version="1.1" baseProfile="full" @@ -37,7 +32,8 @@ xmlns="http://www.w3.org/2000/svg"> <% (1..@matches.count).each do |i| %> - <g class="svg-match" > + <g class="svg-match"> + <rect rx="10" </g> <% end %> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 53c3b38..4973dc3 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -12,7 +12,24 @@ <strong>Name:</strong> <%= @match.name %> </p> +<!-- + Match Status 0 => Pairings Stage + Match Status 1 => Match Active + Match Status 2 => Match Finished (Peer Review Starts) + Match Status 3 => Match Completed (Scores Completed OR Results Page) + Four views:- (status is Match status) + A. Pairings, when status is 0 for either Host or Player Or when status is 1 for player + B. A page the host will see if status is 1 OR 2 + C. The Peer review page that the players will see if status is 2. + D. The page everyone will see when status is 3. + + Note:- The change of status from 1 to 2 is coming from League Data Pull (RIOT API) + +--> +<!-- + This is what the HOST will see when the Match Status is NOT 3 +--> <% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %> <%= form_for([@tournament, @match], method: "put") do |f| %> <ul> @@ -25,6 +42,8 @@ <% end %> <% end %> + + <% unless @match.winner.nil? %> <p> <strong>Winner:</strong> 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 d246f7a..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 %> @@ -146,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"}) diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index c23f76d..5e369ac 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -23,6 +23,8 @@ <%= f.password_field :password_confirmation %> </p> <p> + <%= show_simple_captcha %> + <%= f.submit("Be a Leaguer", :class => "signup") %> </p> <% end %> |