remove /mod/log - closes lichess-org/tavern#8

pull/8158/head
Thibault Duplessis 2021-02-10 12:27:15 +01:00
parent 75f3cf79bf
commit 085463c5d1
5 changed files with 0 additions and 69 deletions

View File

@ -209,11 +209,6 @@ final class Mod(
}
}(actionResult(username))
def log =
Secure(_.ModLog) { implicit ctx => _ =>
modLogApi.recent map { html.mod.log(_) }
}
def table =
Secure(_.ModLog) { implicit ctx => _ =>
modApi.allMods map { html.mod.table(_) }

View File

@ -1,49 +0,0 @@
package views.html.mod
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
object log {
def apply(logs: List[lila.mod.Modlog])(implicit ctx: Context) = {
val title = "Mod logs"
views.html.base.layout(
title = title,
moreCss = cssTag("mod.misc")
) {
main(cls := "page-menu")(
views.html.mod.menu("log"),
div(id := "modlog_table", cls := "page-menu__content box")(
h1(title, " (#tavern-log in slack)"),
table(cls := "slist slist-pad")(
thead(
tr(
th("Mod"),
th("Action"),
th("Details")
)
),
tbody(
logs.map { log =>
tr(
td(userIdLink(log.mod.some), br, momentFromNow(log.date)),
td(
log.showAction.capitalize,
" ",
log.user.map { u =>
userIdLink(u.some, params = "?mod")
}
),
td(log.details)
)
}
)
)
)
)
}
}
}

View File

@ -26,8 +26,6 @@ object menu {
a(cls := active.active("tour"), href := routes.TournamentCrud.index(1))("Tournaments"),
isGranted(_.ManageEvent) option
a(cls := active.active("event"), href := routes.Event.manager)("Events"),
isGranted(_.SeeReport) option
a(cls := active.active("log"), href := routes.Mod.log)("Mod log"),
isGranted(_.SeeReport) option
a(cls := active.active("irwin"), href := routes.Irwin.dashboard)("Irwin dashboard"),
isGranted(_.Shadowban) option

View File

@ -433,7 +433,6 @@ GET /mod/:username/communication/private controllers.Mod.communicationPrivate(
POST /mod/:username/rankban/:v controllers.Mod.rankban(username: String, v: Boolean)
POST /mod/:username/reportban/:v controllers.Mod.reportban(username: String, v: Boolean)
POST /mod/:username/impersonate controllers.Mod.impersonate(username: String)
GET /mod/log controllers.Mod.log
GET /mod/table controllers.Mod.table
POST /mod/:username/refreshUserAssess controllers.Mod.refreshUserAssess(username: String)
POST /mod/:username/email controllers.Mod.setEmail(username: String)

View File

@ -223,18 +223,6 @@ final class ModlogApi(repo: ModlogRepo, userRepo: UserRepo, slackApi: lila.slack
def appealPost(mod: User.ID, user: User.ID) =
add { Modlog(mod, user.some, Modlog.appealPost, details = none) }
def recent =
coll
.find(
$or(
$doc("mod" -> $ne("lichess")),
$doc("action" -> $nin("selfCloseAccount", "modMessage"))
)
)
.sort($sort naturalDesc)
.cursor[Modlog]()
.gather[List](100)
def wasUnengined(sus: Suspect) =
coll.exists(
$doc(