summaryrefslogtreecommitdiff
path: root/app/views/matches
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-04-07 03:58:45 -0400
committerguntasgrewal <guntasgrewal@gmail.com>2014-04-07 03:58:45 -0400
commit26738698ae3a26c98d81a03309c150c7e38e3488 (patch)
treed118af5019890b00518d9da9099205bdb51ccfff /app/views/matches
parentf20dc8df17187027c1881803dbc72b1d3802ff1a (diff)
parent641e968a7ffaaa31724b34422cc165d4b66ae131 (diff)
Merge branch 'master' of https://github.com/LukeShu/leaguer
Conflicts: app/controllers/matches_controller.rb app/views/matches/show.html.erb
Diffstat (limited to 'app/views/matches')
-rw-r--r--app/views/matches/index.html.erb3
-rw-r--r--app/views/matches/show.html.erb17
2 files changed, 18 insertions, 2 deletions
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb
index 6c93321..15b59f4 100644
--- a/app/views/matches/index.html.erb
+++ b/app/views/matches/index.html.erb
@@ -36,7 +36,8 @@
<SVG version="1.1"
baseProfile="full"
width="100%" height="<%= @height = [@height, 500].max %>"
- xmlns="http://www.w3.org/2000/svg">
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
<% lastrx = 0
lastry = 0
lastrh = 0
diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb
index a832d17..c92aea3 100644
--- a/app/views/matches/show.html.erb
+++ b/app/views/matches/show.html.erb
@@ -81,6 +81,7 @@
<% when 2 %>
<!-- Finished, waiting for peer reviews -->
<input type="hidden" name="update_action" value="peer">
+ <input type="hidden" name="review_action" value="">
<% users = []; @match.teams.each{|t| users.concat(t.users)}; %>
<% if users.include? current_user %>
<% @match.teams.each do |team| %>
@@ -101,7 +102,7 @@
</ol>
<% end %>
<% end %>
- <%= submit_tag("Submit peer evaluation") %>
+ <%= submit_tag("Submit peer evaluation", :onsubmit => "score_peers()") %>
<% else %>
Waiting for peer evaluations to be submitted.
<% end %>
@@ -113,3 +114,17 @@
<% end # case %>
<% end # form %>
</div>
+
+<script type="text/javascript">
+function score_peers() {
+ //get each player in order and assign score here!
+ var $lisp = $('ol#boxes');
+ var comma = ","
+ for(var i=0; i < $lisp.length; i++) {
+ if ( i == lisp.length-1) {
+ comma = "";
+ }
+ $('review_action').value += $('ol#boxes:eq(' + i + ')').text() + comma;
+ }
+}
+</script>