Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to hide user's and opponent's ratings ONLY when playing #16228

Merged
merged 57 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
370c5c4
Add game behavior preference to show or hide opponent rating
yahya-lafhal Oct 12, 2024
75e144a
Add basic translation for the show opponent rating pref
yahya-lafhal Oct 12, 2024
0631267
Handle hiding/showing opponent rating in round's userHtml view
yahya-lafhal Oct 13, 2024
64ce5d9
Change the way I handled the new showRating pref to be more like keyb…
yahya-lafhal Oct 13, 2024
615a41f
Remove unnecessary occurence of showRating and enfore defaut value to…
yahya-lafhal Oct 13, 2024
7a04f3c
Add the showRating pref to the JsonView
yahya-lafhal Oct 14, 2024
1c8e040
Hide ratings in side and user mini while in game based on the new pref
yahya-lafhal Oct 14, 2024
fd3af47
Hide the user's rating too when showRating pref is set to NO
yahya-lafhal Oct 15, 2024
e9387fa
Handle showRating pref in the mini game ui
yahya-lafhal Oct 15, 2024
b94f204
Reshow the hidden ratings after game ends
yahya-lafhal Oct 15, 2024
390d559
Make ratings reapper in mini user popups after game ends
yahya-lafhal Oct 15, 2024
92da481
Rename pref and variables around it for clarity
yahya-lafhal Oct 15, 2024
d8fdb72
Format code
yahya-lafhal Oct 15, 2024
26c8be4
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Oct 16, 2024
1d42d8d
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Oct 16, 2024
09f1d2b
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Oct 17, 2024
d1cc05b
Add in-game only option in existing ratings pref instead of a new pref
yahya-lafhal Oct 20, 2024
ca3a631
Fix logic to work with the changed rating pref
yahya-lafhal Oct 20, 2024
77e79c8
Remove placeholder space from user popup without rating
yahya-lafhal Oct 22, 2024
bf0175c
Remove comment
yahya-lafhal Oct 22, 2024
0763f13
Fix formatting
yahya-lafhal Oct 22, 2024
4affd61
Merge branch 'show-opponent-rating-pref' of https://github.com/yahya-…
yahya-lafhal Oct 22, 2024
511994e
Remove unnecessary translation
yahya-lafhal Oct 22, 2024
aa3c4f9
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Oct 22, 2024
80239e8
Fix server formatting
yahya-lafhal Oct 22, 2024
7f195d1
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Oct 22, 2024
e5e3258
retrigger checks
yahya-lafhal Oct 22, 2024
e1d86e1
Change UI text for the new show ratings option
yahya-lafhal Oct 23, 2024
8de680b
Renaming so it makes sense
yahya-lafhal Oct 23, 2024
e67f1b6
Simplify if statements with boolean logic
yahya-lafhal Oct 23, 2024
bbe24f1
Use game.playable instead of game.finishedOrAborted
yahya-lafhal Oct 23, 2024
688c7b4
Format code
yahya-lafhal Oct 23, 2024
bf2c25d
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Oct 23, 2024
324e5c2
Merge branch 'master' into show-opponent-rating-pref
ornicar Oct 24, 2024
4030f2c
codegolf
ornicar Oct 24, 2024
8426a85
rename isUserPlaying that is not about the user being shown, but the …
ornicar Oct 24, 2024
f9bb60c
fix code duplication with Pref.showRatingsIn
ornicar Oct 24, 2024
182a277
move logic out of view into controller
ornicar Oct 24, 2024
64a6f85
remove superfluous parens
ornicar Oct 24, 2024
55f143b
remove duplicated showRatings check
ornicar Oct 24, 2024
4b1fd37
Merge branch 'master' of https://github.com/yahya-lafhal/lila into sh…
yahya-lafhal Oct 24, 2024
0088a22
Merge branch 'show-opponent-rating-pref' of https://github.com/yahya-…
yahya-lafhal Oct 24, 2024
8729296
Hide ratings in round crosstable minis
yahya-lafhal Nov 5, 2024
b1506dd
Format code
yahya-lafhal Nov 5, 2024
5087199
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Nov 5, 2024
71b6294
Merge branch 'master' into show-opponent-rating-pref
ornicar Nov 6, 2024
e89ae12
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Dec 15, 2024
460a0a1
Use scss logic to handle rating hiding
yahya-lafhal Dec 15, 2024
3387b14
Remove unnecessary showRating argument form GameUI mini
yahya-lafhal Dec 15, 2024
178eee1
Fix formatting
yahya-lafhal Dec 15, 2024
e41563b
Use scss for hiding the side UI rating in game
yahya-lafhal Dec 15, 2024
2e57652
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Dec 15, 2024
d114289
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Dec 16, 2024
6570347
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Dec 17, 2024
6036e3c
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Dec 17, 2024
3ae2128
Merge branch 'master' into show-opponent-rating-pref
yahya-lafhal Dec 17, 2024
5640e11
Merge branch 'master' into show-opponent-rating-pref
ornicar Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/controllers/User.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ final class User(
ctx.userId.soFu(env.game.crosstableApi(user.id, _)),
ctx.isAuth.so(env.pref.api.followable(user.id))
).flatMapN: (blocked, crosstable, followable) =>
val ping = env.socket.isOnline(user.id).so(env.socket.getLagRating(user.id))
val ping = env.socket.isOnline(user.id).so(env.socket.getLagRating(user.id))
val isUserPlaying = ctx.userId.so(env.round.playing(_))
negotiate(
html = (ctx.isnt(user)).so(currentlyPlaying(user.user)).flatMap { pov =>
Ok.snip(views.user.mini(user, pov, blocked, followable, relation, ping, crosstable))
.map(_.withHeaders(CACHE_CONTROL -> "max-age=5"))
Ok.snip(
views.user.mini(user, pov, blocked, followable, relation, ping, crosstable, isUserPlaying)
).map(_.withHeaders(CACHE_CONTROL -> "max-age=5"))
},
json =
import lila.game.JsonView.given
Expand Down
10 changes: 9 additions & 1 deletion app/views/game/side.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ object side:
game.players.mapList: p =>
frag(
div(cls := s"player color-icon is ${p.color.name} text")(
playerLink(p, withOnline = false, withDiff = true, withBerserk = true)
playerLink(
p,
withOnline = false,
withDiff = true,
withBerserk = true,
withRating = game.finishedOrAborted || !ctx.userId.exists(
game.userIds.has
) || ctx.pref.hasShowRatingsInGame
)
),
tour.flatMap(_.teamVs).map(_.teams(p.color)).map {
teamLink(_, withIcon = false)(cls := "team")
Expand Down
9 changes: 7 additions & 2 deletions app/views/user/ui.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def mini(
followable: Boolean,
relation: Option[lila.relation.Relation],
ping: Option[Int],
ct: Option[lila.game.Crosstable]
ct: Option[lila.game.Crosstable],
isUserPlaying: Boolean
)(using ctx: Context) =
val rel = views.relation.mini(u.id, blocked, followable, relation)
def crosstable(myId: UserId) = ct
Expand All @@ -37,7 +38,11 @@ def mini(
def userMarks = views.mod.user.userMarks(u.user, None)
val flag = u.profileOrDefault.flagInfo
val perfs = u.perfs.best8Perfs
show.ui.mini(u, playing, blocked, followable, ping, rel, crosstable, flag, perfs, userMarks)
val showRating = ctx.pref.hasShowRatingsInGame || (playingGame match
case Some(pov) => pov.game.finishedOrAborted || !ctx.userId.exists(pov.game.userIds.has)
case None => !isUserPlaying
)
show.ui.mini(u, playing, blocked, followable, ping, rel, crosstable, flag, perfs, userMarks, showRating)

val perfStat = lila.perfStat.PerfStatUi(helpers)(views.user.bits.communityMenu("ratings"))
def perfStatPage(data: PerfStatData, ratingChart: Option[SafeJsonStr])(using
Expand Down
2 changes: 2 additions & 0 deletions modules/core/src/main/pref.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ trait Pref:
val id: UserId
val coords: Int
val keyboardMove: Int
val showRatingsInGame: Int
val voice: Option[Int]
val rookCastle: Int
val animation: Int
Expand All @@ -21,6 +22,7 @@ trait Pref:

def hasKeyboardMove: Boolean
def hasVoice: Boolean
def hasShowRatingsInGame: Boolean
def showRatings: Boolean
def animationMillis: Int
def animationMillisForSpeedPuzzles: Int
Expand Down
1 change: 1 addition & 0 deletions modules/coreI18n/src/main/key.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ object I18nKey:
val `sayGgWpAfterLosingOrDrawing`: I18nKey = "preferences:sayGgWpAfterLosingOrDrawing"
val `yourPreferencesHaveBeenSaved`: I18nKey = "preferences:yourPreferencesHaveBeenSaved"
val `scrollOnTheBoardToReplayMoves`: I18nKey = "preferences:scrollOnTheBoardToReplayMoves"
val `showRatingsWhilePlaying`: I18nKey = "preferences:showRatingsWhilePlaying"
val `correspondenceEmailNotification`: I18nKey = "preferences:correspondenceEmailNotification"
val `notifyStreamStart`: I18nKey = "preferences:notifyStreamStart"
val `notifyInboxMsg`: I18nKey = "preferences:notifyInboxMsg"
Expand Down
4 changes: 3 additions & 1 deletion modules/game/src/main/ui/GameUi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ final class GameUi(helpers: Helpers):
renderMini(
pov,
withLink.option(gameLink(pov.game, pov.color, ownerLink, tv)),
showRatings = ctx.pref.showRatings
showRatings = ctx.pref.showRatings && (!ctx.userId.exists(
pov.game.userIds.has
) || ctx.pref.hasShowRatingsInGame || pov.game.finishedOrAborted)
)

def noCtx(pov: Pov, tv: Boolean = false, channelKey: Option[String] = None): Tag =
Expand Down
17 changes: 9 additions & 8 deletions modules/pref/src/main/JsonView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ object JsonView:
if lichobileCompat then Pref.SubmitMove.lichobile.serverToApp(p.submitMove)
else p.submitMove
},
"confirmResign" -> p.confirmResign,
"insightShare" -> p.insightShare,
"keyboardMove" -> p.keyboardMove,
"voiceMove" -> p.hasVoice,
"zen" -> p.zen,
"ratings" -> p.ratings,
"moveEvent" -> p.moveEvent,
"rookCastle" -> p.rookCastle
"confirmResign" -> p.confirmResign,
"insightShare" -> p.insightShare,
"keyboardMove" -> p.keyboardMove,
"voiceMove" -> p.hasVoice,
"showRatingsInGame" -> p.showRatingsInGame,
"zen" -> p.zen,
"ratings" -> p.ratings,
"moveEvent" -> p.moveEvent,
"rookCastle" -> p.rookCastle
)
12 changes: 8 additions & 4 deletions modules/pref/src/main/Pref.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ case class Pref(
insightShare: Int,
keyboardMove: Int,
voice: Option[Int],
showRatingsInGame: Int,
zen: Int,
ratings: Int,
flairs: Boolean,
Expand Down Expand Up @@ -98,8 +99,9 @@ case class Pref(

def agree = copy(agreement = Agreement.current)

def hasKeyboardMove = keyboardMove == KeyboardMove.YES
def hasVoice = voice.has(Voice.YES)
def hasKeyboardMove = keyboardMove == KeyboardMove.YES
def hasVoice = voice.has(Voice.YES)
def hasShowRatingsInGame = showRatingsInGame == ShowRatingsInGame.YES

def isUsingAltSocket = usingAltSocket.has(true)

Expand Down Expand Up @@ -247,8 +249,9 @@ object Pref:
EVERYBODY -> "With everybody"
)

object KeyboardMove extends BooleanPref
object Voice extends BooleanPref
object KeyboardMove extends BooleanPref
object Voice extends BooleanPref
object ShowRatingsInGame extends BooleanPref

object RookCastle:
val NO = 0
Expand Down Expand Up @@ -474,6 +477,7 @@ object Pref:
insightShare = lila.core.pref.InsightShare.FRIENDS,
keyboardMove = KeyboardMove.NO,
voice = None,
showRatingsInGame = ShowRatingsInGame.YES,
zen = Zen.NO,
ratings = Ratings.YES,
flairs = true,
Expand Down
37 changes: 21 additions & 16 deletions modules/pref/src/main/PrefForm.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,23 @@ object PrefForm:
"URL must use https",
url => url.isBlank || url.startsWith("https://") || url.startsWith("//")
)
val is3d = "is3d" -> tolerantBoolean
val zen = "zen" -> checkedNumber(Pref.Zen.choices)
val voice = "voice" -> booleanNumber
val keyboardMove = "keyboardMove" -> booleanNumber
val autoQueen = "autoQueen" -> checkedNumber(Pref.AutoQueen.choices)
val premove = "premove" -> booleanNumber
val takeback = "takeback" -> checkedNumber(Pref.Takeback.choices)
val autoThreefold = "autoThreefold" -> checkedNumber(Pref.AutoThreefold.choices)
val submitMove = "submitMove" -> bitCheckedNumber(Pref.SubmitMove.choices)
val confirmResign = "confirmResign" -> checkedNumber(Pref.ConfirmResign.choices)
val moretime = "moretime" -> checkedNumber(Pref.Moretime.choices)
val clockSound = "clockSound" -> booleanNumber
val pieceNotation = "pieceNotation" -> booleanNumber
val ratings = "ratings" -> booleanNumber
val flairs = "flairs" -> boolean
val follow = "follow" -> booleanNumber
val is3d = "is3d" -> tolerantBoolean
val zen = "zen" -> checkedNumber(Pref.Zen.choices)
val voice = "voice" -> booleanNumber
val keyboardMove = "keyboardMove" -> booleanNumber
val showRatingsInGame = "showRatingsInGame" -> booleanNumber
val autoQueen = "autoQueen" -> checkedNumber(Pref.AutoQueen.choices)
val premove = "premove" -> booleanNumber
val takeback = "takeback" -> checkedNumber(Pref.Takeback.choices)
val autoThreefold = "autoThreefold" -> checkedNumber(Pref.AutoThreefold.choices)
val submitMove = "submitMove" -> bitCheckedNumber(Pref.SubmitMove.choices)
val confirmResign = "confirmResign" -> checkedNumber(Pref.ConfirmResign.choices)
val moretime = "moretime" -> checkedNumber(Pref.Moretime.choices)
val clockSound = "clockSound" -> booleanNumber
val pieceNotation = "pieceNotation" -> booleanNumber
val ratings = "ratings" -> booleanNumber
val flairs = "flairs" -> boolean
val follow = "follow" -> booleanNumber
object board:
val brightness = "boardBrightness" -> number(0, 150)
val opacity = "boardOpacity" -> number(0, 100)
Expand Down Expand Up @@ -84,6 +85,7 @@ object PrefForm:
fields.confirmResign,
fields.keyboardMove.map2(optional),
fields.voice.map2(optional),
fields.showRatingsInGame.map2(optional),
"rookCastle" -> optional(booleanNumber)
)(BehaviorData.apply)(unapply),
"clock" -> mapping(
Expand Down Expand Up @@ -124,6 +126,7 @@ object PrefForm:
confirmResign: Int,
keyboardMove: Option[Int],
voice: Option[Int],
showRatingsInGame: Option[Int],
rookCastle: Option[Int]
)

Expand Down Expand Up @@ -172,6 +175,7 @@ object PrefForm:
captured = display.captured == 1,
keyboardMove = behavior.keyboardMove | pref.keyboardMove,
voice = if pref.voice.isEmpty && !behavior.voice.contains(1) then None else behavior.voice,
showRatingsInGame = behavior.showRatingsInGame | pref.showRatingsInGame,
zen = display.zen | pref.zen,
ratings = ratings | pref.ratings,
flairs = flairs | pref.flairs,
Expand Down Expand Up @@ -205,6 +209,7 @@ object PrefForm:
confirmResign = pref.confirmResign,
keyboardMove = pref.keyboardMove.some,
voice = pref.voice.getOrElse(0).some,
showRatingsInGame = pref.showRatingsInGame.some,
rookCastle = pref.rookCastle.some
),
clock = ClockData(
Expand Down
88 changes: 45 additions & 43 deletions modules/pref/src/main/PrefHandlers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ private object PrefHandlers:
insightShare = r.getD("insightShare", Pref.default.insightShare),
keyboardMove = r.getD("keyboardMove", Pref.default.keyboardMove),
voice = r.getO("voice"),
showRatingsInGame = r.getD("showRatingsInGame", Pref.default.showRatingsInGame),
zen = r.getD("zen", Pref.default.zen),
ratings = r.getD("ratings", Pref.default.ratings),
flairs = r.getD("flairs", Pref.default.flairs),
Expand All @@ -60,47 +61,48 @@ private object PrefHandlers:

def writes(w: BSON.Writer, o: Pref) =
$doc(
"_id" -> o.id,
"bg" -> o.bg,
"bgImg" -> o.bgImg,
"is3d" -> o.is3d,
"theme" -> o.theme,
"pieceSet" -> o.pieceSet,
"theme3d" -> o.theme3d,
"pieceSet3d" -> o.pieceSet3d,
"soundSet" -> SoundSet.name2key(o.soundSet),
"autoQueen" -> o.autoQueen,
"autoThreefold" -> o.autoThreefold,
"takeback" -> o.takeback,
"moretime" -> o.moretime,
"clockTenths" -> o.clockTenths,
"clockBar" -> o.clockBar,
"clockSound" -> o.clockSound,
"premove" -> o.premove,
"animation" -> o.animation,
"captured" -> o.captured,
"follow" -> o.follow,
"highlight" -> o.highlight,
"destination" -> o.destination,
"coords" -> o.coords,
"replay" -> o.replay,
"challenge" -> o.challenge,
"message" -> o.message,
"studyInvite" -> o.studyInvite,
"submitMove" -> o.submitMove,
"confirmResign" -> o.confirmResign,
"insightShare" -> o.insightShare,
"keyboardMove" -> o.keyboardMove,
"voice" -> o.voice,
"zen" -> o.zen,
"ratings" -> o.ratings,
"flairs" -> o.flairs,
"rookCastle" -> o.rookCastle,
"moveEvent" -> o.moveEvent,
"pieceNotation" -> o.pieceNotation,
"resizeHandle" -> o.resizeHandle,
"agreement" -> o.agreement,
"usingAltSocket" -> o.usingAltSocket,
"board" -> o.board,
"tags" -> o.tags
"_id" -> o.id,
"bg" -> o.bg,
"bgImg" -> o.bgImg,
"is3d" -> o.is3d,
"theme" -> o.theme,
"pieceSet" -> o.pieceSet,
"theme3d" -> o.theme3d,
"pieceSet3d" -> o.pieceSet3d,
"soundSet" -> SoundSet.name2key(o.soundSet),
"autoQueen" -> o.autoQueen,
"autoThreefold" -> o.autoThreefold,
"takeback" -> o.takeback,
"moretime" -> o.moretime,
"clockTenths" -> o.clockTenths,
"clockBar" -> o.clockBar,
"clockSound" -> o.clockSound,
"premove" -> o.premove,
"animation" -> o.animation,
"captured" -> o.captured,
"follow" -> o.follow,
"highlight" -> o.highlight,
"destination" -> o.destination,
"coords" -> o.coords,
"replay" -> o.replay,
"challenge" -> o.challenge,
"message" -> o.message,
"studyInvite" -> o.studyInvite,
"submitMove" -> o.submitMove,
"confirmResign" -> o.confirmResign,
"insightShare" -> o.insightShare,
"keyboardMove" -> o.keyboardMove,
"showRatingsInGame" -> o.showRatingsInGame,
"voice" -> o.voice,
"zen" -> o.zen,
"ratings" -> o.ratings,
"flairs" -> o.flairs,
"rookCastle" -> o.rookCastle,
"moveEvent" -> o.moveEvent,
"pieceNotation" -> o.pieceNotation,
"resizeHandle" -> o.resizeHandle,
"agreement" -> o.agreement,
"usingAltSocket" -> o.usingAltSocket,
"board" -> o.board,
"tags" -> o.tags
)
2 changes: 2 additions & 0 deletions modules/pref/src/main/PrefSingleChange.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ object PrefSingleChange:
_.copy(voice = v.some),
changing(_.keyboardMove): v =>
_.copy(keyboardMove = v | Pref.KeyboardMove.NO),
changing(_.showRatingsInGame): v =>
_.copy(showRatingsInGame = v | Pref.ShowRatingsInGame.YES),
changing(_.autoQueen): v =>
_.copy(autoQueen = v),
changing(_.premove): v =>
Expand Down
5 changes: 5 additions & 0 deletions modules/pref/src/main/ui/AccountPref.scala
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ final class AccountPref(helpers: Helpers, helper: PrefHelper, bits: AccountUi):
trp.scrollOnTheBoardToReplayMoves(),
radios(form("behavior.scrollMoves"), booleanChoices),
"scrollOnTheBoardToReplayMoves"
),
setting(
trp.showRatingsWhilePlaying(),
radios(form("behavior.showRatingsInGame"), booleanChoices),
"showRatingsWhilePlaying"
)
),
categFieldset(PrefCateg.Privacy, categ)(
Expand Down
1 change: 1 addition & 0 deletions modules/round/src/main/JsonView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ final class JsonView(
.add("confirmResign" -> (!flags.nvui && pref.confirmResign == Pref.ConfirmResign.YES))
.add("keyboardMove" -> (!flags.nvui && pref.hasKeyboardMove))
.add("voiceMove" -> (!flags.nvui && pref.hasVoice))
.add("showRatingsInGame" -> (!flags.nvui && pref.hasShowRatingsInGame))
yahya-lafhal marked this conversation as resolved.
Show resolved Hide resolved
.add("rookCastle" -> (pref.rookCastle == Pref.RookCastle.YES))
.add("highlight" -> pref.highlight)
.add("destination" -> pref.destination)
Expand Down
5 changes: 3 additions & 2 deletions modules/user/src/main/ui/UserShow.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ final class UserShow(helpers: Helpers, bits: UserBits):
crosstable: UserId => Option[Frag],
flag: Option[Flag],
best8Perfs: List[PerfKey],
userMarks: => Frag
userMarks: => Frag,
showRating: Boolean = true
)(using ctx: Context) =
frag(
div(cls := "upt__info")(
Expand All @@ -55,7 +56,7 @@ final class UserShow(helpers: Helpers, bits: UserBits):
if u.lame && ctx.isnt(u) && !Granter.opt(_.UserModView)
then div(cls := "upt__info__warning")(trans.site.thisAccountViolatedTos())
else
ctx.pref.showRatings.option:
(ctx.pref.showRatings && showRating).option:
div(cls := "upt__info__ratings")(best8Perfs.map(showPerfRating(u.perfs, _)))
),
ctx.userId.map: myId =>
Expand Down
1 change: 1 addition & 0 deletions translation/source/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<string name="sayGgWpAfterLosingOrDrawing" comment="sayGgWpAfterLosingOrDrawing&#10;&#10;When enabled, this setting will automatically send 'Good game, well played' to your opponent if you are lose or draw the game. It's meant as a courtesy message.&#10;&#10;The message will be sent in ENGLISH.&#10;&#10;It is up to you how to deal with this. For example, you may want to put '(message will be sent in English)' in your translated text as one example. Or you can leave the actual English text and put a brief translation in your own language.">Say "Good game, well played" upon defeat or draw</string>
<string name="yourPreferencesHaveBeenSaved">Your preferences have been saved.</string>
<string name="scrollOnTheBoardToReplayMoves">Scroll on the board to replay moves</string>
<string name="showRatingsWhilePlaying">Show ratings while playing your games</string>
<string name="correspondenceEmailNotification">Daily email listing your correspondence games</string>
<string name="notifyStreamStart">Streamer goes live</string>
<string name="notifyInboxMsg">New inbox message</string>
Expand Down
1 change: 1 addition & 0 deletions ui/round/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export interface Pref {
highlight: boolean;
is3d: boolean;
keyboardMove: boolean;
showRatingsInGame: boolean;
yahya-lafhal marked this conversation as resolved.
Show resolved Hide resolved
voiceMove: boolean;
moveEvent: Prefs.MoveEvent;
ratings: boolean;
Expand Down
Loading
Loading