Skip to content

Commit

Permalink
Merge branch 'master' into broadcast-top-ongoing
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 16, 2024
2 parents f442db7 + 9370c8a commit 50a80a8
Show file tree
Hide file tree
Showing 23 changed files with 149 additions and 93 deletions.
3 changes: 3 additions & 0 deletions .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ public/sound
public/piece
public/piece-css
public/flair
public/images
public/cursors
*.png
1 change: 1 addition & 0 deletions COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public/piece/disguised | danegraphics | [CC BY-NC-SA 4.0](https://creativecommon
public/piece/kiwen-suwi | [neverRare](https://github.com/neverRare) | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
public/piece/mpchess | [Maxime Chupin](https://github.com/chupinmaxime) | [GPL3v3+](https://www.gnu.org/licenses/quick-guide-gplv3.en.html)
public/piece/cooke | [fejfar](https://github.com/fejfar) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/piece/monarchy | [slither77](https://github.com/slither77) | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
public/sounds/futuristic | [Enigmahack](https://github.com/Enigmahack) | AGPLv3+
public/sounds/nes | [Enigmahack](https://github.com/Enigmahack) | AGPLv3+
public/sounds/piano | [Enigmahack](https://github.com/Enigmahack) | AGPLv3+
Expand Down
111 changes: 57 additions & 54 deletions app/views/user/show/header.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,63 +89,66 @@ object header:
(ctx.isAuth && ctx.isnt(u))
.option(a(cls := "nm-item note-zone-toggle")(splitNumber(s"${social.notes.size} Notes")))
),
div(cls := "user-actions dropdown")(
a(cls := "text", dataIcon := Icon.Hamburger),
div(cls := "dropdown-window")(
ctx
.is(u)
.option(
frag(
a(
cls := "text",
href := routes.Account.profile,
dataIcon := Icon.Gear
)(trans.site.editProfile.txt()),
a(
cls := "text",
href := routes.Relation.blocks(),
dataIcon := Icon.NotAllowed
)(trans.site.listBlockedPlayers.txt())
)
),
isGranted(_.UserModView).option(
a(
cls := "text mod-zone-toggle",
href := routes.User.mod(u.username),
dataIcon := Icon.Agent
)("Mod zone (Hotkey: m)")
),
a(
cls := "text",
href := routes.User.tv(u.username),
dataIcon := Icon.AnalogTv
)(trans.site.watchGames.txt()),
ctx
.isnt(u)
.option(
views.relation.actions(
u.light,
relation = social.relation,
followable = social.followable,
blocked = social.blocked
)
),
a(
cls := "text",
href := s"${routes.UserAnalysis.index}#explorer/${u.username}",
dataIcon := Icon.Book
)(trans.site.openingExplorer.txt()),
div(cls := "user-actions")(
isGranted(_.UserModView).option(
a(
cls := "text",
href := routes.User.download(u.username),
dataIcon := Icon.Download
)(trans.site.exportGames.txt()),
(ctx.isAuth && ctx.kid.no && ctx.isnt(u)).option(
cls := "mod-zone-toggle",
href := routes.User.mod(u.username),
dataIcon := Icon.Agent,
title := "Mod zone (Hotkey: m)"
)
),
div(cls := "dropdown")(
a(dataIcon := Icon.Hamburger),
div(cls := "dropdown-window")(
ctx
.is(u)
.option(
frag(
a(
cls := "text",
href := routes.Account.profile,
dataIcon := Icon.Gear
)(trans.site.editProfile.txt()),
a(
cls := "text",
href := routes.Relation.blocks(),
dataIcon := Icon.NotAllowed
)(trans.site.listBlockedPlayers.txt())
)
),
a(
cls := "text",
href := s"${routes.Report.form}?username=${u.username}",
dataIcon := Icon.CautionTriangle
)(trans.site.reportXToModerators.txt(u.username))
href := routes.User.tv(u.username),
dataIcon := Icon.AnalogTv
)(trans.site.watchGames.txt()),
ctx
.isnt(u)
.option(
views.relation.actions(
u.light,
relation = social.relation,
followable = social.followable,
blocked = social.blocked
)
),
a(
cls := "text",
href := s"${routes.UserAnalysis.index}#explorer/${u.username}",
dataIcon := Icon.Book
)(trans.site.openingExplorer.txt()),
a(
cls := "text",
href := routes.User.download(u.username),
dataIcon := Icon.Download
)(trans.site.exportGames.txt()),
(ctx.isAuth && ctx.kid.no && ctx.isnt(u)).option(
a(
cls := "text",
href := s"${routes.Report.form}?username=${u.username}",
dataIcon := Icon.CautionTriangle
)(trans.site.reportXToModerators.txt(u.username))
)
)
)
)
Expand Down
1 change: 1 addition & 0 deletions bin/gen/piece-sprite
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ themes = [
['kiwen-suwi', 'svg'],
['mpchess','svg'],
['cooke','svg'],
['monarchy', 'svg'],
]
types = {
'svg' => 'svg+xml;base64,',
Expand Down
34 changes: 17 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ lazy val rating = module("rating",
).dependsOn(common % "test->test")

lazy val cms = module("cms",
Seq(memo, coreI18n, ui),
Seq(memo, ui),
Seq()
)

lazy val puzzle = module("puzzle",
Seq(coreI18n, tree, memo, rating, ui),
Seq(tree, memo, rating),
tests.bundle
)

Expand All @@ -161,7 +161,7 @@ lazy val video = module("video",
)

lazy val coach = module("coach",
Seq(memo, rating, ui),
Seq(memo, rating),
Seq()
)

Expand All @@ -181,7 +181,7 @@ lazy val feed = module("feed",
)

lazy val ublog = module("ublog",
Seq(coreI18n, memo, ui),
Seq(memo, ui),
Seq(bloomFilter)
)

Expand All @@ -191,7 +191,7 @@ lazy val evaluation = module("evaluation",
)

lazy val perfStat = module("perfStat",
Seq(ui, memo, rating),
Seq(memo, rating),
Seq()
)

Expand Down Expand Up @@ -221,7 +221,7 @@ lazy val timeline = module("timeline",
)

lazy val event = module("event",
Seq(memo, coreI18n, ui),
Seq(memo, ui),
Seq()
)

Expand All @@ -241,7 +241,7 @@ lazy val game = module("game",
)

lazy val gameSearch = module("gameSearch",
Seq(coreI18n, search, ui),
Seq(search, ui),
tests.bundle
)

Expand All @@ -257,7 +257,7 @@ lazy val bot = module("bot",
)

lazy val analyse = module("analyse",
Seq(coreI18n, tree, memo, ui),
Seq(tree, memo, ui),
tests.bundle
)

Expand All @@ -267,7 +267,7 @@ lazy val round = module("round",
)

lazy val pool = module("pool",
Seq(coreI18n, db, rating),
Seq(db, rating),
Seq()
)

Expand All @@ -282,7 +282,7 @@ lazy val lobby = module("lobby",
)

lazy val setup = module("setup",
Seq(lobby, ui),
Seq(lobby),
Seq()
)

Expand All @@ -292,12 +292,12 @@ lazy val insight = module("insight",
)

lazy val tutor = module("tutor",
Seq(insight, ui),
Seq(insight),
tests.bundle
)

lazy val opening = module("opening",
Seq(coreI18n, memo, ui),
Seq(memo, ui),
tests.bundle
)

Expand All @@ -307,7 +307,7 @@ lazy val gathering = module("gathering",
)

lazy val tournament = module("tournament",
Seq(gathering, room, memo, ui),
Seq(gathering, room, memo),
Seq(lettuce) ++ tests.bundle
)

Expand All @@ -332,7 +332,7 @@ lazy val irwin = module("irwin",
)

lazy val oauth = module("oauth",
Seq(memo, coreI18n, ui),
Seq(memo, ui),
Seq()
)

Expand Down Expand Up @@ -362,7 +362,7 @@ lazy val title = module("title",
)

lazy val study = module("study",
Seq(coreI18n, tree, memo, room, ui),
Seq(tree, memo, room, ui),
Seq(lettuce) ++ tests.bundle ++ Seq(scalacheck, munitCheck, chess.testKit)
).dependsOn(common % "test->test")

Expand Down Expand Up @@ -412,7 +412,7 @@ lazy val mailer = module("mailer",
)

lazy val plan = module("plan",
Seq(coreI18n, memo, ui),
Seq(memo, ui),
tests.bundle
)

Expand All @@ -422,7 +422,7 @@ lazy val relation = module("relation",
)

lazy val pref = module("pref",
Seq(coreI18n, memo, ui),
Seq(memo, ui),
Seq()
)

Expand Down
1 change: 1 addition & 0 deletions modules/pref/src/main/PieceSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ object PieceSet extends PieceSetObject:
PieceSet("tatiana"),
PieceSet("staunty"),
PieceSet("cooke"),
PieceSet("monarchy"),
PieceSet("governor"),
PieceSet("dubrovny"),
PieceSet("icpieces"),
Expand Down
11 changes: 7 additions & 4 deletions modules/relation/src/main/ui/RelationUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ final class RelationUi(helpers: Helpers):
trans.site.friends()
)
),
pagTable(pag, routes.Relation.following(u.username))
pagTable(pag, routes.Relation.following(u.username), withActions = true)
)

def blocks(u: User, pag: Paginator[Related[UserWithPerfs]])(using Context) =
Expand All @@ -136,7 +136,7 @@ final class RelationUi(helpers: Helpers):
h1(userLink(u, withOnline = false)),
div(cls := "actions")(trans.site.blocks.pluralSame(pag.nbResults))
),
pagTable(pag, routes.Relation.blocks())
pagTable(pag, routes.Relation.blocks(), withActions = false)
)

def opponents(u: User, sugs: List[Related[UserWithPerfs]])(using ctx: Context) =
Expand Down Expand Up @@ -177,7 +177,9 @@ final class RelationUi(helpers: Helpers):
.wrap: body =>
main(cls := "box page-small")(body)

private def pagTable(pager: Paginator[Related[UserWithPerfs]], call: Call)(using ctx: Context) =
private def pagTable(pager: Paginator[Related[UserWithPerfs]], call: Call, withActions: Boolean)(using
ctx: Context
) =
table(cls := "slist slist-pad")(
if pager.nbResults > 0
then
Expand All @@ -189,7 +191,8 @@ final class RelationUi(helpers: Helpers):
td(trans.site.nbGames.plural(r.user.count.game, r.user.count.game.localize)),
td(r.user.seenAt.map: seen =>
trans.site.lastSeenActive(momentFromNow(seen))),
td(actions(r.user.light, relation = r.relation, followable = r.followable, blocked = false))
withActions.option:
td(actions(r.user.light, relation = r.relation, followable = r.followable, blocked = false))
),
pagerNextTable(pager, np => addQueryParam(call.url, "page", np.toString))
)
Expand Down
12 changes: 12 additions & 0 deletions public/piece-css/monarchy.css

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions public/piece-css/monarchy.external.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.is2d .pawn.white {background-image:url('/assets/piece/monarchy/wP.svg')}
.is2d .knight.white {background-image:url('/assets/piece/monarchy/wN.svg')}
.is2d .bishop.white {background-image:url('/assets/piece/monarchy/wB.svg')}
.is2d .rook.white {background-image:url('/assets/piece/monarchy/wR.svg')}
.is2d .queen.white {background-image:url('/assets/piece/monarchy/wQ.svg')}
.is2d .king.white {background-image:url('/assets/piece/monarchy/wK.svg')}
.is2d .pawn.black {background-image:url('/assets/piece/monarchy/bP.svg')}
.is2d .knight.black {background-image:url('/assets/piece/monarchy/bN.svg')}
.is2d .bishop.black {background-image:url('/assets/piece/monarchy/bB.svg')}
.is2d .rook.black {background-image:url('/assets/piece/monarchy/bR.svg')}
.is2d .queen.black {background-image:url('/assets/piece/monarchy/bQ.svg')}
.is2d .king.black {background-image:url('/assets/piece/monarchy/bK.svg')}
1 change: 1 addition & 0 deletions public/piece/monarchy/bB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/bK.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/bN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/bP.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/bQ.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/bR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/wB.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/wK.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/wN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/wP.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/wQ.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/piece/monarchy/wR.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 50a80a8

Please sign in to comment.