lila/app/views/mod/menu.scala

50 lines
2.3 KiB
Scala
Raw Normal View History

2019-02-09 07:22:21 -07:00
package views.html.mod
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import controllers.routes
object menu {
2020-05-05 22:11:15 -06:00
def apply(active: String)(implicit ctx: Context) =
st.nav(cls := "page-menu__menu subnav")(
isGranted(_.SeeReport) option
a(cls := active.active("report"), href := routes.Report.list)("Reports"),
isGranted(_.PublicChatView) option
a(cls := active.active("public-chat"), href := routes.Mod.publicChat)("Public Chats"),
2021-06-07 04:13:13 -06:00
isGranted(_.GamifyView) option
2021-06-07 09:08:47 -06:00
a(cls := active.active("activity"), href := routes.Mod.activity)("Mod activity"),
2021-06-08 09:35:55 -06:00
isGranted(_.GamifyView) option
a(cls := active.active("queues"), href := routes.Mod.queues("month"))("Queues stats"),
isGranted(_.GamifyView) option
a(cls := active.active("gamify"), href := routes.Mod.gamify)("Hall of fame"),
2020-05-05 22:11:15 -06:00
isGranted(_.UserSearch) option
a(cls := active.active("search"), href := routes.Mod.search)("Search users"),
2020-05-05 22:11:15 -06:00
isGranted(_.SetEmail) option
a(cls := active.active("email"), href := routes.Mod.emailConfirm)("Email confirm"),
2020-05-05 22:11:15 -06:00
isGranted(_.PracticeConfig) option
a(cls := active.active("practice"), href := routes.Practice.config)("Practice"),
2020-05-05 22:11:15 -06:00
isGranted(_.ManageTournament) option
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(_.MarkEngine) option
a(cls := active.active("irwin"), href := routes.Irwin.dashboard)("Irwin dashboard"),
2020-05-05 22:11:15 -06:00
isGranted(_.Shadowban) option
a(cls := active.active("panic"), href := routes.Mod.chatPanic)(
2020-05-05 22:11:15 -06:00
"Chat Panic: ",
strong(if (isChatPanicEnabled) "ON" else "OFF")
),
isGranted(_.Admin) option
a(cls := active.active("mods"), href := routes.Mod.table)("Mods"),
isGranted(_.Presets) option
a(cls := active.active("presets"), href := routes.Mod.presets("PM"))("Msg presets"),
2020-05-05 22:11:15 -06:00
isGranted(_.Settings) option
a(cls := active.active("setting"), href := routes.Dev.settings)("Settings"),
2020-05-05 22:11:15 -06:00
isGranted(_.Cli) option
a(cls := active.active("cli"), href := routes.Dev.cli)("CLI")
2020-05-05 22:11:15 -06:00
)
2019-02-09 07:22:21 -07:00
}