forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
238 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package views.html.swiss | ||
|
||
import lila.api.Context | ||
import lila.app.templating.Environment._ | ||
import lila.app.ui.ScalatagsTemplate._ | ||
import lila.i18n.{ I18nKeys => trans } | ||
import lila.swiss.Swiss | ||
|
||
import controllers.routes | ||
|
||
object bits { | ||
|
||
def iconChar(swiss: Swiss): String = | ||
swiss.perfType.fold('g')(_.iconChar).toString | ||
|
||
def notFound()(implicit ctx: Context) = | ||
views.html.base.layout( | ||
title = trans.tournamentNotFound.txt() | ||
) { | ||
main(cls := "page-small box box-pad")( | ||
h1(trans.tournamentNotFound()), | ||
p(trans.tournamentDoesNotExist()), | ||
p(trans.tournamentMayHaveBeenCanceled()), | ||
br, | ||
br, | ||
a(href := routes.Tournament.home())(trans.returnToTournamentsHomepage()) | ||
) | ||
} | ||
|
||
def forTeam(swisses: List[Swiss])(implicit ctx: Context) = | ||
table(cls := "slist")( | ||
tbody( | ||
swisses map { s => | ||
tr( | ||
cls := List( | ||
"enterable" -> s.isEnterable, | ||
"soon" -> s.isNowOrSoon | ||
) | ||
)( | ||
td(cls := "icon")(iconTag(iconChar(s))), | ||
td(cls := "header")( | ||
a(href := routes.Swiss.show(s.id.value))( | ||
span(cls := "name")(s.name), | ||
span(cls := "setup")( | ||
s.clock.show, | ||
" • ", | ||
if (s.variant.exotic) s.variant.name else s.perfType.map(_.trans), | ||
" • ", | ||
if (s.rated) trans.ratedTournament() else trans.casualTournament(), | ||
" • ", | ||
s.estimatedDurationString | ||
) | ||
) | ||
), | ||
td(cls := "infos")( | ||
momentFromNowOnce(s.startsAt) | ||
), | ||
td(cls := "text", dataIcon := "r")(s.nbPlayers.localize) | ||
) | ||
} | ||
) | ||
) | ||
|
||
def jsI18n(implicit ctx: Context) = i18nJsObject(i18nKeys) | ||
|
||
private val i18nKeys = List( | ||
trans.join, | ||
trans.withdraw, | ||
trans.joinTheGame, | ||
trans.signIn | ||
).map(_.key) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
db.swiss.ensureIndex({teamId:1,startsAt:1}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...les/tournament/src/main/GreatPlayer.scala → modules/common/src/main/GreatPlayer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package lila.tournament | ||
package lila.common | ||
|
||
object GreatPlayer { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.