From ccfe86729e3a454e3fdf529abd7063ceb8fa859f Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 24 Jul 2022 16:45:29 +0200 Subject: add bot detail page --- web/pw-server/src/routes/bots/[bot_id].svelte | 74 ------------ web/pw-server/src/routes/bots/[bot_name].svelte | 139 ++++++++++++++++++++++ web/pw-server/src/routes/users/[user_name].svelte | 25 ++-- 3 files changed, 148 insertions(+), 90 deletions(-) delete mode 100644 web/pw-server/src/routes/bots/[bot_id].svelte create mode 100644 web/pw-server/src/routes/bots/[bot_name].svelte (limited to 'web/pw-server/src/routes') diff --git a/web/pw-server/src/routes/bots/[bot_id].svelte b/web/pw-server/src/routes/bots/[bot_id].svelte deleted file mode 100644 index 3eece10..0000000 --- a/web/pw-server/src/routes/bots/[bot_id].svelte +++ /dev/null @@ -1,74 +0,0 @@ - - - - -
- {bot["name"]} -
- -
Upload code
-
- - -
- - diff --git a/web/pw-server/src/routes/bots/[bot_name].svelte b/web/pw-server/src/routes/bots/[bot_name].svelte new file mode 100644 index 0000000..9e9f016 --- /dev/null +++ b/web/pw-server/src/routes/bots/[bot_name].svelte @@ -0,0 +1,139 @@ + + + + + + +
+
+

{bot["name"]}

+ {#if owner} + + {owner["username"]} + + {/if} +
+ + {#if $currentUser && $currentUser["user_id"] === bot["owner_id"]} +
+ + Publish a new version by pushing a docker container to + registry.planetwars.dev/{bot["name"]}:latest, or using the web editor. +
+ {/if} + +
+

Versions

+
    + {#each versions as version} +
  • + {dayjs(version["created_at"]).format("YYYY-MM-DD HH:mm")} +
  • + {/each} +
+
+
+ + diff --git a/web/pw-server/src/routes/users/[user_name].svelte b/web/pw-server/src/routes/users/[user_name].svelte index fab3a96..a1801f4 100644 --- a/web/pw-server/src/routes/users/[user_name].svelte +++ b/web/pw-server/src/routes/users/[user_name].svelte @@ -1,12 +1,4 @@