From 3bdb0d5446ba1452e82bac4a346a9c9cb8feb660 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Thu, 22 May 2014 02:04:29 +0200 Subject: [PATCH] fix crosstable POV --- app/views/analyse/replay.scala.html | 2 +- modules/game/src/main/Crosstable.scala | 4 ++-- todo | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/views/analyse/replay.scala.html b/app/views/analyse/replay.scala.html index 6cf434334d..48cc1bd660 100644 --- a/app/views/analyse/replay.scala.html +++ b/app/views/analyse/replay.scala.html @@ -148,7 +148,7 @@ moreJs = moreJs) { @cross.map { c =>
- @views.html.game.crosstable(c) + @views.html.game.crosstable(pov.player.userId.fold(c)(c.fromPov))
} diff --git a/modules/game/src/main/Crosstable.scala b/modules/game/src/main/Crosstable.scala index 8c11f768d1..ef04872bb8 100644 --- a/modules/game/src/main/Crosstable.scala +++ b/modules/game/src/main/Crosstable.scala @@ -38,8 +38,8 @@ case class Crosstable( case _ => 0 }))) - def fromPov(user: String) = - if (user == user2) copy(user1 = user2, user2 = user1) + def fromPov(userId: String) = + if (userId == user2.id) copy(user1 = user2, user2 = user1) else this lazy val size = results.size diff --git a/todo b/todo index c73d435b84..41a2bd33af 100644 --- a/todo +++ b/todo @@ -1,6 +1 @@ the todo list has moved to https://etherpad.mozilla.org/ep/pad/view/ro.3bIwxJwTQYW/latest - -deploy ------- -db.crosstable.drop() -restart nginx (/people -> /player)