temporarily disable mod leaderboards - for #5797

pull/5803/head
Thibault Duplessis 2019-12-21 15:22:26 -06:00
parent e23f1f6096
commit de678847fe
2 changed files with 25 additions and 14 deletions

View File

@ -1,5 +1,10 @@
package controllers
import play.api.data._
import play.api.data.Forms._
import com.github.ghik.silencer.silent
import play.api.mvc._
import com.github.ghik.silencer.silent
import lila.api.{ BodyContext, Context }
import lila.app._
@ -12,10 +17,6 @@ import lila.user.{ User => UserModel, Title }
import ornicar.scalalib.Zero
import views._
import play.api.data._
import play.api.data.Forms._
import play.api.mvc._
final class Mod(
env: Env,
reportC: => Report,
@ -283,18 +284,23 @@ final class Mod(
}
}
private def temporarilyDisabled(implicit ctx: Context) =
ServiceUnavailable(views.html.site.message.temporarilyDisabled).fuccess
def gamify = Secure(_.SeeReport) { implicit ctx => _ =>
env.mod.gamify.leaderboards zip
env.mod.gamify.history(orCompute = true) map {
case (leaderboards, history) => Ok(html.mod.gamify.index(leaderboards, history))
}
temporarilyDisabled
// env.mod.gamify.leaderboards zip
// env.mod.gamify.history(orCompute = true) map {
// case (leaderboards, history) => Ok(html.mod.gamify.index(leaderboards, history))
// }
}
def gamifyPeriod(periodStr: String) = Secure(_.SeeReport) { implicit ctx => _ =>
lila.mod.Gamify.Period(periodStr).fold(notFound) { period =>
env.mod.gamify.leaderboards map { leaderboards =>
Ok(html.mod.gamify.period(leaderboards, period))
}
}
def gamifyPeriod(@silent periodStr: String) = Secure(_.SeeReport) { implicit ctx => _ =>
temporarilyDisabled
// lila.mod.Gamify.Period(periodStr).fold(notFound) { period =>
// env.mod.gamify.leaderboards map { leaderboards =>
// Ok(html.mod.gamify.period(leaderboards, period))
// }
// }
}
def search = SecureBody(_.UserSearch) { implicit ctx => _ =>

View File

@ -78,4 +78,9 @@ object message {
def authFailed(implicit ctx: Context) = apply("403 - Access denied!") {
"You tried to visit a page you're not authorized to access."
}
def temporarilyDisabled(implicit ctx: Context) =
apply("Temporarily disabled")(
"Sorry, his feature is temporarily disabled while we figure out a way to bring it back."
)
}