finished tournaments list - closes #623
This commit is contained in:
parent
0f905c0250
commit
cffcb100e5
|
@ -20,10 +20,13 @@ object Tournament extends LilaController {
|
|||
private def tournamentNotFound(implicit ctx: Context) = NotFound(html.tournament.notFound())
|
||||
|
||||
val home = Open { implicit ctx =>
|
||||
env.api.fetchVisibleTournaments zip repo.scheduledDedup zip UserRepo.allSortToints(10) map {
|
||||
case ((visible, scheduled), leaderboard) =>
|
||||
Ok(html.tournament.home(scheduled, leaderboard, env scheduleJsonView visible))
|
||||
} map NoCache
|
||||
env.api.fetchVisibleTournaments zip
|
||||
repo.scheduledDedup zip
|
||||
repo.finished(30) zip
|
||||
UserRepo.allSortToints(10) map {
|
||||
case (((visible, scheduled), finished), leaderboard) =>
|
||||
Ok(html.tournament.home(scheduled, finished, leaderboard, env scheduleJsonView visible))
|
||||
} map NoCache
|
||||
}
|
||||
|
||||
def help(sysStr: Option[String]) = Open { implicit ctx =>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<td>@momentFromNowNoCtx(s.at)</td>
|
||||
}.getOrElse {
|
||||
<td class="small">
|
||||
<span data-icon="p"> @tour.clock.show</span>
|
||||
<span class="text" data-icon="p">@tour.clock.show</span>
|
||||
@if(tour.variant.exotic) { @tour.variant.shortName }
|
||||
@if(tour.mode.rated) {
|
||||
<span class="trans_me">@trans.rated.en()</span>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@(scheduled: List[Tournament], leaderboard: List[User], json: play.api.libs.json.JsObject)(implicit ctx: Context)
|
||||
@(scheduled: List[Tournament], finished: List[Tournament], leaderboard: List[User], json: play.api.libs.json.JsObject)(implicit ctx: Context)
|
||||
|
||||
@moreJs = {
|
||||
@jsAt(s"compiled/lichess.tournament-schedule${isProd??(".min")}.js")
|
||||
|
@ -57,5 +57,47 @@ description = "Play fast-paced chess tournaments! Join an official scheduled tou
|
|||
}
|
||||
<h1>@trans.tournaments()</h1>
|
||||
<div id="tournament_schedule"></div>
|
||||
<div id="tournament_list">
|
||||
<table class="slist finished">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan=2 class="large">@trans.finished()</th>
|
||||
<th>@trans.duration()</th>
|
||||
<th>@trans.winner()</th>
|
||||
<th>@trans.players()</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@finished.map { t =>
|
||||
<tr @if(t.scheduled) { class="scheduled" }>
|
||||
<td class="icon">
|
||||
<span data-icon="@tournamentIconChar(t)"></span>
|
||||
</td>
|
||||
<td class="header">
|
||||
<a href="@routes.Tournament.show(t.id)">
|
||||
<span class="name">@t.fullName</span>
|
||||
<span class="setup">
|
||||
@t.clock.show •
|
||||
@if(t.variant.exotic) {
|
||||
@t.variant.name
|
||||
} else {
|
||||
@t.perfType.map(_.name)
|
||||
}
|
||||
@if(!t.position.initial) {
|
||||
• thematic
|
||||
} • @t.mode.fold(trans.casual, trans.rated)()
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
<td class="duration">@t.durationString</td>
|
||||
<td class="winner">
|
||||
@userIdLink(t.winnerId, withOnline = false)<br />
|
||||
</td>
|
||||
<td class="text" data-icon="r">@t.nbPlayers.localize</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -171,10 +171,6 @@ ol.scheduled_tournaments a:hover {
|
|||
#tournament a.pov::after {
|
||||
right: 15px;
|
||||
}
|
||||
#tournament_list table.slist .create td {
|
||||
padding: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
#tournament table.slist span.rank {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -514,3 +510,38 @@ ol.scheduled_tournaments li.marathon {
|
|||
#tournament_schedule .nb-players {
|
||||
float: right;
|
||||
}
|
||||
#tournament_list table.slist {
|
||||
line-height: 2.3em;
|
||||
}
|
||||
#tournament_list table.slist td {
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
#tournament_list table.slist .header {
|
||||
letter-spacing: 2px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.3s;
|
||||
padding: 0!important;
|
||||
}
|
||||
#tournament_list table.slist .header:hover {
|
||||
transform: translateX(3px);
|
||||
-webkit-transform: translateX(3px);
|
||||
}
|
||||
#tournament_list table.slist .header a {
|
||||
text-decoration: none;
|
||||
padding: 1em;
|
||||
display: block;
|
||||
}
|
||||
#tournament_list table.slist .name {
|
||||
letter-spacing: 3px;
|
||||
font-size: 1.7em;
|
||||
display: block;
|
||||
}
|
||||
#tournament_list .icon span {
|
||||
font-size: 4em;
|
||||
opacity: 0.6;
|
||||
}
|
||||
#tournament_list .scheduled .icon span {
|
||||
color: #d59120;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue