diff --git a/app/controllers/Tournament.scala b/app/controllers/Tournament.scala index 29c818de7d..ea04405083 100644 --- a/app/controllers/Tournament.scala +++ b/app/controllers/Tournament.scala @@ -130,27 +130,6 @@ object Tournament extends LilaController { } } - def userGameNbMini(id: String, user: String, nb: Int) = Open { implicit ctx => - withUserGameNb(id, user, nb) { pov => - Ok(html.tournament.bits.miniGame(pov)) - } - } - - def userGameNbShow(id: String, user: String, nb: Int) = Open { implicit ctx => - withUserGameNb(id, user, nb) { pov => - Redirect(routes.Round.watcher(pov.gameId, pov.color.name)) - } - } - - private def withUserGameNb(id: String, user: String, nb: Int)(withPov: Pov => Result)(implicit ctx: Context): Fu[Result] = { - val userId = lila.user.User normalize user - OptionFuResult(PairingRepo.byTourUserNb(id, userId, nb)) { pairing => - GameRepo game pairing.id map { - _.flatMap { Pov.ofUserId(_, userId) }.fold(Redirect(routes.Tournament show id))(withPov) - } - } - } - def player(id: String, userId: String) = Open { implicit ctx => JsonOk { env.api.playerInfo(id, userId) flatMap { diff --git a/app/views/tournament/bits.scala b/app/views/tournament/bits.scala index 828b3dea6f..76c6d09044 100644 --- a/app/views/tournament/bits.scala +++ b/app/views/tournament/bits.scala @@ -9,19 +9,6 @@ import controllers.routes object bits { - def miniGame(pov: lila.game.Pov)(implicit ctx: Context) = frag( - gameFen(pov), - div(cls := "vstext")( - playerUsername(pov.opponent, withRating = true, withTitle = true), - br, - span(cls := List( - "result" -> true, - "win" -> ~pov.win, - "loss" -> ~pov.loss - ))(gameEndStatus(pov.game)) - ) - ) - def notFound()(implicit ctx: Context) = views.html.base.layout( title = trans.tournamentNotFound.txt() diff --git a/conf/routes b/conf/routes index 2372415f43..db43713193 100644 --- a/conf/routes +++ b/conf/routes @@ -229,8 +229,6 @@ GET /tournament/$id<\w{8}>/page-of/:userId controllers.Tournament.pageOf(id: GET /tournament/$id<\w{8}>/socket/v:apiVersion controllers.Tournament.websocket(id: String, apiVersion: Int) POST /tournament/$id<\w{8}>/join controllers.Tournament.join(id: String) POST /tournament/$id<\w{8}>/withdraw controllers.Tournament.pause(id: String) -GET /tournament/$id<\w{8}>/mini/:user/:nb controllers.Tournament.userGameNbMini(id: String, user: String, nb: Int) -GET /tournament/$id<\w{8}>/show/:user/:nb controllers.Tournament.userGameNbShow(id: String, user: String, nb: Int) GET /tournament/$id<\w{8}>/player/:user controllers.Tournament.player(id: String, user: String) POST /tournament/$id<\w{8}>/terminate controllers.Tournament.terminate(id: String) GET /tournament/help controllers.Tournament.help(system: Option[String] ?= None) diff --git a/modules/tournament/src/main/PairingRepo.scala b/modules/tournament/src/main/PairingRepo.scala index 06735e3a68..9a87626571 100644 --- a/modules/tournament/src/main/PairingRepo.scala +++ b/modules/tournament/src/main/PairingRepo.scala @@ -64,11 +64,6 @@ object PairingRepo { _.flatMap(_.getAs[Game.ID]("_id")) } - def byTourUserNb(tourId: Tournament.ID, userId: User.ID, nb: Int): Fu[Option[Pairing]] = - (nb > 0) ?? coll.find( - selectTourUser(tourId, userId) - ).sort(chronoSort).skip(nb - 1).uno[Pairing] - def removeByTour(tourId: Tournament.ID) = coll.remove(selectTour(tourId)).void def removeByTourAndUserId(tourId: Tournament.ID, userId: User.ID) =