Skip to content

Commit

Permalink
update featured bot order
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHeppell committed Mar 3, 2025
1 parent 8ccd753 commit a2c15c0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app/views/user/bots.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object bots {
div(cls := "bots page-menu__content")(
div(cls := "box bots__featured")(
div(cls := "box__top")(h1("Featured bots")),
botTable(featured)
botTable(featured.sortBy(featuredBotOrder))
),
div(cls := "box")(
div(cls := "box__top")(
Expand All @@ -48,6 +48,22 @@ object bots {
)
}

private def featuredBotOrder(u: User) = u.id match {
case "ps-greedy-one-move" => 1
case "ps-greedy-two-move" => 2
case "ps-greedy-four-move" => 3
case "ps-random-mover" => 4
case "stockfish-level1" => 5
case "stockfish-level2" => 6
case "stockfish-level3" => 7
case "stockfish-level4" => 8
case "stockfish-level5" => 9
case "stockfish-level6" => 10
case "stockfish-level7" => 11
case "stockfish-level8" => 12
case _ => 13
}

private def botTable(users: List[User])(implicit ctx: Context) = div(cls := "bots__list")(
users map { u =>
div(cls := "bots__list__entry")(
Expand Down

0 comments on commit a2c15c0

Please sign in to comment.