From 0ea678daa091529750cbc9786734db8e1d165bd2 Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 7 Apr 2014 11:25:24 -0400 Subject: ajax support in match show --- app/views/matches/index.html.erb | 9 +++++---- app/views/matches/show.html.erb | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 15b59f4..08d5fd6 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -43,10 +43,10 @@ lastrh = 0 lastrw = 0 %> - + - + + <% (1..@matches.count).each do |i| %> /> - " stroke="black" /> + " /> <% if @matches[i-1].teams.first %> Team <%= @matches[i-1].teams.first.id %> @@ -88,7 +89,7 @@ VS - " stroke="black" /> + " /> <% if @matches[i-1].teams[1] %> Team <%= @matches[i-1].teams[1].id %> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index c92aea3..6be3481 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,6 +1,6 @@

Status: - <%= @match.status %> + <%= @match.status %>

Tournament: @@ -127,4 +127,19 @@ function score_peers() { $('review_action').value += $('ol#boxes:eq(' + i + ')').text() + comma; } } + + +function donehandle( match ) { + if ( console && console.log ) { + } + + //if match has moved on in status, reload the page. + if (parseInt($("#current-id").text()) != match["status"]) + window.location.reload(true); + + setTimeout(function(){$.ajax({url: "<%= request.original_url %>.json"}).done(donehandle)}, 2000); +} + +$.ajax({url: "<%= request.original_url %>.json"}) + .done(donehandle); -- cgit v1.2.3-2-g168b From bcb83a54c9e7d6873470296828e198a63d9b6f67 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Mon, 7 Apr 2014 11:44:18 -0400 Subject: YAML files added --- blue.yaml | 0 purple.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 blue.yaml mode change 100755 => 100644 purple.yaml diff --git a/blue.yaml b/blue.yaml old mode 100755 new mode 100644 diff --git a/purple.yaml b/purple.yaml old mode 100755 new mode 100644 -- cgit v1.2.3-2-g168b From 22098c2551f02c170cfe62a124477eba4c80c044 Mon Sep 17 00:00:00 2001 From: tkimia Date: Mon, 7 Apr 2014 11:52:29 -0400 Subject: small visual changes to show --- app/assets/stylesheets/matches.css.scss | 15 ++++++++++++ app/views/matches/show.html.erb | 41 ++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/matches.css.scss b/app/assets/stylesheets/matches.css.scss index 3ef9170..84430d6 100644 --- a/app/assets/stylesheets/matches.css.scss +++ b/app/assets/stylesheets/matches.css.scss @@ -24,4 +24,19 @@ text-align: center; padding-top: 10px; background-color: rgb(238, 238, 255); +} + +#match-stats { + padding-bottom: 10px; + border-bottom: thick dashed #F0AD4E; +} + +#match-winner { + margin: 0 auto; + text-align: center; + font-size: 2em; +} + +#current-id { + display: none; } \ No newline at end of file diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 16345ab..1f14e05 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,16 +1,29 @@ -

- Status: - <%= @match.status %> -

-

- Tournament: - <%= @match.tournament.id %> -

+
+
+ Status: + <% case @match.status %> + <% when 0 %> + Match Not Started + <% when 1 %> + Match in Progress + <% when 2 %> + Peer Review in Progress + <% when 3 %> + Finished + <% end %> + <%= @match.status %> + +
+
+ Tournament: + <%= @match.tournament.name %> +
-

- Name: - <%= @match.name %> -

+
+ Name: + <%= @match.name %> +
+