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