prioritize current games

This commit is contained in:
Thibault Duplessis 2014-12-03 01:17:05 +01:00
parent 31c99baf1e
commit 2257a463b3
3 changed files with 7 additions and 2 deletions

View file

@ -1,6 +1,6 @@
@(povs: List[Pov])(implicit ctx: Context)
@povs.sortBy(pov => pov.remainingSeconds | (99999999 - pov.isMyTurn.fold(1, 0))).map { pov =>
@povs.sortBy(Pov.priority).map { pov =>
<a href="@routes.Round.player(pov.fullId)" class="@if(pov.isMyTurn){my_turn}">
@gameFen(pov.game, pov.color, withLink = false, withTitle = false)
<span class="meta">

View file

@ -51,6 +51,11 @@ object Pov {
def apply(game: Game, user: lila.user.User): Option[Pov] =
game player user map { apply(game, _) }
def priority(pov: Pov) =
if (pov.isMyTurn) pov.remainingSeconds.getOrElse(Int.MaxValue - 1)
else Int.MaxValue
}
case class PovRef(gameId: String, color: Color) {

View file

@ -1179,7 +1179,7 @@ div.table_wrap > .clock > .time {
font-family: monospace;
}
div.table_wrap > .correspondence.clock > .time {
font-size: 21px;
font-size: 20px;
}
div.table_wrap > .clock .time span {
font-size: 80%;