From b4df123c0402ab7ae42fd8289ae9bb2f3fff9d5e Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 31 Dec 2020 16:18:32 +0100 Subject: [PATCH 1/5] =?UTF-8?q?added=20translations=20=F0=9F=8C=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #10 --- src/locales/de.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/locales/de.json b/src/locales/de.json index cc929e7d..2c009d52 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -37,5 +37,7 @@ "hallo": "hallo", "total-scans": "gesamte Scans", "total-donations": "Spendensumme", - "credits": "" + "credits": "", + "runners": "Läufer", + "total-distance": "gelaufene Strecke" } From e9a6637eb9f303dc93dbbc3287f9b7b4d92ed42a Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 31 Dec 2020 16:19:40 +0100 Subject: [PATCH 2/5] move StatCards up in Dashboard UI ref #10 --- src/components/Dashboard.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dashboard.svelte b/src/components/Dashboard.svelte index 02fb357a..abb4bf89 100644 --- a/src/components/Dashboard.svelte +++ b/src/components/Dashboard.svelte @@ -273,6 +273,7 @@ import store from "../store";
+
@@ -291,7 +292,6 @@ import store from "../store";
-
From 3d93b04264e99f4717e48e68136a08c85e54d4a0 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 31 Dec 2020 16:19:58 +0100 Subject: [PATCH 3/5] StatCards - fetch real data from API ref #10 --- src/components/StatCards.svelte | 200 ++++++++++++++++++-------------- 1 file changed, 113 insertions(+), 87 deletions(-) diff --git a/src/components/StatCards.svelte b/src/components/StatCards.svelte index b4dab96a..90dbc5a5 100644 --- a/src/components/StatCards.svelte +++ b/src/components/StatCards.svelte @@ -1,96 +1,122 @@ -
-
-
-
-
-
- {$_('runners')} -
-
69
-
- - - -
-
+ +

Allgemeine Statistiken

+{#await stats_promise} + -
-
-
-
-
- {$_('total-scans')} -
-
1500
-
-
-
-
-
-
-
-
-
- {$_('total-donations')} -
-
5000,00 €
-
- -
-
-
-
-
-
-
-
- {$_('total-distance')} -
-
100.0 km
+{:then stats} +
+
+
+
+
+
+ {$_('runners')} +
+
{stats.total_runners}
+
+ + + +
+
+
+
+
+
+
+
+ {$_('total-scans')} +
+
{stats.total_scans}
+
+
+
+
+
+
+
+
+
+ {$_('total-donations')} +
+
{stats.total_donation} €
+
+ +
+
+
+
+
+
+
+
+ {$_('total-distance')} +
+
+ {stats.total_distance / 1000} + km +
+
+ +
- -
-
+{:catch error} +
+ + 😢 Error + {error} + +
+{/await} From f1b2c1de267dd0388de293e481d2739a3eb64d38 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 31 Dec 2020 16:32:42 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=8C=8D=20i18n=20-=20general=5Fpromise?= =?UTF-8?q?=5Ferror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #10 --- src/components/StatCards.svelte | 2 +- src/components/Tracks.svelte | 2 +- src/locales/en.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/StatCards.svelte b/src/components/StatCards.svelte index 90dbc5a5..281dce7a 100644 --- a/src/components/StatCards.svelte +++ b/src/components/StatCards.svelte @@ -115,7 +115,7 @@ {:catch error}
- 😢 Error + {$_('general_promise_error')} {error}
diff --git a/src/components/Tracks.svelte b/src/components/Tracks.svelte index 030dc336..f90c9817 100644 --- a/src/components/Tracks.svelte +++ b/src/components/Tracks.svelte @@ -27,7 +27,7 @@ {:catch error}
- 😢 Error + {$_('general_promise_error')} {error}
diff --git a/src/locales/en.json b/src/locales/en.json index e75866ed..4e70c553 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -49,4 +49,5 @@ "lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.", "oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!", "credits": "Credits" + "general_promise_error": "😢 Error" } From 4f02a5bac0b12f89cfa95e8effc65d5b9cdad732 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Thu, 31 Dec 2020 16:33:08 +0100 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=96=BC=20new=20icons=20+=20i18n=20for?= =?UTF-8?q?=20card=20titles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #10 --- src/components/StatCards.svelte | 69 ++++++++++++++++++++++++++------- src/locales/en.json | 4 +- 2 files changed, 58 insertions(+), 15 deletions(-) diff --git a/src/components/StatCards.svelte b/src/components/StatCards.svelte index 281dce7a..ba472f1d 100644 --- a/src/components/StatCards.svelte +++ b/src/components/StatCards.svelte @@ -28,22 +28,14 @@ {$_('runners')}
{stats.total_runners}
-
+ - - - + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 24 24"> +
@@ -111,6 +103,55 @@ +
+
+
+
+
+ {$_('count_teams')} +
+
{stats.total_teams}
+
+ + + + +
+
+
+
+
+
+
+
+ {$_('count_organizations')} +
+
{stats.total_orgs}
+
+ + +
+
+
{:catch error}
diff --git a/src/locales/en.json b/src/locales/en.json index 4e70c553..a4d59e4e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -48,6 +48,8 @@ "by": "by", "lfk-is-os": "The \"Lauf für Kaya!\" Frontend is (like all other projects for the \"LfK!\" Also) an open source project.", "oss_credit_description": "We use a lot of open source software on these projects, and would like to thank the following projects and contributors who help make open source great!", - "credits": "Credits" + "credits": "Credits", + "count_organizations": "# Organizations", + "count_teams": "# Teams", "general_promise_error": "😢 Error" }