change scheduled tournament icon color
parent
6dc007c564
commit
f59273f9d0
|
@ -1,17 +1,17 @@
|
|||
package lila.app
|
||||
package templating
|
||||
|
||||
import lila.user.User
|
||||
import controllers.routes
|
||||
import lila.api.Context
|
||||
import lila.tournament.Tournament
|
||||
import lila.user.User
|
||||
|
||||
import play.api.libs.json.Json
|
||||
import play.api.templates.Html
|
||||
|
||||
trait TournamentHelper {
|
||||
trait TournamentHelper { self: I18nHelper =>
|
||||
|
||||
def tournamentJsData(
|
||||
tour: Tournament,
|
||||
version: Int,
|
||||
user: Option[User]) = {
|
||||
def tournamentJsData(tour: Tournament, version: Int, user: Option[User]) = {
|
||||
|
||||
val data = Json.obj(
|
||||
"tournament" -> Json.obj("id" -> tour.id),
|
||||
|
@ -21,4 +21,11 @@ trait TournamentHelper {
|
|||
user.fold(data) { u => data ++ Json.obj("username" -> u.username) }
|
||||
}
|
||||
}
|
||||
|
||||
def tournamentLink(tour: Tournament)(implicit ctx: Context) = Html {
|
||||
val cssClass = if (tour.scheduled) "is-gold" else ""
|
||||
val url = routes.Tournament.show(tour.id)
|
||||
val name = if (tour.scheduled) tour.name else trans.xTournament(tour.name)
|
||||
s"""<a data-icon="g" class="$cssClass" href="$url"> $name</a>"""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<tbody class="scheduled">
|
||||
@createds.filter(_.scheduled).map { tour =>
|
||||
<tr>
|
||||
<td>@linkTo(tour)</td>
|
||||
<td>@tournamentLink(tour)</td>
|
||||
<td class="small">@tourMode(tour)</td>
|
||||
<td data-icon="p"> @tour.clock.show | @tour.durationString</td>
|
||||
<td data-icon="r"> @tour.nbPlayers</td>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<tbody>
|
||||
@createds.filterNot(_.scheduled).map { tour =>
|
||||
<tr>
|
||||
<td>@linkTo(tour)</td>
|
||||
<td>@tournamentLink(tour)</td>
|
||||
<td class="small">@tourMode(tour)</td>
|
||||
<td data-icon="p"> @tour.clock.show | @tour.durationString</td>
|
||||
<td data-icon="r"> @tour.playerRatio</td>
|
||||
|
@ -81,20 +81,17 @@
|
|||
<th>@trans.mode()</th>
|
||||
<th>@trans.timeControl()</th>
|
||||
<th>@trans.players()</th>
|
||||
<th>Leader</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@starteds.map { tour =>
|
||||
<tr>
|
||||
<td>@linkTo(tour)</td>
|
||||
<td>@tournamentLink(tour)</td>
|
||||
<td class="small">@tourMode(tour)</td>
|
||||
<td data-icon="p"> @tour.clock.show | @tour.durationString</td>
|
||||
<td data-icon="r"> @tour.playerRatio</td>
|
||||
<td>@tour.winner.map { player =>
|
||||
@userInfosLink(player.username, player.rating.some, withOnline = false)
|
||||
}
|
||||
</td>
|
||||
<td>@joinButton(tour)</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
@(tour: lila.tournament.Tournament)(implicit ctx: Context)
|
||||
|
||||
<a data-icon="g" href="@routes.Tournament.show(tour.id)"> @if(tour.scheduled) {@tour.name} else {@trans.xTournament(tour.name)}</a>
|
|
@ -102,6 +102,9 @@ time {
|
|||
[data-icon].is-green:before {
|
||||
color: #759900;
|
||||
}
|
||||
[data-icon].is-gold:before {
|
||||
color: #d59120;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'pgn4web ChessSansPiratf';
|
||||
src: url("../vendor/pgn4web/fonts/ChessSansPiratf.eot");
|
||||
|
|
Loading…
Reference in New Issue