aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-14 11:02:08 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-15 20:05:00 +0200
commit4dcccb589d74fafd44ed37d266136adc7a352d82 (patch)
treedfed12e197b34953b619b5627007c9db415925c6 /web/pw-server
parent7ba9fcee64387dd28064ae051aee344d73e889db (diff)
downloadplanetwars.dev-4dcccb589d74fafd44ed37d266136adc7a352d82.tar.xz
planetwars.dev-4dcccb589d74fafd44ed37d266136adc7a352d82.zip
link to all matches on bot page
Diffstat (limited to 'web/pw-server')
-rw-r--r--web/pw-server/src/routes/bots/[bot_name].svelte22
1 files changed, 21 insertions, 1 deletions
diff --git a/web/pw-server/src/routes/bots/[bot_name].svelte b/web/pw-server/src/routes/bots/[bot_name].svelte
index d110e4b..3532e38 100644
--- a/web/pw-server/src/routes/bots/[bot_name].svelte
+++ b/web/pw-server/src/routes/bots/[bot_name].svelte
@@ -7,7 +7,7 @@
try {
const [botData, matches] = await Promise.all([
apiClient.get(`/api/bots/${params["bot_name"]}`),
- apiClient.get("/api/matches", { bot: params["bot_name"] }),
+ apiClient.get("/api/matches", { bot: params["bot_name"], count: "20" }),
]);
const { bot, owner, versions } = botData;
@@ -95,6 +95,11 @@
<div class="matches">
<h3>Recent matches</h3>
<MatchList {matches} />
+ {#if matches.length > 0}
+ <div class="btn-container">
+ <a class="btn-view-more" href={`/matches?bot=${bot["name"]}`}>All matches</a>
+ </div>
+ {/if}
</div>
<!-- <div class="versions">
@@ -141,6 +146,21 @@
margin-bottom: $header-space-above-line;
}
+ $borderColor: rgba(27, 31, 36, 0.25);
+
+ .btn-container {
+ padding: 24px;
+ text-align: center;
+ }
+ .btn-view-more {
+ color: rgb(9, 105, 218);
+ font-size: 14px;
+ text-decoration: none;
+ padding: 6px 16px;
+ border: 1px solid $borderColor;
+ border-radius: 5px;
+ }
+
.versions {
margin: 30px 0;
}