diff --git a/src/routes/bracket/+page.svelte b/src/routes/bracket/+page.svelte new file mode 100644 index 0000000..31a2595 --- /dev/null +++ b/src/routes/bracket/+page.svelte @@ -0,0 +1,147 @@ + + + + + + + {#if data instanceof Promise} +
+ {:else if data instanceof Error} + +
{getFriendlyErrorMsg(data)}
+ {:else if data} + +

+ Bracket {data.bracket + 1} +

+

+ + Season {data.season + 1} + {#if data.type == 'scrimmage'}Market Day{:else}Grand Faire{/if} + {data.time.toLocaleDateString()} + +

+
+
+

Bracket Ranking

+
    + {#each data.rankings as player (player.address)} +
  1. + {player.name}: + {formatScore(player.score)} +
  2. + {/each} +
+
+
+

Matches

+
+ Players: {data.rankings.length}, + Matches: {data.matches.length} + ({data.matches.length / Math.ceil(data.rankings.length / 4)}pp) +
+ {#each data.matches as match, i (match.id)} +
+
+

Match {i + 1}

+
    + {#each match.rankings as player (player.address)} +
  1. + {player.name}: + {player.score.toFixed(3)}
  2. + {/each} +
+
+
+ {/each} +
+ {/if} +
\ No newline at end of file diff --git a/src/routes/tournament/+page.svelte b/src/routes/tournament/+page.svelte index c0ea022..0827fd2 100644 --- a/src/routes/tournament/+page.svelte +++ b/src/routes/tournament/+page.svelte @@ -13,13 +13,9 @@ import { page } from "$app/stores"; } from "$lib/site"; import { getFriendlyErrorMsg } from "$lib/util"; - interface ScoredPlayerWithWinCount extends ScoredPlayer { - winCount: number; - } - interface BracketInfo { idx: number; - rankings: ScoredPlayerWithWinCount[], + rankings: ScoredPlayer[], matches: string[]; } @@ -89,14 +85,14 @@ import { page } from "$app/stores"; {#if data.type == 'scrimmage'}Market Day{:else}Grand Faire{/if} Summary
- Time: {data.time.toLocaleDateString()} {data.time.toLocaleTimeString()} + Season: {data.season + 1}
- Season: {data.season + 1} + Time: {data.time.toLocaleDateString()} {data.time.toLocaleTimeString()}
-

Final Ranking

+

Final Ranking

    {#each data.rankings as player (player.address)}
  1. @@ -116,6 +112,10 @@ import { page } from "$app/stores"; Players: {bracket.rankings.length}, Matches: {bracket.matches.length} ({bracket.matches.length / Math.ceil(bracket.rankings.length / 4)}pp) +   + (view matches)

Bracket Ranking