Switch to backend positioning
This commit is contained in:
parent
8dae8b0996
commit
6d136d65d7
|
|
@ -79,10 +79,11 @@ function GroupScoresTable(props) {
|
||||||
return (<Table className='mt-4' striped size='sm' responsive>
|
return (<Table className='mt-4' striped size='sm' responsive>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>Position</th>
|
||||||
<th>Team</th>
|
<th>Team</th>
|
||||||
<th><span title="Punkte">Pkt.</span></th>
|
<th><span title="Punkte">Pkt.</span></th>
|
||||||
|
<th><span title="Becherdifferenz">Dif.</span></th>
|
||||||
<th><span title="Getroffene Becher (Geworfen)">Gew.</span></th>
|
<th><span title="Getroffene Becher (Geworfen)">Gew.</span></th>
|
||||||
<th><span title="Erhaltene Becher (Kassiert)">Kas.</span></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -94,9 +95,10 @@ function GroupScoresTable(props) {
|
||||||
|
|
||||||
function GroupScoresTableRow(props) {
|
function GroupScoresTableRow(props) {
|
||||||
return (<tr>
|
return (<tr>
|
||||||
|
<td>{props.score.position}</td>
|
||||||
<td>{props.score.team.name}</td>
|
<td>{props.score.team.name}</td>
|
||||||
<td>{props.score.group_points}</td>
|
<td>{props.score.group_points}</td>
|
||||||
|
<td>{props.score.difference_in_points}</td>
|
||||||
<td>{props.score.scored_points}</td>
|
<td>{props.score.scored_points}</td>
|
||||||
<td>{props.score.received_points}</td>
|
|
||||||
</tr>);
|
</tr>);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ export function getTournamentMeta(tournamentId, successCallback, errorCallback)
|
||||||
.catch(errorCallback);
|
.catch(errorCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTournamentMatches(tournamentId, successCallback, errorCallback, matchState=null) {
|
export function getTournamentMatches(tournamentId, successCallback, errorCallback, matchState = null) {
|
||||||
let matchFilter = '';
|
let matchFilter = '';
|
||||||
if (matchState) {
|
if (matchState) {
|
||||||
matchFilter = '?state=' + matchState;
|
matchFilter = '?state=' + matchState;
|
||||||
|
|
@ -88,16 +88,12 @@ function convertGroup(apiGroup) {
|
||||||
id: apiGroup.id,
|
id: apiGroup.id,
|
||||||
number: apiGroup.number,
|
number: apiGroup.number,
|
||||||
scores: apiGroup.group_scores.sort((a, b) => {
|
scores: apiGroup.group_scores.sort((a, b) => {
|
||||||
if (a.group_points > b.group_points) { return -1 }
|
if (a.position > b.position) {
|
||||||
else if(a.group_points < b.group_points) { return 1 }
|
return 1;
|
||||||
else {
|
} else if (a.position < b.position) {
|
||||||
if (a.difference_in_points > b.difference_in_points) { return -1 }
|
return -1;
|
||||||
else if (a.difference_in_points < b.difference_in_points) { return 1 }
|
} else {
|
||||||
else {
|
return 0;
|
||||||
if (a.scored_points > b.scored_points) { return -1 }
|
|
||||||
else if (a.scored_points < b.scored_points) { return 1 }
|
|
||||||
else { return 0 }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
matches: apiGroup.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, true))
|
matches: apiGroup.matches.sort((a, b) => a.position > b.position).map(match => convertMatch(match, true))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue