add links to finished tournaments

pull/8454/head
Thibault Duplessis 2021-03-22 18:35:19 +01:00
parent 7b20e4269d
commit cd69cf110a
3 changed files with 61 additions and 3 deletions

View File

@ -245,7 +245,7 @@ final class Api(
val nb = getInt("nb", req) | Int.MaxValue
jsonStream {
env.tournament.api
.resultStream(tour, MaxPerSecond(50), nb)
.resultStream(tour, MaxPerSecond(40), nb)
.map(playerResultWrites.writes)
}.fuccess
}

View File

@ -1,5 +1,5 @@
.tour__stats {
@extend %box-neat;
@extend %flex-column, %box-neat;
background: $c-bg-box;
padding: 1.7em 0;
@ -21,4 +21,12 @@
text-align: right;
line-height: 2em;
}
&__links {
margin: 2em auto 0 auto;
a {
display: block;
margin: 0.5em 0;
}
}
}

View File

@ -34,7 +34,57 @@ function stats(data: TournamentData, noarg: any): VNode {
tableData.push(numberRow(noarg('berserkRate'), berserkRate, 'percent'));
}
return h('div.tour__stats', [h('h2', noarg('tournamentComplete')), h('table', tableData)]);
return h('div.tour__stats', [
h('h2', noarg('tournamentComplete')),
h('table', tableData),
h('div.tour__stats__links', [
...(data.teamBattle
? [
h(
'a',
{
attrs: {
href: `/tournament/${data.id}/teams`,
},
},
`View all ${Object.keys(data.teamBattle.teams).length} teams`
),
h('br'),
]
: []),
h(
'a.text',
{
attrs: {
'data-icon': 'x',
href: `/api/tournament/${data.id}/games`,
},
},
'Download all games'
),
h(
'a.text',
{
attrs: {
'data-icon': 'x',
href: `/api/tournament/${data.id}/results`,
},
},
'Download results'
),
h('br'),
h(
'a.text',
{
attrs: {
'data-icon': '',
href: 'https://lichess.org/api#tag/Arena-tournaments',
},
},
'Arena API documentation'
),
]),
]);
}
export const name = 'finished';