fix more warnings, getting ready for scala 3

pull/6950/head
Thibault Duplessis 2020-07-07 11:24:08 +02:00
parent ea510a2fc0
commit b48699798d
122 changed files with 295 additions and 325 deletions

View File

@ -1,7 +1,6 @@
package controllers
import akka.stream.scaladsl._
import ornicar.scalalib.Zero
import play.api.libs.json._
import play.api.mvc._
import scala.concurrent.duration._
@ -260,7 +259,7 @@ final class Api(
}
def tournamentTeams(id: String) =
Action.async { implicit req =>
Action.async {
env.tournament.tournamentRepo byId id flatMap {
_ ?? { tour =>
env.tournament.jsonView.getTeamStanding(tour) map { arr =>

View File

@ -43,7 +43,7 @@ final class Blog(
def preview(token: String) =
WithPrismic { _ => implicit prismic =>
prismic.api.previewSession(token, prismic.linkResolver, routes.Lobby.home.url) map { redirectUrl =>
prismic.api.previewSession(token, prismic.linkResolver, routes.Lobby.home().url) map { redirectUrl =>
Redirect(redirectUrl)
.withCookies(
Cookie(

View File

@ -1,7 +1,8 @@
package controllers
import play.api.mvc.Result
import play.api.libs.json.Json
import play.api.mvc.Result
import scala.annotation.nowarn
import scala.concurrent.duration._
import lila.api.Context
@ -28,7 +29,7 @@ final class Challenge(
}
}
def show(id: String, _color: Option[String]) =
def show(id: String, @nowarn("cat=unused") _color: Option[String]) =
Open { implicit ctx =>
showId(id)
}

View File

@ -464,7 +464,7 @@ final class Clas(
}
def becomeTeacher =
AuthBody { implicit ctx => me =>
AuthBody { _ => me =>
val perm = lila.security.Permission.Teacher.dbKey
(!me.roles.has(perm) ?? env.user.repo.setRoles(me.id, perm :: me.roles).void) inject
Redirect(routes.Clas.index())
@ -498,7 +498,7 @@ final class Clas(
}
def invitationRevoke(id: String) =
Secure(_.Teacher) { implicit ctx => me =>
Secure(_.Teacher) { _ => me =>
env.clas.api.invite.get(lila.clas.ClasInvite.Id(id)) flatMap {
_ ?? { invite =>
WithClass(me, invite.clasId.value) { clas =>

View File

@ -6,7 +6,6 @@ import scalatags.Text.all.Frag
import lila.api.Context
import lila.app._
import lila.common.HTTPRequest
import lila.memo.CacheApi._
import views._

View File

@ -15,7 +15,7 @@ import lila.common.{ ApiVersion, HTTPRequest, Nonce }
import lila.i18n.I18nLangPicker
import lila.notify.Notification.Notifies
import lila.oauth.{ OAuthScope, OAuthServer }
import lila.security.{ FingerHash, FingerPrintedUser, Granter, Permission }
import lila.security.{ FingerPrintedUser, Granter, Permission }
import lila.user.{ UserContext, User => UserModel }
abstract private[controllers] class LilaController(val env: Env)

View File

@ -11,7 +11,7 @@ import lila.chat.Chat
import lila.common.{ EmailAddress, HTTPRequest, IpAddress }
import lila.mod.UserSearch
import lila.report.{ Suspect, Mod => AsMod }
import lila.security.{ FingerHash, Ip2Proxy, Permission }
import lila.security.{ FingerHash, Permission }
import lila.user.{ User => UserModel, Title }
import ornicar.scalalib.Zero
import views._

View File

@ -31,7 +31,7 @@ final class Msg(
ctx.hasInbox ?? env.msg.api.convoWith(me, username, before).flatMap {
case None =>
negotiate(
html = Redirect(routes.Msg.home).fuccess,
html = Redirect(routes.Msg.home()).fuccess,
api = _ => notFoundJson()
)
case Some(c) =>
@ -109,7 +109,7 @@ final class Msg(
(!me.kid && userId != me.id) ?? {
import play.api.data._
import play.api.data.Forms._
Form(single("text" -> nonEmptyText)).bindFromRequest
Form(single("text" -> nonEmptyText)).bindFromRequest()
.fold(
err => jsonFormErrorFor(err, req, me.some),
text => env.msg.api.post(me.id, userId, text)

View File

@ -1,7 +1,6 @@
package controllers
import play.api.mvc._
import scala.concurrent.duration._
import play.api.i18n.Lang
import scala.util.chaining._

View File

@ -129,7 +129,7 @@ final class Practice(
def reset =
AuthBody { _ => me =>
api.progress.reset(me) inject Redirect(routes.Practice.index)
api.progress.reset(me) inject Redirect(routes.Practice.index())
}
def config =
@ -148,8 +148,8 @@ final class Practice(
api.structure.get map { html.practice.config(_, err) }
} { text =>
~api.config.set(text).toOption >>-
api.structure.clear >>
env.mod.logApi.practiceConfig(me.id) inject Redirect(routes.Practice.config)
api.structure.clear() >>
env.mod.logApi.practiceConfig(me.id) inject Redirect(routes.Practice.config())
}
}
}

View File

@ -14,7 +14,7 @@ final class Prismic(
implicit def makeLinkResolver(prismicApi: PrismicApi, ref: Option[String] = None) =
DocumentLinkResolver(prismicApi) {
case (link, _) => routes.Blog.show(link.id, link.slug, ref).url
case _ => routes.Lobby.home.url
case _ => routes.Lobby.home().url
}
private def getDocument(id: String): Fu[Option[Document]] =

View File

@ -1,7 +1,6 @@
package controllers
import play.api.libs.json._
import play.api.mvc._
import scala.util.chaining._
import lila.api.Context

View File

@ -99,7 +99,7 @@ final class Relay(
_ ?? { relay =>
env.relay.forms
.edit(relay)
.bindFromRequest
.bindFromRequest()
.fold(
err => fuccess(Left(relay -> err)),
data => env.relay.api.update(relay) { data.update(_, me) } dmap Right.apply

View File

@ -2,7 +2,7 @@ package controllers
import play.api.data.Form
import play.api.libs.json.Json
import play.api.mvc.{ Result, Results }
import play.api.mvc.Results
import scala.concurrent.duration._
import chess.format.FEN
@ -157,8 +157,6 @@ final class Setup(
case HookResult.Refused => BadRequest(jsonError("Game was not created"))
}
private val hookSaveOnlyResponse = Ok(Json.obj("ok" -> true))
def hook(sri: String) =
OpenBody { implicit ctx =>
NoBot {

View File

@ -60,8 +60,8 @@ final class Streamer(
NoLame {
NoShadowban {
api find me flatMap {
case None => api.create(me) inject Redirect(routes.Streamer.edit)
case _ => Redirect(routes.Streamer.edit).fuccess
case None => api.create(me) inject Redirect(routes.Streamer.edit())
case _ => Redirect(routes.Streamer.edit()).fuccess
}
}
}
@ -92,7 +92,7 @@ final class Streamer(
implicit val req = ctx.body
StreamerForm
.userForm(sws.streamer)
.bindFromRequest
.bindFromRequest()
.fold(
error =>
modData(s.user) map { forMod =>
@ -122,7 +122,7 @@ final class Streamer(
def approvalRequest =
AuthBody { _ => me =>
api.approval.request(me) inject Redirect(routes.Streamer.edit)
api.approval.request(me) inject Redirect(routes.Streamer.edit())
}
def picture =
@ -139,8 +139,8 @@ final class Streamer(
case Some(pic) =>
api.uploadPicture(s.streamer, pic) recover {
case e: lila.base.LilaException => BadRequest(html.streamer.picture(s, e.message.some))
} inject Redirect(routes.Streamer.edit)
case None => fuccess(Redirect(routes.Streamer.edit))
} inject Redirect(routes.Streamer.edit())
case None => fuccess(Redirect(routes.Streamer.edit()))
}
}
}
@ -148,7 +148,7 @@ final class Streamer(
def pictureDelete =
Auth { implicit ctx => _ =>
AsStreamer { s =>
api.deletePicture(s.streamer) inject Redirect(routes.Streamer.edit)
api.deletePicture(s.streamer) inject Redirect(routes.Streamer.edit())
}
}

View File

@ -401,7 +401,6 @@ final class Study(
def cloneApply(id: String) =
Auth { implicit ctx => me =>
implicit val default = ornicar.scalalib.Zero.instance[Fu[Result]](notFound)
val cost = if (isGranted(_.Coach) || me.hasTitle) 1 else 3
CloneLimitPerUser(me.id, cost = cost) {
CloneLimitPerIP(HTTPRequest lastRemoteAddress ctx.req, cost = cost) {

View File

@ -2,7 +2,6 @@ package controllers
import play.api.libs.json.Json
import play.api.mvc._
import scala.concurrent.duration._
import lila.api.Context
import lila.app._
@ -105,7 +104,7 @@ final class Swiss(
env.team.cached.isLeader(teamId, me.id) flatMap {
case false => notFoundJson("You're not a leader of that team")
case _ =>
env.swiss.forms.create.bindFromRequest
env.swiss.forms.create.bindFromRequest()
.fold(
jsonFormErrorDefaultLang,
data =>
@ -138,12 +137,11 @@ final class Swiss(
def withdraw(id: String) =
Auth { implicit ctx => me =>
env.swiss.api.withdraw(SwissId(id), me.id) flatMap { result =>
env.swiss.api.withdraw(SwissId(id), me.id) >>
negotiate(
html = Redirect(routes.Swiss.show(id)).fuccess,
api = _ => fuccess(jsonOkResult)
)
}
}
def edit(id: String) =
@ -159,7 +157,7 @@ final class Swiss(
implicit val req = ctx.body
env.swiss.forms
.edit(swiss)
.bindFromRequest
.bindFromRequest()
.fold(
err => BadRequest(html.swiss.form.edit(swiss, err)).fuccess,
data => env.swiss.api.update(swiss, data) inject Redirect(routes.Swiss.show(id))
@ -171,9 +169,9 @@ final class Swiss(
AuthBody { implicit ctx => me =>
WithEditableSwiss(id, me) { swiss =>
implicit val req = ctx.body
env.swiss.forms.nextRound.bindFromRequest
env.swiss.forms.nextRound.bindFromRequest()
.fold(
err => Redirect(routes.Swiss.show(id)).fuccess,
_ => Redirect(routes.Swiss.show(id)).fuccess,
date => env.swiss.api.scheduleNextRound(swiss, date) inject Redirect(routes.Swiss.show(id))
)
}
@ -187,7 +185,7 @@ final class Swiss(
}
def standing(id: String, page: Int) =
Open { implicit ctx =>
Action.async {
WithSwiss(id) { swiss =>
JsonOk {
env.swiss.standingApi(swiss, page)
@ -196,7 +194,7 @@ final class Swiss(
}
def pageOf(id: String, userId: String) =
Open { implicit ctx =>
Action.async {
WithSwiss(id) { swiss =>
env.swiss.api.pageOf(swiss, lila.user.User normalize userId) flatMap {
_ ?? { page =>
@ -219,13 +217,6 @@ final class Swiss(
}
}
private val ExportLimitPerIP = new lila.memo.RateLimit[lila.common.IpAddress](
credits = 10,
duration = 1.minute,
name = "swiss export per IP",
key = "swiss.export.ip"
)
def exportTrf(id: String) =
Action.async {
env.swiss.api.byId(SwissId(id)) map {

View File

@ -383,7 +383,7 @@ final class User(
}
implicit val extractor = EventSource.EventDataExtractor[Frag](_.render)
Ok.chunked {
Source.single(html.user.mod.menu(user)) merge
Source.single(html.user.mod.menu) merge
modZoneSegment(actions, "actions", user) merge
modZoneSegment(modLog, "modLog", user) merge
modZoneSegment(plan, "plan", user) merge

View File

@ -133,7 +133,7 @@ final class UserAnalysis(
def pgn =
OpenBody { implicit ctx =>
implicit val req = ctx.body
env.importer.forms.importForm.bindFromRequest
env.importer.forms.importForm.bindFromRequest()
.fold(
jsonFormError,
data =>

View File

@ -1,15 +1,13 @@
package lila.app
package http
import play.api.i18n.Lang
import play.api.mvc._
import scala.concurrent.duration._
import lila.common.HTTPRequest
import lila.api.Context
import lila.i18n.I18nLangPicker
final class PageCache(security: lila.security.SecurityApi, cacheApi: lila.memo.CacheApi) {
final class PageCache(cacheApi: lila.memo.CacheApi) {
private val cache = cacheApi.notLoading[String, Result](16, "pageCache") {
_.expireAfterWrite(1.seconds).buildAsync()

View File

@ -32,7 +32,6 @@ final class Preload(
)(implicit ec: scala.concurrent.ExecutionContext) {
import Preload._
import LiveStreams.zero
def apply(
posts: Fu[List[MiniForumPost]],

View File

@ -16,8 +16,6 @@ case class TeamInfo(
tours: TeamInfo.PastAndNext
) {
import TeamInfo._
def hasRequests = requests.nonEmpty
def userIds = forumPosts.flatMap(_.userId)
@ -41,7 +39,6 @@ object TeamInfo {
final class TeamInfoApi(
api: TeamApi,
forumRecent: lila.forum.Recent,
teamCached: lila.team.Cached,
tourApi: TournamentApi,
swissApi: SwissApi,
requestRepo: RequestRepo

View File

@ -236,7 +236,7 @@ trait GameHelper { self: I18nHelper with UserHelper with AiHelper with StringHel
tv: Boolean = false
)(implicit ctx: Context): String = {
val owner = ownerLink ?? ctx.me.flatMap(game.player)
if (tv) routes.Tv.index
if (tv) routes.Tv.index()
else
owner.fold(routes.Round.watcher(game.id, color.name)) { o =>
routes.Round.player(game fullIdOf o.color)

View File

@ -21,7 +21,7 @@ object close {
if (managed)
p("Your account is managed, and cannot be closed.")
else
postForm(cls := "form3", action := routes.Account.closeConfirm)(
postForm(cls := "form3", action := routes.Account.closeConfirm())(
div(cls := "form-group")(closeAccountExplanation()),
div(cls := "form-group")(cantOpenSimilarAccount()),
form3.passwordModified(form("passwd"), trans.password())(autofocus, autocomplete := "off"),

View File

@ -17,7 +17,7 @@ object email {
div(cls := "account box box-pad")(
h1(trans.changeEmail()),
standardFlash(),
postForm(cls := "form3", action := routes.Account.emailApply)(
postForm(cls := "form3", action := routes.Account.emailApply())(
form3.passwordModified(form("passwd"), trans.password())(autofocus),
form3.group(form("email"), trans.email())(form3.input(_, typ = "email")(required)),
form3.action(form3.submit(trans.apply()))

View File

@ -24,7 +24,7 @@ object emailConfirmHelp {
main(cls := "page-small box box-pad email-confirm-help")(
h1(title),
p("You signed up, but didn't receive your confirmation email?"),
st.form(cls := "form3", action := routes.Account.emailConfirmHelp, method := "get")(
st.form(cls := "form3", action := routes.Account.emailConfirmHelp(), method := "get")(
form3.split(
form3.group(
form("username"),
@ -45,7 +45,7 @@ object emailConfirmHelp {
p("We couldn't find any user by this name: ", strong(name), "."),
p(
"You can use it to ",
a(href := routes.Auth.signup)("create a new account"),
a(href := routes.Auth.signup())("create a new account"),
"."
)
)
@ -68,7 +68,7 @@ object emailConfirmHelp {
case Confirmed(name) =>
frag(
p("The user ", strong(name), " is successfully confirmed."),
p("You can ", a(href := routes.Auth.login)("login right now as ", name), "."),
p("You can ", a(href := routes.Auth.login())("login right now as ", name), "."),
p("You do not need a confirmation email.")
)
case Closed(name) =>
@ -78,7 +78,7 @@ object emailConfirmHelp {
case NoEmail(name) =>
frag(
p("The account ", strong(name), " doesn't have an email."),
p("Visit the ", a(href := routes.Main.contact)("contact page"), ".")
p("Visit the ", a(href := routes.Main.contact())("contact page"), ".")
)
}
)

View File

@ -24,7 +24,7 @@ object kid {
if (managed)
p("Your account is managed. Ask your chess teacher about lifting kid mode.")
else
postForm(cls := "form3", action := s"${routes.Account.kidPost}?v=${!u.kid}")(
postForm(cls := "form3", action := s"${routes.Account.kidPost()}?v=${!u.kid}")(
form3.passwordModified(form("passwd"), trans.password())(autofocus, autocomplete := "off"),
submitButton(
cls := List(

View File

@ -34,7 +34,7 @@ object layout {
a(activeCls("editProfile"), href := routes.Account.profile())(
trans.editProfile()
),
isGranted(_.Coach) option a(activeCls("coach"), href := routes.Coach.edit)(
isGranted(_.Coach) option a(activeCls("coach"), href := routes.Coach.edit())(
trans.coach.lichessCoach()
),
div(cls := "sep"),
@ -54,12 +54,12 @@ object layout {
trans.security()
),
div(cls := "sep"),
a(href := routes.Plan.index)(trans.patron.lichessPatron()),
a(href := routes.Plan.index())(trans.patron.lichessPatron()),
div(cls := "sep"),
a(activeCls("oauth.token"), href := routes.OAuthToken.index)(
a(activeCls("oauth.token"), href := routes.OAuthToken.index())(
"API Access tokens"
),
ctx.noBot option a(activeCls("oauth.app"), href := routes.OAuthApp.index)("OAuth Apps"),
ctx.noBot option a(activeCls("oauth.app"), href := routes.OAuthApp.index())("OAuth Apps"),
div(cls := "sep"),
a(activeCls("close"), href := routes.Account.close())(
trans.settings.closeAccount()

View File

@ -17,7 +17,7 @@ object passwd {
div(cls := "account box box-pad")(
h1(trans.changePassword()),
standardFlash(),
postForm(cls := "form3", action := routes.Account.passwdApply)(
postForm(cls := "form3", action := routes.Account.passwdApply())(
form3.passwordModified(form("oldPasswd"), trans.currentPassword())(
autofocus,
autocomplete := "current-password"

View File

@ -46,7 +46,7 @@ object pref {
val booleanChoices = Seq(0 -> trans.no.txt(), 1 -> trans.yes.txt())
div(cls := "account box box-pad")(
h1(bits.categName(categ)),
postForm(cls := "autosubmit", action := routes.Pref.formApply)(
postForm(cls := "autosubmit", action := routes.Pref.formApply())(
categFieldset(PrefCateg.GameDisplay, categ)(
setting(
pieceAnimation(),

View File

@ -30,7 +30,7 @@ object reopen {
p(
"Solve the chess captcha below, and we will send you an email containing a link to reopen your account."
),
postForm(cls := "form3", action := routes.Account.reopenApply)(
postForm(cls := "form3", action := routes.Account.reopenApply())(
error.map { err =>
p(cls := "error")(strong(err))
},

View File

@ -27,7 +27,7 @@ object twoFactor {
div(cls := "account twofactor box box-pad")(
h1(twoFactorAuth()),
standardFlash(),
postForm(cls := "form3", action := routes.Account.setupTwoFactor)(
postForm(cls := "form3", action := routes.Account.setupTwoFactor())(
div(cls := "form-group")(twoFactorHelp()),
div(cls := "form-group")(
twoFactorApp(
@ -66,7 +66,7 @@ object twoFactor {
twoFactorEnabled()
),
standardFlash(),
postForm(cls := "form3", action := routes.Account.disableTwoFactor)(
postForm(cls := "form3", action := routes.Account.disableTwoFactor())(
p(twoFactorDisable()),
form3.passwordModified(form("passwd"), trans.password())(autocomplete := "current-password"),
form3.group(form("token"), authenticationCode())(

View File

@ -47,7 +47,7 @@ object bits {
},
trans.passwordReset()
),
postForm(cls := "form3", action := routes.Auth.passwordResetApply)(
postForm(cls := "form3", action := routes.Auth.passwordResetApply())(
form3.group(form("email"), trans.email())(form3.input(_, typ = "email")(autofocus)),
views.html.base.captcha(form, captcha),
form3.action(form3.submit(trans.emailMeALink()))
@ -114,7 +114,7 @@ object bits {
"Log in by email"
),
p("We will send you an email containing a link to log you in."),
postForm(cls := "form3", action := routes.Auth.magicLinkApply)(
postForm(cls := "form3", action := routes.Auth.magicLinkApply())(
form3.group(form("email"), trans.email())(
form3.input(_, typ = "email")(autofocus, autocomplete := "email")
),
@ -164,7 +164,7 @@ body { margin-top: 45px; }
"""),
div(id := "email-confirm")(
s"Almost there, ${userEmail.username}! Now check your email (${userEmail.email.conceal}) for signup confirmation.",
a(href := routes.Auth.checkYourEmail)("Click here for help")
a(href := routes.Auth.checkYourEmail())("Click here for help")
)
)

View File

@ -31,7 +31,7 @@ object checkYourEmail {
h3("Make sure your email address is correct:"),
br,
br,
postForm(action := routes.Auth.fixEmail)(
postForm(action := routes.Auth.fixEmail())(
input(
id := "new-email",
tpe := "email",
@ -67,7 +67,7 @@ email.setCustomValidity(email.validity.patternMismatch ? currentError : "");
"Did you wait 5 minutes?",
br,
"If so, ",
a(href := routes.Account.emailConfirmHelp)("proceed to this page to solve the issue"),
a(href := routes.Account.emailConfirmHelp())("proceed to this page to solve the issue"),
"."
)
)

View File

@ -25,7 +25,7 @@ object login {
h1(trans.signIn()),
postForm(
cls := "form3",
action := s"${routes.Auth.authenticate}${referrer.?? { ref =>
action := s"${routes.Auth.authenticate()}${referrer.?? { ref =>
s"?referrer=${urlencode(ref)}"
}}"
)(
@ -45,7 +45,7 @@ object login {
div(cls := "alternative")(
a(href := routes.Auth.signup())(trans.signUp()),
a(href := routes.Auth.passwordReset())(trans.passwordReset()),
a(href := routes.Auth.magicLink)("Log in by email")
a(href := routes.Auth.magicLink())("Log in by email")
)
)
}

View File

@ -28,14 +28,14 @@ object signup {
) {
main(cls := "auth auth-signup box box-pad")(
h1(trans.signUp()),
postForm(id := "signup_form", cls := "form3", action := routes.Auth.signupPost)(
postForm(id := "signup_form", cls := "form3", action := routes.Auth.signupPost())(
auth.bits.formFields(form("username"), form("password"), form("email").some, register = true),
input(id := "signup-fp-input", name := "fp", tpe := "hidden"),
div(cls := "form-group text", dataIcon := "")(
trans.computersAreNotAllowedToPlay(),
br,
small(
trans.byRegisteringYouAgreeToBeBoundByOur(a(href := routes.Page.tos)(trans.termsOfService()))
trans.byRegisteringYouAgreeToBeBoundByOur(a(href := routes.Page.tos())(trans.termsOfService()))
)
),
agreement(form("agreement"), form.errors.exists(_.key startsWith "agreement.")),

View File

@ -60,16 +60,16 @@ object layout {
private val jsLicense = raw("""<link rel="jslicense" href="/source">""")
private val favicons = raw {
List(512, 256, 192, 128, 64) map { px =>
List(512, 256, 192, 128, 64).map { px =>
s"""<link rel="icon" type="image/png" href="${staticUrl(
s"logo/lichess-favicon-$px.png"
)}" sizes="${px}x${px}">"""
} mkString ("", "", s"""<link id="favicon" rel="icon" type="image/png" href="${staticUrl(
}.mkString("", "", s"""<link id="favicon" rel="icon" type="image/png" href="${staticUrl(
"logo/lichess-favicon-32.png"
)}" sizes="32x32">""")
}
private def blindModeForm(implicit ctx: Context) =
raw(s"""<form id="blind-mode" action="${routes.Main.toggleBlindMode}" method="POST"><input type="hidden" name="enable" value="${if (
raw(s"""<form id="blind-mode" action="${routes.Main.toggleBlindMode()}" method="POST"><input type="hidden" name="enable" value="${if (
ctx.blind
)
0
@ -108,7 +108,7 @@ object layout {
</a>
<div id="dasher_app" class="dropdown" data-playing="$playing"></div>
</div>
<a href="${routes.Auth.login}?referrer=${ctx.req.path}" class="signin button button-empty">${trans.signIn
<a href="${routes.Auth.login()}?referrer=${ctx.req.path}" class="signin button button-empty">${trans.signIn
.txt()}</a>""")
private val clinputLink = a(cls := "link")(span(dataIcon := "y"))
@ -187,7 +187,7 @@ object layout {
noTranslate,
openGraph.map(_.frags),
link(
href := routes.Blog.atom,
href := routes.Blog.atom(),
`type` := "application/atom+xml",
rel := "alternate",
st.title := trans.blog.txt()
@ -278,7 +278,7 @@ object layout {
a(
cls := "link data-count link-center",
title := "Moderation",
href := routes.Report.list,
href := routes.Report.list(),
dataCount := blockingReportNbOpen,
dataIcon := ""
)
@ -287,7 +287,7 @@ object layout {
ctx.teamNbRequests > 0 option
a(
cls := "link data-count link-center",
href := routes.Team.requests,
href := routes.Team.requests(),
dataCount := ctx.teamNbRequests,
dataIcon := "f",
title := trans.team.teams.txt()

View File

@ -23,7 +23,7 @@ object notFound {
strong("Page not found!"),
p(
"Return to ",
a(href := routes.Lobby.home)("the homepage"),
a(href := routes.Lobby.home())("the homepage"),
span(cls := "or-play")(" or play this mini-game")
)
)

View File

@ -30,49 +30,49 @@ object topnav {
ctx.noBot option frag(
a(href := routes.Tournament.home())(trans.arena.arenaTournaments()),
a(href := routes.Swiss.home())(trans.swiss.swissTournaments()),
a(href := routes.Simul.home)(trans.simultaneousExhibitions())
a(href := routes.Simul.home())(trans.simultaneousExhibitions())
)
)
),
st.section(
linkTitle(routes.Puzzle.home.toString, trans.learnMenu()),
linkTitle(routes.Puzzle.home().toString, trans.learnMenu()),
div(role := "group")(
ctx.noBot option frag(
a(href := routes.Learn.index)(trans.chessBasics()),
a(href := routes.Puzzle.home)(trans.puzzles()),
a(href := routes.Practice.index)(trans.practice()),
a(href := routes.Coordinate.home)(trans.coordinates.coordinates())
a(href := routes.Learn.index())(trans.chessBasics()),
a(href := routes.Puzzle.home())(trans.puzzles()),
a(href := routes.Practice.index())(trans.practice()),
a(href := routes.Coordinate.home())(trans.coordinates.coordinates())
),
a(href := routes.Study.allDefault(1))(trans.studyMenu()),
ctx.noKid option a(href := routes.Coach.all(1))(trans.coaches()),
canSeeClasMenu option a(href := routes.Clas.index)(trans.clas.lichessClasses())
canSeeClasMenu option a(href := routes.Clas.index())(trans.clas.lichessClasses())
)
),
st.section(
linkTitle(routes.Tv.index.toString, trans.watch()),
linkTitle(routes.Tv.index().toString, trans.watch()),
div(role := "group")(
a(href := routes.Tv.index)("Lichess TV"),
a(href := routes.Tv.games)(trans.currentGames()),
a(href := routes.Tv.index())("Lichess TV"),
a(href := routes.Tv.games())(trans.currentGames()),
ctx.noKid option a(href := routes.Streamer.index())(trans.streamersMenu()),
a(href := routes.Relay.index())(trans.broadcast.broadcasts()),
ctx.noBot option a(href := routes.Video.index)(trans.videoLibrary())
ctx.noBot option a(href := routes.Video.index())(trans.videoLibrary())
)
),
st.section(
linkTitle(routes.User.list.toString, trans.community()),
linkTitle(routes.User.list().toString, trans.community()),
div(role := "group")(
a(href := routes.User.list)(trans.players()),
a(href := routes.User.list())(trans.players()),
a(href := routes.Team.home())(trans.team.teams()),
ctx.noKid option a(href := routes.ForumCateg.index)(trans.forum())
ctx.noKid option a(href := routes.ForumCateg.index())(trans.forum())
)
),
st.section(
linkTitle(routes.UserAnalysis.index.toString, trans.tools()),
linkTitle(routes.UserAnalysis.index().toString, trans.tools()),
div(role := "group")(
a(href := routes.UserAnalysis.index)(trans.analysis()),
a(href := s"${routes.UserAnalysis.index}#explorer")(trans.openingExplorer()),
a(href := routes.Editor.index)(trans.boardEditor()),
a(href := routes.Importer.importGame)(trans.importGame()),
a(href := routes.UserAnalysis.index())(trans.analysis()),
a(href := s"${routes.UserAnalysis.index()}#explorer")(trans.openingExplorer()),
a(href := routes.Editor.index())(trans.boardEditor()),
a(href := routes.Importer.importGame())(trans.importGame()),
a(href := routes.Search.index())(trans.search.advancedSearch())
)
)

View File

@ -27,7 +27,7 @@ object index {
div(cls := "blog index page-menu__content page-small box")(
div(cls := "box__top")(
h1("Lichess Official Blog"),
a(cls := "atom", href := routes.Blog.atom, dataIcon := "3")
a(cls := "atom", href := routes.Blog.atom(), dataIcon := "3")
),
primaryPost map { post =>
frag(

View File

@ -30,7 +30,7 @@ LichessEditor(document.getElementById('board-editor'), data);"""
openGraph = lila.app.ui
.OpenGraph(
title = "Chess board editor",
url = s"$netBaseUrl${routes.Editor.index.url}",
url = s"$netBaseUrl${routes.Editor.index().url}",
description = "Load opening positions or create your own chess position on a chess board editor"
)
.some

View File

@ -42,7 +42,7 @@ object userAnalysis {
openGraph = lila.app.ui
.OpenGraph(
title = "Chess analysis board",
url = s"$netBaseUrl${routes.UserAnalysis.index.url}",
url = s"$netBaseUrl${routes.UserAnalysis.index().url}",
description = "Analyse chess positions and variations on an interactive chess board"
)
.some,

View File

@ -64,7 +64,7 @@ object theirs {
"You must ",
a(
cls := "button",
href := s"${routes.Auth.login}?referrer=${routes.Round.watcher(c.id, "white")}"
href := s"${routes.Auth.login()}?referrer=${routes.Round.watcher(c.id, "white")}"
)(trans.signIn()),
" to join it."
)

View File

@ -21,7 +21,7 @@ object bits {
if (isGranted(_.Teacher))
main(cls := "page-menu")(
st.nav(cls := "page-menu__menu subnav")(
a(cls := active.toOption.map(_.active("classes")), href := routes.Clas.index)(
a(cls := active.toOption.map(_.active("classes")), href := routes.Clas.index())(
trans.clas.lichessClasses()
),
active.left.toOption.map { clas =>
@ -38,7 +38,7 @@ object bits {
}
)
} | {
a(cls := active.toOption.map(_.active("newClass")), href := routes.Clas.form)(
a(cls := active.toOption.map(_.active("newClass")), href := routes.Clas.form())(
trans.clas.newClass()
)
}

View File

@ -33,7 +33,7 @@ object clas {
)
),
div(cls := "clas-home__onboard")(
postForm(action := routes.Clas.becomeTeacher)(
postForm(action := routes.Clas.becomeTeacher())(
submitButton(cls := "button button-fat")(trans.clas.applyToBeLichessTeacher())
)
)
@ -46,7 +46,7 @@ object clas {
div(cls := "box__top")(
h1(trans.clas.lichessClasses()),
a(
href := routes.Clas.form,
href := routes.Clas.form(),
cls := "new button button-empty",
title := trans.clas.newClass.txt(),
dataIcon := "O"

View File

@ -1,7 +1,5 @@
package views.html.clas
import play.api.data.Form
import controllers.routes
import lila.api.Context
import lila.app.templating.Environment._

View File

@ -49,14 +49,14 @@ object edit {
if (c.coach.hasPicture)
a(
cls := "upload_picture",
href := routes.Coach.picture,
href := routes.Coach.picture(),
title := "Change/delete your profile picture"
)(
widget.pic(c, 250)
)
else
div(cls := "upload_picture")(
a(cls := "button", href := routes.Coach.picture)("Upload a profile picture")
a(cls := "button", href := routes.Coach.picture())("Upload a profile picture")
)
),
div(cls := "overview")(
@ -74,7 +74,7 @@ object edit {
)
)
),
postForm(cls := "box__pad form3 async", action := routes.Coach.edit)(
postForm(cls := "box__pad form3 async", action := routes.Coach.edit())(
div(cls := "tabs")(
div(dataTab := "basics", cls := "active")("Basics"),
div(dataTab := "texts")("Texts"),

View File

@ -38,7 +38,7 @@ object index {
p(
areYouCoach(a(href := "https://lichess.org/help/master")(nmOrFideTitle())),
br,
if (!ctx.me.exists(_.hasTitle)) a(href := routes.Main.verifyTitle)(confirmTitle())
if (!ctx.me.exists(_.hasTitle)) a(href := routes.Main.verifyTitle())(confirmTitle())
else sendApplication(contactEmailLink)
)
),

View File

@ -27,7 +27,7 @@ object picture {
error.map { e =>
p(cls := "error")(e)
},
postForm(action := routes.Coach.pictureApply, enctype := "multipart/form-data", cls := "upload")(
postForm(action := routes.Coach.pictureApply(), enctype := "multipart/form-data", cls := "upload")(
p("Max size: ", lila.db.Photographer.uploadMaxMb, "MB."),
form3.file.image("picture"),
form3.actions(
@ -36,7 +36,7 @@ object picture {
)
),
c.coach.hasPicture option
st.form(action := routes.Coach.pictureDelete, cls := "delete")(
st.form(action := routes.Coach.pictureDelete(), cls := "delete")(
submitButton(cls := "confirm button button-empty button-red")("Delete profile picture")
)
)

View File

@ -40,7 +40,7 @@ object review {
p(xWillApproveIt(c.user.realNameOrUsername))
)
else if (ctx.isAuth) a(cls := "button button-empty toggle")("Write a review")
else a(href := s"${routes.Auth.login}?referrer=${ctx.req.path}", cls := "button")(reviewCoach()),
else a(href := s"${routes.Auth.login()}?referrer=${ctx.req.path}", cls := "button")(reviewCoach()),
postForm(action := routes.Coach.review(c.user.username))(
barRating(selected = mine.map(_.score), enabled = true),
textarea(

View File

@ -61,7 +61,7 @@ $('.coach-review-form form').show();
frag(
if (c.coach.isListed) p("This page is now public.")
else "This page is not public yet. ",
a(href := routes.Coach.edit, cls := "text", dataIcon := "m")("Edit my coach profile")
a(href := routes.Coach.edit(), cls := "text", dataIcon := "m")("Edit my coach profile")
)
else
a(

View File

@ -23,7 +23,7 @@ object coordinate {
openGraph = lila.app.ui
.OpenGraph(
title = "Chess board coordinates trainer",
url = s"$netBaseUrl${routes.Coordinate.home.url}",
url = s"$netBaseUrl${routes.Coordinate.home().url}",
description =
"Knowing the chessboard coordinates is a very important chess skill. A square name appears on the board and you must click on the correct square."
)
@ -46,11 +46,11 @@ object coordinate {
div(cls := "register")(
p(trans.toTrackYourProgress()),
p(cls := "signup")(
a(cls := "button", href := routes.Auth.signup)(trans.signUp())
a(cls := "button", href := routes.Auth.signup())(trans.signUp())
)
)
),
form(cls := "color buttons", action := routes.Coordinate.color)(
form(cls := "color buttons", action := routes.Coordinate.color())(
st.group(cls := "radio")(
List(Color.BLACK, Color.RANDOM, Color.WHITE).map { id =>
div(

View File

@ -63,7 +63,7 @@ object dev {
"Only use if you know exactly what you're doing."
),
res map { pre(_) },
postForm(action := routes.Dev.cliPost)(
postForm(action := routes.Dev.cliPost())(
form3.input(form("command"))(autofocus)
),
h2("Command examples:"),

View File

@ -17,7 +17,7 @@ object event {
layout(title = "New event", css = "mod.form") {
div(cls := "crud page-menu__content box box-pad")(
h1("New event"),
postForm(cls := "content_box_content form3", action := routes.Event.create)(inForm(form))
postForm(cls := "content_box_content form3", action := routes.Event.create())(inForm(form))
)
}
@ -70,7 +70,7 @@ object event {
div(cls := "box__top")(
h1(title),
div(cls := "box__top__actions")(
a(cls := "button button-green", href := routes.Event.form, dataIcon := "O")
a(cls := "button button-green", href := routes.Event.form(), dataIcon := "O")
)
),
table(cls := "slist slist-pad")(

View File

@ -17,7 +17,7 @@ object categ {
openGraph = lila.app.ui
.OpenGraph(
title = "Lichess community forum",
url = s"$netBaseUrl${routes.ForumCateg.index.url}",
url = s"$netBaseUrl${routes.ForumCateg.index().url}",
description = "Chess discussions and feedback about Lichess development"
)
.some
@ -89,7 +89,7 @@ object categ {
main(cls := "forum forum-categ box")(
h1(
a(
href := categ.team.fold(routes.ForumCateg.index)(routes.Team.show(_)),
href := categ.team.fold(routes.ForumCateg.index())(routes.Team.show(_)),
dataIcon := "I",
cls := "text"
),

View File

@ -20,7 +20,7 @@ object search {
main(cls := "box box search")(
div(cls := "box__top")(
h1(
a(href := routes.ForumCateg.index, dataIcon := "I", cls := "text"),
a(href := routes.ForumCateg.index(), dataIcon := "I", cls := "text"),
title
),
bits.searchForm(text)

View File

@ -30,12 +30,12 @@ object topic {
h2(dataIcon := "!", cls := "text")(trans.important()),
p(
trans.yourQuestionMayHaveBeenAnswered(
strong(a(href := routes.Main.faq)(trans.inTheFAQ()))
strong(a(href := routes.Main.faq())(trans.inTheFAQ()))
)
),
p(
trans.toReportSomeoneForCheatingOrBadBehavior(
strong(a(href := routes.Report.form)(trans.useTheReportForm()))
strong(a(href := routes.Report.form())(trans.useTheReportForm()))
)
),
p(

View File

@ -65,7 +65,7 @@ object bits {
href := (variant match {
case chess.variant.Standard => "https://en.wikipedia.org/wiki/Chess"
case chess.variant.FromPosition =>
s"""${routes.Editor.index}?fen=${initialFen.??(_.value.replace(' ', '_'))}"""
s"""${routes.Editor.index()}?fen=${initialFen.??(_.value.replace(' ', '_'))}"""
case v => routes.Page.variant(v.key).url
}),
rel := "nofollow",

View File

@ -10,7 +10,7 @@ import controllers.routes
object importGame {
private def analyseHelp(implicit ctx: Context) =
ctx.isAnon option a(cls := "blue", href := routes.Auth.signup)(trans.youNeedAnAccountToDoThat())
ctx.isAnon option a(cls := "blue", href := routes.Auth.signup())(trans.youNeedAnAccountToDoThat())
def apply(form: play.api.data.Form[_])(implicit ctx: Context) =
views.html.base.layout(
@ -20,7 +20,7 @@ object importGame {
openGraph = lila.app.ui
.OpenGraph(
title = "Paste PGN chess game",
url = s"$netBaseUrl${routes.Importer.importGame.url}",
url = s"$netBaseUrl${routes.Importer.importGame().url}",
description = trans.importGameExplanation.txt()
)
.some

View File

@ -45,7 +45,7 @@ object side {
views.html.bookmark.toggle(game, bookmarked),
if (game.imported)
div(
a(href := routes.Importer.importGame, title := trans.importGame.txt())("IMPORT"),
a(href := routes.Importer.importGame(), title := trans.importGame.txt())("IMPORT"),
separator,
if (game.variant.exotic)
bits.variantLink(

View File

@ -76,7 +76,7 @@ object irwin {
def report(report: lila.irwin.IrwinReport.WithPovs)(implicit ctx: Context): Frag =
div(id := "mz_irwin", cls := "mz-section")(
header(
a(cls := "title", href := routes.Irwin.dashboard)(
a(cls := "title", href := routes.Irwin.dashboard())(
img(src := staticUrl("images/icons/brain.blue.svg")),
" Irwin AI",
br,

View File

@ -31,7 +31,7 @@ LichessLearn(document.getElementById('learn-app'), ${safeJsonValue(
.OpenGraph(
title = "Learn chess by playing",
description = "You don't know much about chess? Excellent! Let's have fun and learn to play chess!",
url = s"$netBaseUrl${routes.Learn.index}"
url = s"$netBaseUrl${routes.Learn.index()}"
)
.some,
zoomable = true

View File

@ -23,7 +23,7 @@ object bits {
div(cls := "lobby__leaderboard lobby__box")(
div(cls := "lobby__box__top")(
h2(cls := "title text", dataIcon := "C")(trans.leaderboard()),
a(cls := "more", href := routes.User.list)(trans.more(), " »")
a(cls := "more", href := routes.User.list())(trans.more(), " »")
),
div(cls := "lobby__box__content")(
table(
@ -44,7 +44,7 @@ object bits {
div(cls := "lobby__winners lobby__box")(
div(cls := "lobby__box__top")(
h2(cls := "title text", dataIcon := "g")(trans.tournamentWinners()),
a(cls := "more", href := routes.Tournament.leaderboard)(trans.more(), " »")
a(cls := "more", href := routes.Tournament.leaderboard())(trans.more(), " »")
),
div(cls := "lobby__box__content")(
table(

View File

@ -60,7 +60,7 @@ object home {
div(cls := "lobby__start")(
ctx.blind option h2("Play"),
a(
href := routes.Setup.hookForm,
href := routes.Setup.hookForm(),
cls := List(
"button button-metal config_hook" -> true,
"disabled" -> (playban.isDefined || currentGame.isDefined || ctx.isBot)
@ -76,7 +76,7 @@ object home {
trans.playWithAFriend()
),
a(
href := routes.Setup.aiForm,
href := routes.Setup.aiForm(),
cls := List(
"button button-metal config_ai" -> true,
"disabled" -> currentGame.isDefined
@ -86,10 +86,10 @@ object home {
),
div(cls := "lobby__counters")(
ctx.blind option h2("Counters"),
a(id := "nb_connected_players", href := ctx.noBlind.option(routes.User.list.toString))(
a(id := "nb_connected_players", href := ctx.noBlind.option(routes.User.list().toString))(
trans.nbPlayers(nbPlaceholder)
),
a(id := "nb_games_in_play", href := ctx.noBlind.option(routes.Tv.games.toString))(
a(id := "nb_games_in_play", href := ctx.noBlind.option(routes.Tv.games().toString))(
trans.nbGamesInPlay(nbPlaceholder)
)
)
@ -121,14 +121,14 @@ object home {
div(cls := "timeline")(
ctx.blind option h2("Timeline"),
views.html.timeline entries userTimeline,
userTimeline.nonEmpty option a(cls := "more", href := routes.Timeline.home)(trans.more(), " »")
userTimeline.nonEmpty option a(cls := "more", href := routes.Timeline.home())(trans.more(), " »")
)
else
div(cls := "about-side")(
ctx.blind option h2("About"),
trans.xIsAFreeYLibreOpenSourceChessServer(
"Lichess",
a(cls := "blue", href := routes.Plan.features)(trans.really.txt())
a(cls := "blue", href := routes.Plan.features())(trans.really.txt())
),
" ",
a(href := "/about")(trans.aboutX("Lichess"), "...")
@ -152,7 +152,7 @@ object home {
},
ctx.noBot option bits.underboards(tours, simuls, leaderboard, tournamentWinners),
ctx.noKid option div(cls := "lobby__forum lobby__box")(
a(cls := "lobby__box__top", href := routes.ForumCateg.index)(
a(cls := "lobby__box__top", href := routes.ForumCateg.index())(
h2(cls := "title text", dataIcon := "d")(trans.latestForumPosts()),
span(cls := "more")(trans.more(), " »")
),
@ -162,7 +162,7 @@ object home {
),
bits.lastPosts(lastPost),
div(cls := "lobby__support")(
a(href := routes.Plan.index)(
a(href := routes.Plan.index())(
iconTag(patronIconChar),
span(cls := "lobby__support__text")(
strong(trans.patron.donate()),
@ -183,10 +183,10 @@ object home {
a(href := "/faq")(trans.faq.faqAbbreviation()),
a(href := "/contact")(trans.contact.contact()),
a(href := "/mobile")(trans.mobileApp()),
a(href := routes.Page.tos)(trans.termsOfService()),
a(href := routes.Page.privacy)(trans.privacy()),
a(href := routes.Page.source)(trans.sourceCode()),
a(href := routes.Page.ads)("Ads"),
a(href := routes.Page.tos())(trans.termsOfService()),
a(href := routes.Page.privacy())(trans.privacy()),
a(href := routes.Page.source())(trans.sourceCode()),
a(href := routes.Page.ads())("Ads"),
views.html.base.bits.connectLinks
)
)

View File

@ -36,17 +36,17 @@ object chatPanic {
div(cls := "forms")(
if (state.isDefined)
frag(
postForm(action := s"${routes.Mod.chatPanicPost}?v=0")(
postForm(action := s"${routes.Mod.chatPanicPost()}?v=0")(
submitButton(cls := "button button-fat button-red text", dataIcon := "L")("Disable")
),
postForm(action := s"${routes.Mod.chatPanicPost}?v=1")(
postForm(action := s"${routes.Mod.chatPanicPost()}?v=1")(
submitButton(cls := "button button-fat button-green text", dataIcon := "E")(
"Renew for two hours"
)
)
)
else
postForm(action := s"${routes.Mod.chatPanicPost}?v=1")(
postForm(action := s"${routes.Mod.chatPanicPost()}?v=1")(
submitButton(cls := "button button-fat text", dataIcon := "E")("Enable")
)
)

View File

@ -30,7 +30,7 @@ this.setSelectionRange(this.value.length, this.value.length);
"If you provide an email and a username, it will set the email to that user, ",
"but only if the user has not yet confirmed their email."
),
st.form(cls := "search", action := routes.Mod.emailConfirm, method := "GET")(
st.form(cls := "search", action := routes.Mod.emailConfirm(), method := "GET")(
input(name := "q", placeholder := "<email> <username (optional)>", value := query, autofocus)
),
user.map { u =>

View File

@ -73,7 +73,7 @@ object gamify {
views.html.mod.menu("gamify"),
div(id := "mod-gamify", cls := "page-menu__content box")(
h1(
a(href := routes.Mod.gamify, dataIcon := "I"),
a(href := routes.Mod.gamify(), dataIcon := "I"),
title
),
div(cls := "period")(

View File

@ -11,35 +11,35 @@ object menu {
def apply(active: String)(implicit ctx: Context) =
st.nav(cls := "page-menu__menu subnav")(
isGranted(_.SeeReport) option
a(cls := active.active("report"), href := routes.Report.list)("Reports"),
a(cls := active.active("report"), href := routes.Report.list())("Reports"),
isGranted(_.ChatTimeout) option
a(cls := active.active("public-chat"), href := routes.Mod.publicChat)("Public Chats"),
a(cls := active.active("public-chat"), href := routes.Mod.publicChat())("Public Chats"),
isGranted(_.SeeReport) option
a(cls := active.active("gamify"), href := routes.Mod.gamify)("Hall of fame"),
a(cls := active.active("gamify"), href := routes.Mod.gamify())("Hall of fame"),
isGranted(_.UserSearch) option
a(cls := active.active("search"), href := routes.Mod.search)("Search users"),
a(cls := active.active("search"), href := routes.Mod.search())("Search users"),
isGranted(_.SetEmail) option
a(cls := active.active("email"), href := routes.Mod.emailConfirm)("Email confirm"),
a(cls := active.active("email"), href := routes.Mod.emailConfirm())("Email confirm"),
isGranted(_.PracticeConfig) option
a(cls := active.active("practice"), href := routes.Practice.config)("Practice"),
a(cls := active.active("practice"), href := routes.Practice.config())("Practice"),
isGranted(_.ManageTournament) option
a(cls := active.active("tour"), href := routes.TournamentCrud.index(1))("Tournaments"),
isGranted(_.ManageEvent) option
a(cls := active.active("event"), href := routes.Event.manager)("Events"),
a(cls := active.active("event"), href := routes.Event.manager())("Events"),
isGranted(_.SeeReport) option
a(cls := active.active("log"), href := routes.Mod.log)("Mod log"),
a(cls := active.active("log"), href := routes.Mod.log())("Mod log"),
isGranted(_.SeeReport) option
a(cls := active.active("irwin"), href := routes.Irwin.dashboard)("Irwin dashboard"),
a(cls := active.active("irwin"), href := routes.Irwin.dashboard())("Irwin dashboard"),
isGranted(_.Shadowban) option
a(cls := active.active("panic"), href := routes.Mod.chatPanic)(
a(cls := active.active("panic"), href := routes.Mod.chatPanic())(
"Chat Panic: ",
strong(if (isChatPanicEnabled) "ON" else "OFF")
),
isGranted(_.Admin) option
a(cls := active.active("mods"), href := routes.Mod.table)("Mods"),
a(cls := active.active("mods"), href := routes.Mod.table())("Mods"),
isGranted(_.Settings) option
a(cls := active.active("setting"), href := routes.Dev.settings)("Settings"),
a(cls := active.active("setting"), href := routes.Dev.settings())("Settings"),
isGranted(_.Cli) option
a(cls := active.active("cli"), href := routes.Dev.cli)("CLI")
a(cls := active.active("cli"), href := routes.Dev.cli())("CLI")
)
}

View File

@ -24,7 +24,7 @@ object search {
views.html.mod.menu("search"),
div(cls := "mod-search page-menu__content box")(
h1("Search users"),
st.form(cls := "search box__pad", action := routes.Mod.search, method := "GET")(
st.form(cls := "search box__pad", action := routes.Mod.search(), method := "GET")(
input(
name := "q",
autofocus,

View File

@ -15,7 +15,7 @@ object form {
views.html.account.layout(title = title, active = "oauth.app") {
div(cls := "account oauth box box-pad")(
h1(title),
postForm(cls := "form3", action := routes.OAuthApp.create)(
postForm(cls := "form3", action := routes.OAuthApp.create())(
div(cls := "form-group")(
"Want to build something that integrates with and extends Lichess? Register a new OAuth App to get started developing on the Lichess API."
),
@ -46,7 +46,7 @@ object form {
"Lichess OAuth app example"
),
", and the ",
a(href := routes.Api.index)("API documentation"),
a(href := routes.Api.index())("API documentation"),
"."
),
inner(form)
@ -70,7 +70,7 @@ object form {
)(form3.input(_, typ = "url"))
),
form3.actions(
a(href := routes.OAuthApp.index)("Cancel"),
a(href := routes.OAuthApp.index())("Cancel"),
form3.submit(trans.apply())
)
)

View File

@ -50,7 +50,7 @@ object index {
h1(id := "made")("My OAuth Apps"),
p(cls := "box__pad")(
"Want to build something that integrates with and extends Lichess? ",
a(href := routes.OAuthApp.create)("Register a new OAuth App"),
a(href := routes.OAuthApp.create())("Register a new OAuth App"),
" to get started developing with the Lichess API.",
br,
br,
@ -59,7 +59,7 @@ object index {
"Lichess OAuth app example"
),
", and the ",
a(href := routes.Api.index)("API documentation"),
a(href := routes.Api.index())("API documentation"),
"."
),
table(cls := "slist slist-pad")(

View File

@ -17,7 +17,7 @@ object create {
views.html.account.layout(title = title, active = "oauth.token")(
div(cls := "account oauth box box-pad")(
h1(title),
postForm(cls := "form3", action := routes.OAuthToken.create)(
postForm(cls := "form3", action := routes.OAuthToken.create())(
div(cls := "form-group")(
"Personal access tokens function like ordinary Lichess OAuth access tokens. ",
"They can be used to authenticate to the API over Basic Authentication."
@ -53,7 +53,7 @@ object create {
}
),
form3.actions(
a(href := routes.OAuthToken.index)("Cancel"),
a(href := routes.OAuthToken.index())("Cancel"),
form3.submit(trans.apply())
)
)

View File

@ -16,7 +16,7 @@ object index {
div(cls := "account oauth box")(
div(cls := "box__top")(
h1(title),
st.form(cls := "box-top__actions", action := routes.OAuthToken.create)(
st.form(cls := "box-top__actions", action := routes.OAuthToken.create())(
submitButton(cls := "button frameless", st.title := "New access token", dataIcon := "O")
)
),
@ -26,7 +26,7 @@ object index {
br,
br,
"Instead, ",
a(href := routes.OAuthToken.create)("generate a personal token"),
a(href := routes.OAuthToken.create())("generate a personal token"),
" that you can directly use in API requests.",
br,
br,
@ -40,7 +40,7 @@ object index {
"personal token app example"
),
" and the ",
a(href := routes.Api.index)("API documentation"),
a(href := routes.Api.index())("API documentation"),
"."
),
tokens.headOption.filter(_.isBrandNew).map { token =>

View File

@ -18,7 +18,7 @@ object features {
openGraph = lila.app.ui
.OpenGraph(
title = title,
url = s"$netBaseUrl${routes.Plan.features.url}",
url = s"$netBaseUrl${routes.Plan.features().url}",
description = "All of Lichess features are free for all and forever. We do it for the chess!"
)
.some
@ -29,18 +29,18 @@ object features {
tbody(
tr(unlimited)(
"Play and create ",
a(href := routes.Tournament.home)("tournaments")
a(href := routes.Tournament.home())("tournaments")
),
tr(unlimited)(
"Play and create ",
a(href := routes.Simul.home)("simultaneous exhibitions")
a(href := routes.Simul.home())("simultaneous exhibitions")
),
tr(unlimited)(
"Correspondence chess with conditional premoves"
),
tr(check)(
"Standard chess and ",
a(href := routes.Page.variantHome)("8 chess variants (Crazyhouse, Chess960, Horde, ...)")
a(href := routes.Page.variantHome())("8 chess variants (Crazyhouse, Chess960, Horde, ...)")
),
tr(custom("30 per day"))(
s"Deep $engineName server analysis"
@ -69,10 +69,10 @@ object features {
)
),
tr(check)(
a(href := routes.Learn.index)("All chess basics lessons")
a(href := routes.Learn.index())("All chess basics lessons")
),
tr(unlimited)(
a(href := routes.Puzzle.home)("Tactical puzzles from user games")
a(href := routes.Puzzle.home())("Tactical puzzles from user games")
),
tr(unlimited)(
a(href := s"${routes.UserAnalysis.index()}#explorer")("Opening explorer"),
@ -91,7 +91,7 @@ object features {
" through Lichess 1.5 billion games"
),
tr(unlimited)(
a(href := routes.Video.index)("Chess video library")
a(href := routes.Video.index())("Chess video library")
),
tr(check)(
"Forum, teams, messaging, friends, challenges"
@ -122,13 +122,13 @@ object features {
"Bullet, Blitz, Rapid, Classical and Correspondence chess"
),
tr(unlimited)(
a(href := routes.Tournament.home)("Arena tournaments")
a(href := routes.Tournament.home())("Arena tournaments")
),
tr(check)(
s"Board editor and analysis board with $engineName"
),
tr(unlimited)(
a(href := routes.Puzzle.home)("Tactics puzzles")
a(href := routes.Puzzle.home())("Tactics puzzles")
),
tr(check)(
"Available in 80+ languages"
@ -160,7 +160,7 @@ object features {
st.tr(cls := "price")(
th,
td(cls := "green")("$0"),
td(a(href := routes.Plan.index, cls := "green button")("$5/month"))
td(a(href := routes.Plan.index(), cls := "green button")("$5/month"))
)
)
),
@ -175,7 +175,7 @@ object features {
strong("all features are free for everybody, forever!"),
br,
"If you love Lichess, ",
a(cls := "button", href := routes.Plan.index)("Support us with a Patron account!")
a(cls := "button", href := routes.Plan.index())("Support us with a Patron account!")
)
)
}

View File

@ -31,7 +31,7 @@ object index {
openGraph = lila.app.ui
.OpenGraph(
title = becomePatron.txt(),
url = s"$netBaseUrl${routes.Plan.index.url}",
url = s"$netBaseUrl${routes.Plan.index().url}",
description = freeChess.txt()
)
.some,
@ -210,7 +210,7 @@ object index {
if (ctx.isAuth)
button(cls := "stripe button")(withCreditCard())
else
a(cls := "stripe button", href := routes.Auth.login)(withCreditCard()),
a(cls := "stripe button", href := routes.Auth.login())(withCreditCard()),
button(cls := "paypal button")(withPaypal())
)
)
@ -254,7 +254,7 @@ object index {
dl(
dt(changeMonthlySupport()),
dd(
changeOrContact(a(href := routes.Main.contact, target := "_blank")(contactSupport()))
changeOrContact(a(href := routes.Main.contact(), target := "_blank")(contactSupport()))
),
dt(otherMethods()),
dd(
@ -269,7 +269,7 @@ object index {
dd(
noPatronFeatures(),
br,
a(href := routes.Plan.features, target := "_blank")(featuresComparison()),
a(href := routes.Plan.features(), target := "_blank")(featuresComparison()),
"."
)
)

View File

@ -56,7 +56,7 @@ object indexStripe {
),
a(dataForm := "cancel")(cancelSupport())
),
postForm(cls := "switch", action := routes.Plan.switch)(
postForm(cls := "switch", action := routes.Plan.switch())(
p(decideHowMuch()),
"USD $ ",
input(
@ -70,7 +70,7 @@ object indexStripe {
submitButton(cls := "button")(trans.apply()),
a(dataForm := "switch")(trans.cancel())
),
postForm(cls := "cancel", action := routes.Plan.cancel)(
postForm(cls := "cancel", action := routes.Plan.cancel())(
p(stopPayments()),
submitButton(cls := "button button-red")(noLongerSupport()),
a(dataForm := "cancel")(trans.cancel())
@ -104,7 +104,7 @@ object indexStripe {
),
tr(
th,
td(a(href := routes.Plan.list)(viewOthers()))
td(a(href := routes.Plan.list())(viewOthers()))
)
)
)

View File

@ -20,7 +20,7 @@ object config {
div(cls := "practice_config page-menu__content box box-pad")(
h1("Practice config"),
div(cls := "both")(
postForm(action := routes.Practice.configSave)(
postForm(action := routes.Practice.configSave())(
textarea(cls := "practice_text", name := "text")(form("text").value),
errMsg(form("text")),
submitButton(cls := "button button-fat text", dataIcon := "E")("Save")

View File

@ -20,7 +20,7 @@ if (confirm('You will lose your practice progress!')) this.parentNode.submit();
.OpenGraph(
title = "Practice your chess",
description = "Learn how to master the most common chess positions",
url = s"$netBaseUrl${routes.Practice.index}"
url = s"$netBaseUrl${routes.Practice.index()}"
)
.some
) {
@ -33,9 +33,9 @@ if (confirm('You will lose your practice progress!')) this.parentNode.submit();
div(cls := "text")("Progress: ", data.progressPercent, "%"),
div(cls := "bar", style := s"width: ${data.progressPercent}%")
),
postForm(action := routes.Practice.reset)(
postForm(action := routes.Practice.reset())(
if (ctx.isAuth) (data.nbDoneChapters > 0) option a(cls := "do-reset")("Reset my progress")
else a(href := routes.Auth.signup)("Sign up to save your progress")
else a(href := routes.Auth.signup())("Sign up to save your progress")
)
),
div(cls := "page-menu__content practice-app")(

View File

@ -26,7 +26,7 @@ object embed {
),
body(
cls := s"base ${config.board}",
dataStreamUrl := routes.Tv.feed
dataStreamUrl := routes.Tv.feed()
)(
div(id := "daily-puzzle", cls := "embedded", title := trans.clickToSolve.txt())(
raw(daily.html),

View File

@ -71,7 +71,7 @@ object actions {
} getOrElse {
signup option frag(
trans.youNeedAnAccountToDoThat(),
a(href := routes.Auth.login, cls := "signup")(trans.signUp())
a(href := routes.Auth.login(), cls := "signup")(trans.signUp())
)
}
)

View File

@ -17,7 +17,7 @@ object form {
def create(form: Form[Data])(implicit ctx: Context) =
layout(newBroadcast.txt())(
h1(newBroadcast()),
inner(form, routes.Relay.create)
inner(form, routes.Relay.create())
)
def edit(r: lila.relay.Relay, form: Form[Data])(implicit ctx: Context) =

View File

@ -36,7 +36,7 @@ object index {
div(cls := "box__top")(
h1(liveBroadcasts()),
a(
href := routes.Relay.form,
href := routes.Relay.form(),
cls := "new button button-empty",
title := newBroadcast.txt(),
dataIcon := "O"

View File

@ -51,7 +51,7 @@ object form {
}
def flag(username: String, resource: String, text: String) =
postForm(action := routes.Report.flag, cls := "comm-flag")(
postForm(action := routes.Report.flag(), cls := "comm-flag")(
form3.hidden("username", username),
form3.hidden("resource", resource),
form3.hidden("text", text take 140),

View File

@ -1,5 +1,7 @@
package views.html.report
import scala.annotation.nowarn
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
@ -12,6 +14,7 @@ object thanks {
val title = "Thanks for the report"
@nowarn("msg=possible missing interpolator")
val moreJs = embedJsUnsafe("""
$('button.report-block').one('click', function() {
var $button = $(this);
@ -45,7 +48,7 @@ $button.find('span').text('Blocked!');
br,
br,
p(
a(href := routes.Lobby.home)("Return to Lichess homepage")
a(href := routes.Lobby.home())("Return to Lichess homepage")
)
)

View File

@ -15,7 +15,7 @@ private object bits {
def fenInput(field: Field, strict: Boolean, validFen: Option[lila.setup.ValidFen])(implicit
ctx: Context
) = {
val url = field.value.fold(routes.Editor.index)(routes.Editor.load).url
val url = field.value.fold(routes.Editor.index())(routes.Editor.load).url
div(cls := "fen_position optional_config")(
frag(
div(

View File

@ -7,8 +7,6 @@ import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.rating.RatingRange
import controllers.routes
object filter {
import bits._
@ -92,7 +90,7 @@ object filter {
value: String,
content: Frag,
hint: Option[String],
checks: Set[String] = Set.empty
checks: Set[String]
) =
label(title := hint)(
input(

View File

@ -48,7 +48,7 @@ object forms {
def ai(form: Form[_], ratings: Map[Int, Int], validFen: Option[lila.setup.ValidFen])(implicit
ctx: Context
) =
layout("ai", trans.playWithTheMachine(), routes.Setup.ai) {
layout("ai", trans.playWithTheMachine(), routes.Setup.ai()) {
frag(
renderVariant(form, translatedAiVariantChoices),
fenInput(form("fen"), true, validFen),
@ -123,7 +123,7 @@ object forms {
frag(
p(cls := "error")(e),
br,
a(href := routes.Lobby.home, cls := "button text", dataIcon := "L")(trans.cancel.txt())
a(href := routes.Lobby.home(), cls := "button text", dataIcon := "L")(trans.cancel.txt())
)
}
.getOrElse {

View File

@ -27,7 +27,7 @@ object home {
openGraph = lila.app.ui
.OpenGraph(
title = trans.simultaneousExhibitions.txt(),
url = s"$netBaseUrl${routes.Simul.home}",
url = s"$netBaseUrl${routes.Simul.home()}",
description = trans.aboutSimul.txt()
)
.some

View File

@ -22,7 +22,7 @@ object contact {
s"$prefix-reopen",
wantReopen(),
frag(
p(a(href := routes.Account.reopen)(reopenOnThisPage())),
p(a(href := routes.Account.reopen())(reopenOnThisPage())),
p(doNotAskByEmailToReopen())
)
)
@ -59,7 +59,7 @@ object contact {
"email-confirm",
noConfirmationEmail(),
p(
a(href := routes.Account.emailConfirmHelp)(visitThisPage()),
a(href := routes.Account.emailConfirmHelp())(visitThisPage()),
"."
)
),
@ -67,7 +67,7 @@ object contact {
"forgot-password",
forgotPassword(),
p(
a(href := routes.Auth.passwordReset)(visitThisPage()),
a(href := routes.Auth.passwordReset())(visitThisPage()),
"."
)
),
@ -75,14 +75,14 @@ object contact {
"forgot-username",
forgotUsername(),
p(
a(href := routes.Auth.login)(youCanLoginWithEmail()),
a(href := routes.Auth.login())(youCanLoginWithEmail()),
"."
)
),
Leaf(
"lost-2fa",
lost2FA(),
p(a(href := routes.Auth.passwordReset)(doPasswordReset()), ".")
p(a(href := routes.Auth.passwordReset())(doPasswordReset()), ".")
),
reopenLeaf("login"),
Leaf(
@ -115,7 +115,7 @@ object contact {
"title",
wantTitle(),
p(
a(href := routes.Page.master)(visitTitleConfirmation()),
a(href := routes.Page.master())(visitTitleConfirmation()),
"."
)
),
@ -123,7 +123,7 @@ object contact {
"close",
wantCloseAccount(),
frag(
p(a(href := routes.Account.close)(closeYourAccount()), "."),
p(a(href := routes.Account.close())(closeYourAccount()), "."),
p(doNotAskByEmail())
)
),
@ -132,7 +132,7 @@ object contact {
"change-username",
wantChangeUsername(),
frag(
p(a(href := routes.Account.username)(changeUsernameCase()), "."),
p(a(href := routes.Account.username())(changeUsernameCase()), "."),
p(cantChangeMore()),
p(orCloseAccount())
)
@ -163,7 +163,7 @@ object contact {
frag("Report a player for ", name),
frag(
p(
a(href := routes.Report.form)(toReportAPlayer(name)),
a(href := routes.Report.form())(toReportAPlayer(name)),
"."
),
p(
@ -340,7 +340,7 @@ object contact {
p("If you are a European citizen, you may request the deletion of your Lichess account."),
p(
"First, ",
a(href := routes.Account.close)("close your account"),
a(href := routes.Account.close())("close your account"),
"."
),
p(

View File

@ -33,7 +33,7 @@ object dailyPuzzleSlackApp {
h2("Summary"),
p(
"By default, the app will post the ",
a(href := routes.Puzzle.daily)("daily chess puzzle"),
a(href := routes.Puzzle.daily())("daily chess puzzle"),
" from Lichess to the channel in which it was installed every day (at the same time of day it was installed). Use the ",
code("/puzzletime"),
" command to change this setting, e.g. ",

View File

@ -201,23 +201,23 @@ $('#asset-version-message').text(lichess.info.message);"""
def activeCls(c: String) = cls := active.activeO(c)
main(cls := "page-menu")(
st.nav(cls := "page-menu__menu subnav")(
a(activeCls("about"), href := routes.Page.about)(trans.aboutX("lichess.org")),
a(activeCls("faq"), href := routes.Main.faq)(trans.faq.faqAbbreviation()),
a(activeCls("contact"), href := routes.Main.contact)(trans.contact.contact()),
a(activeCls("tos"), href := routes.Page.tos)(trans.termsOfService()),
a(activeCls("privacy"), href := routes.Page.privacy)(trans.privacy()),
a(activeCls("master"), href := routes.Page.master)("Title verification"),
a(activeCls("about"), href := routes.Page.about())(trans.aboutX("lichess.org")),
a(activeCls("faq"), href := routes.Main.faq())(trans.faq.faqAbbreviation()),
a(activeCls("contact"), href := routes.Main.contact())(trans.contact.contact()),
a(activeCls("tos"), href := routes.Page.tos())(trans.termsOfService()),
a(activeCls("privacy"), href := routes.Page.privacy())(trans.privacy()),
a(activeCls("master"), href := routes.Page.master())("Title verification"),
sep,
a(activeCls("source"), href := routes.Page.source)(trans.sourceCode()),
a(activeCls("help"), href := routes.Page.help)(trans.contribute()),
a(activeCls("thanks"), href := routes.Page.thanks)(trans.thankYou()),
a(activeCls("source"), href := routes.Page.source())(trans.sourceCode()),
a(activeCls("help"), href := routes.Page.help())(trans.contribute()),
a(activeCls("thanks"), href := routes.Page.thanks())(trans.thankYou()),
sep,
a(activeCls("webmasters"), href := routes.Main.webmasters)(trans.webmasters()),
a(activeCls("webmasters"), href := routes.Main.webmasters())(trans.webmasters()),
a(activeCls("database"), href := "https://database.lichess.org")(trans.database(), external),
a(activeCls("api"), href := routes.Api.index)("API", external),
a(activeCls("api"), href := routes.Api.index())("API", external),
sep,
a(activeCls("lag"), href := routes.Main.lag)(trans.lag.isLichessLagging()),
a(activeCls("ads"), href := routes.Page.ads)("Block ads")
a(activeCls("lag"), href := routes.Main.lag())(trans.lag.isLichessLagging()),
a(activeCls("ads"), href := routes.Page.ads())("Block ads")
),
div(cls := s"page-menu__content $contentCls")(body)
)

View File

@ -70,7 +70,7 @@ object message {
def challengeDenied(msg: String)(implicit ctx: Context) =
apply(
title = trans.challengeToPlay.txt(),
back = routes.Lobby.home.url.some
back = routes.Lobby.home().url.some
)(msg)
def insightNoGames(u: User)(implicit ctx: Context) =

View File

@ -18,7 +18,7 @@ object bits extends Context.ToLang {
icon = Some(""),
moreCss = cssTag("streamer.form").some
)(
postForm(cls := "streamer-new", action := routes.Streamer.create)(
postForm(cls := "streamer-new", action := routes.Streamer.create())(
h2(doYouHaveStream()),
br,
br,
@ -60,11 +60,11 @@ object bits extends Context.ToLang {
st.streamer.name
),
(ctx.is(st.user) || isGranted(_.Streamers)) option
a(cls := active.active("edit"), href := s"${routes.Streamer.edit}?u=${st.streamer.id.value}")(
a(cls := active.active("edit"), href := s"${routes.Streamer.edit()}?u=${st.streamer.id.value}")(
editPage()
)
)
} getOrElse a(href := routes.Streamer.edit)(yourPage()),
} getOrElse a(href := routes.Streamer.edit())(yourPage()),
isGranted(_.Streamers) option a(
cls := active.active("requests"),
href := s"${routes.Streamer.index()}?requests=1"

View File

@ -30,13 +30,13 @@ object edit extends Context.ToLang {
if (ctx.is(s.user))
div(cls := "streamer-header")(
if (s.streamer.hasPicture)
a(target := "_blank", href := routes.Streamer.picture, title := changePicture.txt())(
a(target := "_blank", href := routes.Streamer.picture(), title := changePicture.txt())(
bits.pic(s.streamer, s.user)
)
else
div(cls := "picture-create")(
ctx.is(s.user) option
a(target := "_blank", cls := "button", href := routes.Streamer.picture)(
a(target := "_blank", cls := "button", href := routes.Streamer.picture())(
uploadPicture()
)
),
@ -72,7 +72,7 @@ object edit extends Context.ToLang {
frag(
if (s.streamer.completeEnough)
whenReady(
postForm(action := routes.Streamer.approvalRequest)(
postForm(action := routes.Streamer.approvalRequest())(
button(tpe := "submit", cls := "button", (!ctx.is(s.user)) option disabled)(
requestReview()
)
@ -126,7 +126,7 @@ object edit extends Context.ToLang {
},
postForm(
cls := "form3",
action := s"${routes.Streamer.edit}${!ctx.is(s.user) ?? s"?u=${s.user.id}"}"
action := s"${routes.Streamer.edit()}${!ctx.is(s.user) ?? s"?u=${s.user.id}"}"
)(
isGranted(_.Streamers) option div(cls := "mod")(
form3.split(

View File

@ -25,7 +25,7 @@ object index {
a(
cls := "overlay",
href := {
if (requests) s"${routes.Streamer.edit}?u=${s.user.username}"
if (requests) s"${routes.Streamer.edit()}?u=${s.user.username}"
else routes.Streamer.show(s.user.username).url
}
),

View File

@ -21,7 +21,7 @@ object picture {
div(cls := "forms")(
error.map { badTag(_) },
postForm(
action := routes.Streamer.pictureApply,
action := routes.Streamer.pictureApply(),
enctype := "multipart/form-data",
cls := "upload"
)(
@ -30,11 +30,11 @@ object picture {
submitButton(cls := "button")(uploadPicture())
),
s.streamer.hasPicture option
postForm(action := routes.Streamer.pictureDelete, cls := "delete")(
postForm(action := routes.Streamer.pictureDelete(), cls := "delete")(
submitButton(cls := "button button-red")(deletePicture())
),
div(cls := "cancel")(
a(href := routes.Streamer.edit, cls := "text", dataIcon := "I")(trans.cancel())
a(href := routes.Streamer.edit(), cls := "text", dataIcon := "I")(trans.cancel())
)
)
)

View File

@ -28,7 +28,7 @@ object bits {
}
def newForm()(implicit ctx: Context) =
postForm(cls := "new-study", action := routes.Study.create)(
postForm(cls := "new-study", action := routes.Study.create())(
submitButton(cls := "button button-green", dataIcon := "O", title := trans.study.createStudy.txt())
)

View File

@ -24,7 +24,7 @@ object create {
moreCss = cssTag("study.create").some
) {
div(cls := "study-create")(
postForm(action := routes.Study.create)(
postForm(action := routes.Study.create())(
input(tpe := "hidden", name := "gameId", value := data.gameId),
input(tpe := "hidden", name := "orientation", value := data.orientationStr),
input(tpe := "hidden", name := "fen", value := data.fenStr),

View File

@ -134,7 +134,7 @@ object list {
st.aside(cls := "page-menu__menu subnav")(
a(cls := active.active("all"), href := routes.Study.all(nonMineOrder.key))(trans.study.allStudies()),
ctx.isAuth option bits.authLinks(active, nonMineOrder),
a(cls := List("active" -> active.startsWith("topic")), href := routes.Study.topics)("Topics"),
a(cls := List("active" -> active.startsWith("topic")), href := routes.Study.topics())("Topics"),
topics.map { topic =>
a(cls := active.active(s"topic:$topic"), href := routes.Study.byTopic(topic.value, order.key))(
topic.value

View File

@ -35,7 +35,7 @@ object side {
span(cls := "swiss__meta__round")(s"${s.round}/${s.settings.nbRounds}"),
" rounds",
separator,
a(href := routes.Swiss.home)("Swiss"),
a(href := routes.Swiss.home())("Swiss"),
(isGranted(_.ManageTournament) || (ctx.userId.has(s.createdBy) && !s.isFinished)) option frag(
" ",
a(href := routes.Swiss.edit(s.id.value), title := "Edit tournament")(iconTag("%"))
@ -47,7 +47,7 @@ object side {
s.settings.description map { d =>
st.section(cls := "description")(richText(d))
},
s.looksLikePrize option views.html.tournament.bits.userPrizeDisclaimer(s.createdBy),
s.looksLikePrize option views.html.tournament.bits.userPrizeDisclaimer,
teamLink(s.teamId),
separator,
absClientDateTime(s.startsAt)

Some files were not shown because too many files have changed in this diff Show More