diff --git a/app/ui/scalatags.scala b/app/ui/scalatags.scala index 7cd7a1ea96..643eb295d0 100644 --- a/app/ui/scalatags.scala +++ b/app/ui/scalatags.scala @@ -149,6 +149,8 @@ trait ScalatagsExtensions { t.setAttr("target", Builder.GenericAttrValueSource("_blank")) } + val noFollow = rel := "nofollow" + def ariaTitle(v: String): Modifier = (t: Builder) => { val value = Builder.GenericAttrValueSource(v) t.setAttr("title", value) diff --git a/app/views/base/bits.scala b/app/views/base/bits.scala index f53ac192ef..3d170b6756 100644 --- a/app/views/base/bits.scala +++ b/app/views/base/bits.scala @@ -39,10 +39,10 @@ z-index: 99; val connectLinks = div(cls := "connect-links")( - a(href := "https://twitter.com/lichess", rel := "nofollow")("Twitter"), - a(href := "https://discord.gg/hy5jqSs", rel := "nofollow")("Discord"), - a(href := "https://www.youtube.com/channel/UCr6RfQga70yMM9-nuzAYTsA", rel := "nofollow")("YouTube"), - a(href := "https://www.twitch.tv/lichessdotorg", rel := "nofollow")("Twitch") + a(href := "https://twitter.com/lichess", targetBlank, noFollow)("Twitter"), + a(href := "https://discord.gg/hy5jqSs", targetBlank, noFollow)("Discord"), + a(href := "https://www.youtube.com/channel/UCr6RfQga70yMM9-nuzAYTsA", targetBlank, noFollow)("YouTube"), + a(href := "https://www.twitch.tv/lichessdotorg", targetBlank, noFollow)("Twitch") ) def fenAnalysisLink(fen: FEN)(implicit lang: Lang) = diff --git a/app/views/coach/show.scala b/app/views/coach/show.scala index 8e796f0fc0..bb9c60bfa7 100644 --- a/app/views/coach/show.scala +++ b/app/views/coach/show.scala @@ -84,7 +84,7 @@ object show { profile.youtubeUrls.nonEmpty option st.section(cls := "coach-show__youtube")( h2( profile.youtubeChannel.map { url => - a(href := url, targetBlank, rel := "nofollow")(youtubeVideos()) + a(href := url, targetBlank, noFollow)(youtubeVideos()) } getOrElse youtubeVideos() ), div(cls := "list")( diff --git a/app/views/game/bits.scala b/app/views/game/bits.scala index 2cc36bcc92..66e970f8e2 100644 --- a/app/views/game/bits.scala +++ b/app/views/game/bits.scala @@ -48,7 +48,6 @@ object bits { s"""${routes.Editor.index}?fen=${initialFen.??(_.value.replace(' ', '_'))}""" case v => routes.Page.variant(v.key).url }), - rel := "nofollow", targetBlank, title := variant.title )(name) diff --git a/app/views/search/index.scala b/app/views/search/index.scala index 297f2500dc..3d7d6052e0 100644 --- a/app/views/search/index.scala +++ b/app/views/search/index.scala @@ -29,7 +29,7 @@ object index { main(cls := "box page-small search")( h1(advancedSearch()), st.form( - rel := "nofollow", + noFollow, cls := "box__pad search__form", action := s"${routes.Search.index()}#results", method := "GET" @@ -75,7 +75,7 @@ object index { div(cls := "search__result", id := "results")( paginator.map { pager => val permalink = - a(cls := "permalink", href := routes.Search.index(), rel := "nofollow")("Permalink") + a(cls := "permalink", href := routes.Search.index(), noFollow)("Permalink") if (pager.nbResults > 0) frag( div(cls := "search__status box__pad")( diff --git a/app/views/search/user.scala b/app/views/search/user.scala index 459ee5f0dc..3acc5d00c1 100644 --- a/app/views/search/user.scala +++ b/app/views/search/user.scala @@ -17,7 +17,7 @@ object user { val commons = bits of form import commons._ st.form( - rel := "nofollow", + noFollow, cls := "search__form", action := routes.User.games(u.username, "search"), method := "GET" diff --git a/app/views/user/show/header.scala b/app/views/user/show/header.scala index 862ece0bb9..dd07ae4669 100644 --- a/app/views/user/show/header.scala +++ b/app/views/user/show/header.scala @@ -256,7 +256,7 @@ It's useful against spambots. These marks are not visible to the public.""" }, !hideTroll option div(cls := "social_links col2")( profile.actualLinks.map { link => - a(href := link.url, targetBlank, rel := "nofollow")(link.site.name) + a(href := link.url, targetBlank, noFollow)(link.site.name) } ), div(cls := "teams col2")(