replace more <i> in scala templates

This commit is contained in:
Thibault Duplessis
2026-05-07 11:42:22 +02:00
parent 99877d7a7d
commit 118f46bf49
13 changed files with 23 additions and 23 deletions
+2 -2
View File
@@ -371,8 +371,8 @@ final class DashboardUi(helpers: Helpers, ui: ClasUi)(using NetDomain):
"%"
),
td(dataSort := coord.white, cls := "coords")(
i(cls := "color-icon is white")(coord.white),
i(cls := "color-icon is black")(coord.black)
iconTag(cls := "color-icon is white")(coord.white),
iconTag(cls := "color-icon is black")(coord.black)
)
)
}
+2 -2
View File
@@ -48,8 +48,8 @@ final class EventUi(helpers: Helpers)(modMenu: Context ?=> Frag):
def iconOf(e: Event) =
e.icon match
case None => i(cls := "img", dataIcon := Icon.Mic)
case Some(c) if c == EventForm.icon.broadcast => i(cls := "img", dataIcon := Icon.RadioTower)
case None => iconTag(Icon.Mic)(cls := "img")
case Some(c) if c == EventForm.icon.broadcast => iconTag(Icon.RadioTower)(cls := "img")
case Some(c) => img(cls := "img", src := assetUrl(s"images/$c"))
def show(e: Event, description: Option[Html])(using Context) =
+2 -2
View File
@@ -19,7 +19,7 @@ final class ModInquiryUi(helpers: Helpers)(
def apply(in: Inquiry)(using Context, Me) =
val presets = getPmPresets.byPermission
div(id := "inquiry", data("username") := in.user.user.username)(
i(title := "Costello the Inquiry Octopus", cls := "costello"),
iconTag(title := "Costello the Inquiry Octopus", cls := "costello"),
div(cls := "meat")(
userLink(in.user.user, withPerfRating = in.user.perfs.some, params = "?mod"),
div(cls := "docs reports")(
@@ -315,7 +315,7 @@ final class ModInquiryUi(helpers: Helpers)(
private def markButton(active: Boolean, icon: Either[Icon, String]) = submitButton(
cls := List("fbt icon" -> true, "active" -> active, "text" -> icon.isLeft),
dataIcon := icon.left.toOption
)(icon.toOption.map(str => frag(i(str), " ")))
)(icon.toOption.map(str => frag(iconTag(str), " ")))
private def presetForms(in: Inquiry)(presets: List[ModPreset])(using Me) =
(Granter(_.ModMessage) && presets.nonEmpty).option:
+2 -2
View File
@@ -19,7 +19,7 @@ final class ModUserUi(helpers: Helpers, modUi: ModUi, mailerEventsUrl: Url):
val dataValue = attr("data-value")
val dataTags = attr("data-tags")
val playban = iconTag(Icon.Clock)
val alt: Frag = i("A")
val alt: Frag = iconTag("A")
val shadowban: Frag = iconTag(Icon.BubbleSpeech)
val boosting: Frag = iconTag(Icon.LineGraph)
val engine: Frag = iconTag(Icon.Cogs)
@@ -28,7 +28,7 @@ final class ModUserUi(helpers: Helpers, modUi: ModUi, mailerEventsUrl: Url):
val clean: Frag = iconTag(Icon.User)
val reportban = iconTag(Icon.CautionTriangle)
val notesText = iconTag(Icon.Pencil)
val rankban = i("R")
val rankban = iconTag("R")
def menu = mzSection("menu")(
a(href := "#mz_actions")("Overview"),
+1 -1
View File
@@ -92,7 +92,7 @@ final class PracticeUi(helpers: Helpers)(
)
)
),
i(cls := s"${stud.id}"),
iconTag(cls := stud.id),
span(cls := "text")(
h3(stud.name),
p(stud.desc)
+1 -1
View File
@@ -63,7 +63,7 @@ final class TwoFactorUi(helpers: Helpers, ui: AccountUi)(
div(cls := "twofactor box box-pad")(
boxTop(
h1(
i(cls := "is-green text", dataIcon := Icon.Checkmark),
iconTag(Icon.Checkmark)(cls := "is-green text"),
trt.twoFactorEnabled()
)
),
+2 -2
View File
@@ -20,10 +20,10 @@ final class RacerUi(helpers: Helpers):
h1(cls := "box__top")("Puzzle Racer"),
div(cls := "racer-home__buttons")(
postForm(cls := "racer-home__lobby", action := routes.Racer.lobby)(
submitButton(cls := "button button-fat")(i(cls := "car")(1), s.joinPublicRace())
submitButton(cls := "button button-fat")(iconTag(cls := "car")(1), s.joinPublicRace())
),
postForm(cls := "racer-home__create", action := routes.Racer.create)(
submitButton(cls := "button button-fat")(i(cls := "car")(0), s.raceYourFriends())
submitButton(cls := "button button-fat")(iconTag(cls := "car")(0), s.raceYourFriends())
)
),
div(cls := "racer-home__about")(
+1 -1
View File
@@ -113,7 +113,7 @@ final class RelayUi(helpers: Helpers)(
href := tr.path,
cls := s"tour-spotlight event-spotlight relay-spotlight id_${tr.tour.id}"
)(
i(cls := "img", dataIcon := Icon.RadioTower),
iconTag(Icon.RadioTower)(cls := "img"),
span(cls := "content")(
span(cls := "name")(tr.tour.spotlight.flatMap(_.title) | tr.tour.name.value),
span(cls := "more")(
+2 -2
View File
@@ -203,7 +203,7 @@ final class ReportUi(helpers: Helpers)(menu: Context ?=> Frag):
menu,
div(id := "report_list", cls := "page-menu__content box")(
div(cls := "header")(
i(cls := "icon"),
iconTag(cls := "icon"),
span(cls := "tabs")(
Granter(_.SeeReport).option:
a(
@@ -316,7 +316,7 @@ final class ReportUi(helpers: Helpers)(menu: Context ?=> Frag):
)
)(shortenRight(a.text, 200))
),
(r.atoms.size > 3).option(i(cls := "more")("And ", r.atoms.size - 3, " more"))
(r.atoms.size > 3).option(iconTag(cls := "more")("And ", r.atoms.size - 3, " more"))
),
td(
r.inquiry match
+1 -1
View File
@@ -136,7 +136,7 @@ final class SwissHomeUi(helpers: Helpers):
private def faqEntry(title: Frag, content: Frag) =
div(cls := "faq")(
i("?"),
iconTag("?"),
p(strong(title), content)
)
+3 -3
View File
@@ -255,15 +255,15 @@ trait UserHelper:
val patronIconChar = Icon.Wings
val lineIconChar = Icon.Disc
val lineIcon: Frag = i(cls := "line")
val lineIcon: Frag = iconTag(cls := "line")
def patronIcon(p: PatronTier.AndColor)(using Translate): Frag =
i(
iconTag(
cls := s"line patron ${p.color.value.cssClass}",
title := s"${trans.patron.lichessPatron.txt()} (${p.tier.name})"
)
val moderatorIcon: Frag = i(cls := "line moderator", title := "Lichess Mod")
val moderatorIcon: Frag = iconTag(cls := "line moderator", title := "Lichess Mod")
@targetName("lineIconPatron")
private def lineIcon(p: Option[PatronTier.AndColor])(using Translate): Frag =
p.fold(lineIcon)(patronIcon)
+1 -1
View File
@@ -18,7 +18,7 @@ final class SitePages(helpers: Helpers):
def menu(active: String)(using Translate) =
val sep = div(cls := "sep")
val external = frag(" ", i(dataIcon := Icon.ExternalArrow))
val external = frag(" ", iconTag(Icon.ExternalArrow))
def activeCls(c: String) = cls := active.activeO(c)
lila.ui.bits.pageMenuSubnav(
a(activeCls("about"), href := "/about")(trans.site.aboutX("lichess.org")),
+3 -3
View File
@@ -216,9 +216,9 @@ object help:
ul(
li(
instructions1(
i(dataIcon := Icon.Voice),
i(dataIcon := Icon.InfoCircle),
i(dataIcon := Icon.Gear)
iconTag(Icon.Voice),
iconTag(Icon.InfoCircle),
iconTag(Icon.Gear)
)
),
li(instructions2()),