Skip to content

Commit

Permalink
replace embedded private use chars
Browse files Browse the repository at this point in the history
  • Loading branch information
schlawg committed May 25, 2023
1 parent 7f68b0b commit 635bba0
Show file tree
Hide file tree
Showing 271 changed files with 7,628 additions and 7,163 deletions.
1 change: 1 addition & 0 deletions app/templating/Environment.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ object Environment
with UserContext.ToLang:

export lila.Lila.{ id as _, *, given }
export lila.common.licon

private var envVar: Option[Env] = None
def setEnv(e: Env) = { envVar = Some(e) }
Expand Down
2 changes: 1 addition & 1 deletion app/templating/FormHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ trait FormHelper { self: I18nHelper =>

def submit(
content: Frag,
icon: Option[String] = Some(""),
icon: Option[String] = Some(lila.common.licon.Checkmark),
nameValue: Option[(String, String)] = None,
confirm: Option[String] = None
): Tag =
Expand Down
2 changes: 1 addition & 1 deletion app/templating/GameHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ trait GameHelper:
def gameVsText(game: Game, withRatings: Boolean = false): String =
Namer.gameVsTextBlocking(game, withRatings)(using lightUser)

val berserkIconSpan = iconTag("")
val berserkIconSpan = iconTag(lila.common.licon.Berserk)

def playerLink(
player: Player,
Expand Down
2 changes: 1 addition & 1 deletion app/templating/TeamHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait TeamHelper { self: HasEnv with RouterHelper =>
def teamLink(id: TeamId, name: Frag, withIcon: Boolean): Tag =
a(
href := routes.Team.show(id),
dataIcon := withIcon.option(""),
dataIcon := withIcon.option(lila.common.licon.Group),
cls := withIcon option "text"
)(name)

Expand Down
9 changes: 5 additions & 4 deletions app/templating/TournamentHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import lila.app.ui.ScalatagsTemplate.*
import lila.rating.PerfType
import lila.tournament.{ Schedule, Tournament }
import lila.user.User
import lila.common.licon
import lila.common.Json.given

trait TournamentHelper extends HasEnv:
Expand All @@ -30,14 +31,14 @@ trait TournamentHelper extends HasEnv:

def tournamentLink(tour: Tournament)(using Lang): Frag =
a(
dataIcon := "",
dataIcon := licon.Trophy,
cls := (if (tour.isScheduled) "text is-gold" else "text"),
href := routes.Tournament.show(tour.id.value).url
)(tour.name())

def tournamentLink(tourId: TourId)(using Lang): Frag =
a(
dataIcon := "",
dataIcon := licon.Trophy,
cls := "text",
href := routes.Tournament.show(tourId.value).url
)(tournamentIdToName(tourId))
Expand All @@ -49,7 +50,7 @@ trait TournamentHelper extends HasEnv:
private def icon(c: Char) = s"""<span data-icon="$c"></span>"""
private val replacements = List(
"Lichess " -> "",
"Marathon" -> icon(''),
"Marathon" -> icon(licon.Globe.charAt(0)),
"HyperBullet" -> s"H${icon(PerfType.Bullet.iconChar)}",
"SuperBlitz" -> s"S${icon(PerfType.Blitz.iconChar)}"
) ::: PerfType.leaderboardable.filterNot(PerfType.translated.contains).map { pt =>
Expand All @@ -65,5 +66,5 @@ trait TournamentHelper extends HasEnv:

def tournamentIconChar(tour: Tournament): String =
tour.schedule.map(_.freq) match
case Some(Schedule.Freq.Marathon | Schedule.Freq.ExperimentalMarathon) => ""
case Some(Schedule.Freq.Marathon | Schedule.Freq.ExperimentalMarathon) => licon.Globe
case _ => tour.spotlight.flatMap(_.iconFont) | tour.perfType.iconChar.toString
7 changes: 4 additions & 3 deletions app/templating/UserHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import mashup.*
import play.api.i18n.Lang

import lila.app.ui.ScalatagsTemplate.{ *, given }
import lila.common.licon
import lila.common.LightUser
import lila.i18n.{ I18nKey, I18nKeys as trans }
import lila.rating.{ Perf, PerfType }
Expand Down Expand Up @@ -257,7 +258,7 @@ trait UserHelper extends HasEnv { self: I18nHelper with StringHelper with Number
def userGameFilterTitle(u: User, nbs: UserInfo.NbGames, filter: GameFilter)(using
lang: Lang
): Frag =
if (filter == GameFilter.Search) frag(iconTag(""), br, trans.search.advancedSearch())
if (filter == GameFilter.Search) frag(iconTag(licon.Search), br, trans.search.advancedSearch())
else splitNumber(userGameFilterTitleNoTag(u, nbs, filter))

private def transLocalize(key: I18nKey, number: Int)(using lang: Lang) =
Expand Down Expand Up @@ -287,8 +288,8 @@ trait UserHelper extends HasEnv { self: I18nHelper with StringHelper with Number
}
s"$name played $nbGames games since $createdAt.$currentRating"

val patronIconChar = ""
val lineIconChar = ""
val patronIconChar = licon.Wings
val lineIconChar = licon.Disc

val lineIcon: Frag = i(cls := "line")
def patronIcon(using lang: Lang): Frag =
Expand Down
4 changes: 2 additions & 2 deletions app/views/account/close.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object close:
active = "close"
) {
div(cls := "account box box-pad")(
boxTop(h1(cls := "text", dataIcon := "")(closeAccount())),
boxTop(h1(cls := "text", dataIcon := licon.CautionCircle)(closeAccount())),
if (managed)
p(managedAccountCannotBeClosed())
else
Expand All @@ -30,7 +30,7 @@ object close:
a(href := routes.User.show(u.username))(changedMindDoNotCloseAccount()),
form3.submit(
closeAccount(),
icon = "".some,
icon = licon.CautionCircle.some,
confirm = closingIsDefinitive.txt().some
)(cls := "button-red")
)
Expand Down
12 changes: 6 additions & 6 deletions app/views/account/notification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ object notification {
thead(
tr(
th,
th(notifyBell(), iconTag("")),
th(notifyPush(), iconTag(""))
th(notifyBell(), iconTag(licon.BellOutline)),
th(notifyPush(), iconTag(licon.PhoneMobile))
)
),
tbody(
Expand All @@ -48,7 +48,7 @@ object notification {
radios(form("notification.playBellSound"), translatedBooleanIntChoices)
)
),
p(cls := "saved text none", dataIcon := "")(yourPreferencesHaveBeenSaved())
p(cls := "saved text none", dataIcon := licon.Checkmark)(yourPreferencesHaveBeenSaved())
)
)
}
Expand All @@ -63,14 +63,14 @@ object notification {
if (!hiddenFields(s"$filterName.$allow"))
div(cls := "toggle", form3.cmnToggle(name, name, checked))
else if (!checked)
div(iconTag('\ue03f'))
div(iconTag(licon.X.charAt(0)))
else
div(
cls := "always-on",
form3.hidden(name, "true"),
filterName match {
case "challenge" => iconTag('\ue048')
case "privateMessage" => iconTag('\ue00f')
case "challenge" => iconTag(licon.Swords.charAt(0))
case "privateMessage" => iconTag(licon.BellOutline.charAt(0))
case _ => emptyFrag
}
)
Expand Down
6 changes: 3 additions & 3 deletions app/views/account/pref.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object pref:
showPlayerRatings(),
frag(
radios(form("ratings"), booleanChoices),
div(cls := "help text shy", dataIcon := "")(
div(cls := "help text shy", dataIcon := licon.InfoCircle)(
explainShowPlayerRatings()
)
)
Expand Down Expand Up @@ -112,7 +112,7 @@ object pref:
promoteToQueenAutomatically(),
frag(
radios(form("behavior.autoQueen"), translatedAutoQueenChoices),
div(cls := "help text shy", dataIcon := "")(
div(cls := "help text shy", dataIcon := licon.InfoCircle)(
explainPromoteToQueenAutomatically()
)
)
Expand Down Expand Up @@ -176,7 +176,7 @@ object pref:
radios(form("insightShare"), translatedInsightShareChoices)
)
),
p(cls := "saved text none", dataIcon := "")(yourPreferencesHaveBeenSaved())
p(cls := "saved text none", dataIcon := licon.Checkmark)(yourPreferencesHaveBeenSaved())
)
)
}
2 changes: 1 addition & 1 deletion app/views/account/reopen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object reopen:
title = trans.reopenYourAccount.txt()
) {
main(cls := "page-small box box-pad")(
boxTop(h1(cls := "is-green text", dataIcon := ""))(trans.checkYourEmail()),
boxTop(h1(cls := "is-green text", dataIcon := licon.Checkmark))(trans.checkYourEmail()),
p(trans.sentEmailWithLink()),
p(trans.ifYouDoNotSeeTheEmailCheckOtherPlaces())
)
Expand Down
12 changes: 6 additions & 6 deletions app/views/account/security.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object security:
td(cls := "icon")(
span(
cls := curSessionId.map { cur => s"is-${if (cur == s.session.id) "gold" else "green"}" },
dataIcon := (if (s.session.isMobile) "" else "")
dataIcon := (if (s.session.isMobile) licon.PhoneMobile else licon.ScreenDesktop)
)
),
td(cls := "info")(
Expand All @@ -76,15 +76,15 @@ object security:
td(
s.session.id != cur option
postForm(action := routes.Account.signout(s.session.id))(
submitButton(cls := "button button-red", title := trans.logOut.txt(), dataIcon := "")
submitButton(cls := "button button-red", title := trans.logOut.txt(), dataIcon := licon.X)
)
)
}
)
},
clients map { client =>
tr(
td(cls := "icon")(span(cls := "is-green", dataIcon := "")),
td(cls := "icon")(span(cls := "is-green", dataIcon := licon.ThreeCheckStack)),
td(cls := "info")(
strong(client.origin),
p(cls := "ua")(
Expand All @@ -106,19 +106,19 @@ object security:
td(
postForm(action := routes.OAuth.revokeClient)(
input(tpe := "hidden", name := "origin", value := client.origin),
submitButton(cls := "button button-red", title := "Revoke", dataIcon := "")
submitButton(cls := "button button-red", title := "Revoke", dataIcon := licon.X)
)
)
)
},
(personalAccessTokens > 0) option tr(
td(cls := "icon")(span(cls := "is-green", dataIcon := "")),
td(cls := "icon")(span(cls := "is-green", dataIcon := licon.Tools)),
td(cls := "info")(
strong("Personal access tokens"),
" can be used to access your account. Revoke any that you do not recognize."
),
td(
a(href := routes.OAuthToken.index, cls := "button", title := "API access tokens", dataIcon := "")
a(href := routes.OAuthToken.index, cls := "button", title := "API access tokens", dataIcon := licon.Gear)
)
)
)
2 changes: 1 addition & 1 deletion app/views/account/twoFactor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ object twoFactor:
div(cls := "account twofactor box box-pad")(
boxTop(
h1(
i(cls := "is-green text", dataIcon := ""),
i(cls := "is-green text", dataIcon := licon.Checkmark),
twoFactorEnabled()
)
),
Expand Down
Loading

0 comments on commit 635bba0

Please sign in to comment.