Compare commits

...

11 Commits

Author SHA1 Message Date
d32eb8266b README update
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-22 11:45:47 +02:00
bc4ac0f316 drop legacy ThFilter components 2023-04-22 11:45:40 +02:00
6952b8727f drop propfilepic 2023-04-22 11:41:51 +02:00
81d4da6550 chore(deps): node:20.0.0 2023-04-22 11:39:32 +02:00
6154ca7ddf chore(deps): bump all 2023-04-22 11:39:14 +02:00
8fb1e0ca0f svelte-french-toast + translations
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-22 11:22:38 +02:00
763a01af09 cleanup MainDashContent 2023-04-22 11:16:57 +02:00
663cb29ccd translation cleanups 2023-04-22 11:16:50 +02:00
56c3365656 add svelte-french-toast
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-22 11:11:50 +02:00
e7b2c64798 🚀RELEASE v1.3.4
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-19 18:23:17 +02:00
7cb6b63eb9 Smaller sponsoring page size 2023-04-19 18:23:07 +02:00
20 changed files with 130 additions and 356 deletions

View File

@@ -2,8 +2,15 @@
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
#### [1.3.4](https://git.odit.services/lfk/frontend/compare/1.3.3...1.3.4)
- Smaller sponsoring page size [`7cb6b63`](https://git.odit.services/lfk/frontend/commit/7cb6b63eb9596da4ee84369b220c3e680c607032)
#### [1.3.3](https://git.odit.services/lfk/frontend/compare/1.3.2...1.3.3)
> 19 April 2023
- 🚀RELEASE v1.3.3 [`d6d88f5`](https://git.odit.services/lfk/frontend/commit/d6d88f5f60716ca496a17f09b835b23223ec495d)
- bumped lfk-client-js [`2c208c4`](https://git.odit.services/lfk/frontend/commit/2c208c438185892270a0ebd37deb6a7c9ac08fc0)
#### [1.3.2](https://git.odit.services/lfk/frontend/compare/1.3.1...1.3.2)

View File

@@ -1,4 +1,4 @@
FROM registry.odit.services/hub/library/node:19.7.0-alpine3.16 as build
FROM registry.odit.services/hub/library/node:20.0.0-alpine3.17 as build
ARG NPM_REGISTRY_URL=https://registry.npmjs.org
WORKDIR /app

View File

@@ -2,21 +2,20 @@
## ✒️ Overview
This is an API client for [https://git.odit.services/lfk/backend](@lfk/backend)
- WebApp built with [Svelte](https://svelte.dev), [WindiCSS](https://windicss.org/) (to compile [TailwindCSS](https://tailwindcss.com/)) and [Vite](https://vitejs.dev).
This application is intended for use by admin users/ members only.
## 🚀 Getting Started
```
yarn
pnpm i
```
## Development
```
yarn dev
pnpm dev
/
yarn dev --open
pnpm dev --open
```
## Build
```
yarn build
pnpm build
```

View File

@@ -13,7 +13,7 @@
</head>
<body>
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-1.3.3-RELEASE_INFO</span>
<span style="display: none;visibility: hidden;" id="buildinfo">RELEASE_INFO-1.3.4-RELEASE_INFO</span>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="/env.js"></script>
<script type="module" src="/src/main.js"></script>

View File

@@ -1,6 +1,6 @@
{
"name": "@odit/lfk-frontend",
"version": "1.3.3",
"version": "1.3.4",
"type": "module",
"scripts": {
"i18n-order": "node order.js",
@@ -12,14 +12,14 @@
"license": "CC-BY-NC-SA-4.0",
"devDependencies": {
"@odit/license-exporter": "0.0.12",
"@sveltejs/vite-plugin-svelte": "2.0.4",
"@sveltejs/vite-plugin-svelte": "2.1.0",
"auto-changelog": "2.4.0",
"autoprefixer": "10.4.14",
"postcss": "8.4.21",
"postcss": "8.4.23",
"release-it": "15.10.1",
"svelte-select": "3.17.0",
"tailwindcss": "3.3.1",
"vite": "4.2.1"
"vite": "4.3.1"
},
"release-it": {
"git": {
@@ -49,6 +49,7 @@
"localforage": "1.10.0",
"marked": "2.0.3",
"svelte": "3.58.0",
"svelte-french-toast": "1.0.4-beta.0",
"svelte-i18n": "3.6.0",
"tinro": "0.6.12",
"toastify-js": "1.12.0",
@@ -56,6 +57,6 @@
"xlsx": "0.18.5"
},
"volta": {
"node": "19.7.0"
"node": "20.0.0"
}
}

99
pnpm-lock.yaml generated
View File

@@ -2,8 +2,8 @@ lockfileVersion: '6.0'
dependencies:
'@odit/lfk-client-js':
specifier: 1.1.0
version: 1.1.0
specifier: 1.1.1
version: 1.1.1
'@paralleldrive/cuid2':
specifier: ^2.2.0
version: 2.2.0
@@ -31,6 +31,9 @@ dependencies:
svelte:
specifier: 3.58.0
version: 3.58.0
svelte-french-toast:
specifier: 1.0.4-beta.0
version: 1.0.4-beta.0(svelte@3.58.0)
svelte-i18n:
specifier: 3.6.0
version: 3.6.0(svelte@3.58.0)
@@ -52,17 +55,17 @@ devDependencies:
specifier: 0.0.12
version: 0.0.12
'@sveltejs/vite-plugin-svelte':
specifier: 2.0.4
version: 2.0.4(svelte@3.58.0)(vite@4.2.1)
specifier: 2.1.0
version: 2.1.0(svelte@3.58.0)(vite@4.3.1)
auto-changelog:
specifier: 2.4.0
version: 2.4.0
autoprefixer:
specifier: 10.4.14
version: 10.4.14(postcss@8.4.21)
version: 10.4.14(postcss@8.4.23)
postcss:
specifier: 8.4.21
version: 8.4.21
specifier: 8.4.23
version: 8.4.23
release-it:
specifier: 15.10.1
version: 15.10.1
@@ -71,10 +74,10 @@ devDependencies:
version: 3.17.0
tailwindcss:
specifier: 3.3.1
version: 3.3.1(postcss@8.4.21)
version: 3.3.1(postcss@8.4.23)
vite:
specifier: 4.2.1
version: 4.2.1
specifier: 4.3.1
version: 4.3.1
packages:
@@ -510,8 +513,8 @@ packages:
'@octokit/openapi-types': 16.0.0
dev: true
/@odit/lfk-client-js@1.1.0:
resolution: {integrity: sha512-yhjsi7YMzL9/fJ7o06yszzw15iZhao3VmX0G9oqZWFwYJd1M2td3Lvm76mXNzTVlbdG6W0W3+eEjcalBdo51Pg==}
/@odit/lfk-client-js@1.1.1:
resolution: {integrity: sha512-EVwK/kT8VBs0vLk64KgCsHCl2heWHJMWAmZAghEDZWPCPQWX9xL6UzRuKewLXl36/T9YKqZLfDyM5e3WfgLyOg==}
dev: false
/@odit/license-exporter@0.0.12:
@@ -553,8 +556,8 @@ packages:
engines: {node: '>=14.16'}
dev: true
/@sveltejs/vite-plugin-svelte@2.0.4(svelte@3.58.0)(vite@4.2.1):
resolution: {integrity: sha512-pjqhW00KwK2uzDGEr+yJBwut+D+4XfJO/+bHHdHzPRXn9+1Jeq5JcFHyrUiYaXgHtyhX0RsllCTm4ssAx4ZY7Q==}
/@sveltejs/vite-plugin-svelte@2.1.0(svelte@3.58.0)(vite@4.3.1):
resolution: {integrity: sha512-Bc9A8mtTGlhTICdLL/aZ+jyHI3kwtkcXremOH5xwjbNNKOTOtY8nMyG8/oZ5KK8IuUfAn1WL58Bp2tofDJBW0w==}
engines: {node: ^14.18.0 || >= 16}
peerDependencies:
svelte: ^3.54.0
@@ -566,8 +569,8 @@ packages:
magic-string: 0.30.0
svelte: 3.58.0
svelte-hmr: 0.15.1(svelte@3.58.0)
vite: 4.2.1
vitefu: 0.2.4(vite@4.2.1)
vite: 4.3.1
vitefu: 0.2.4(vite@4.3.1)
transitivePeerDependencies:
- supports-color
dev: true
@@ -735,7 +738,7 @@ packages:
- encoding
dev: true
/autoprefixer@10.4.14(postcss@8.4.21):
/autoprefixer@10.4.14(postcss@8.4.23):
resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==}
engines: {node: ^10 || ^12 || >=14}
hasBin: true
@@ -747,7 +750,7 @@ packages:
fraction.js: 4.2.0
normalize-range: 0.1.2
picocolors: 1.0.0
postcss: 8.4.21
postcss: 8.4.23
postcss-value-parser: 4.2.0
dev: true
@@ -2846,29 +2849,29 @@ packages:
engines: {node: '>= 6'}
dev: true
/postcss-import@14.1.0(postcss@8.4.21):
/postcss-import@14.1.0(postcss@8.4.23):
resolution: {integrity: sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw==}
engines: {node: '>=10.0.0'}
peerDependencies:
postcss: ^8.0.0
dependencies:
postcss: 8.4.21
postcss: 8.4.23
postcss-value-parser: 4.2.0
read-cache: 1.0.0
resolve: 1.22.2
dev: true
/postcss-js@4.0.1(postcss@8.4.21):
/postcss-js@4.0.1(postcss@8.4.23):
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
engines: {node: ^12 || ^14 || >= 16}
peerDependencies:
postcss: ^8.4.21
dependencies:
camelcase-css: 2.0.1
postcss: 8.4.21
postcss: 8.4.23
dev: true
/postcss-load-config@3.1.4(postcss@8.4.21):
/postcss-load-config@3.1.4(postcss@8.4.23):
resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==}
engines: {node: '>= 10'}
peerDependencies:
@@ -2881,17 +2884,17 @@ packages:
optional: true
dependencies:
lilconfig: 2.1.0
postcss: 8.4.21
postcss: 8.4.23
yaml: 1.10.2
dev: true
/postcss-nested@6.0.0(postcss@8.4.21):
/postcss-nested@6.0.0(postcss@8.4.23):
resolution: {integrity: sha512-0DkamqrPcmkBDsLn+vQDIrtkSbNkv5AD/M322ySo9kqFkCIYklym2xEmWkwo+Y3/qZo34tzEPNUw4y7yMCdv5w==}
engines: {node: '>=12.0'}
peerDependencies:
postcss: ^8.2.14
dependencies:
postcss: 8.4.21
postcss: 8.4.23
postcss-selector-parser: 6.0.11
dev: true
@@ -2907,8 +2910,8 @@ packages:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
dev: true
/postcss@8.4.21:
resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==}
/postcss@8.4.23:
resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.6
@@ -3443,6 +3446,15 @@ packages:
engines: {node: '>= 0.4'}
dev: true
/svelte-french-toast@1.0.4-beta.0(svelte@3.58.0):
resolution: {integrity: sha512-PkYNukEQAPZyV5ei+JzeYEsbaXFSbJS8/SDTdC8giYa5Atxp2SRepFnPDWx6mu7rV53g886FNLktPMLwRljkpw==}
peerDependencies:
svelte: ^3.57.0
dependencies:
svelte: 3.58.0
svelte-writable-derived: 3.0.1(svelte@3.58.0)
dev: false
/svelte-hmr@0.15.1(svelte@3.58.0):
resolution: {integrity: sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA==}
engines: {node: ^12.20 || ^14.13.1 || >= 16}
@@ -3472,11 +3484,19 @@ packages:
resolution: {integrity: sha512-ITmX/XUiSdkaILmsTviKRkZPaXckM5/FA7Y8BhiUPoamaZG/ZDyOo6ydjFu9fDVFTbwoAUGUi6HBjs+ZdK2AwA==}
dev: true
/svelte-writable-derived@3.0.1(svelte@3.58.0):
resolution: {integrity: sha512-zBWCS5c3MA9o4NT/UJHP3KoPOhtmH2ZQ/QRK31w9LzLdPP7MNncUcBGIu4iH2RVt17iRfR6agm7nEqwNvsYuMw==}
peerDependencies:
svelte: ^3.2.1
dependencies:
svelte: 3.58.0
dev: false
/svelte@3.58.0:
resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==}
engines: {node: '>= 8'}
/tailwindcss@3.3.1(postcss@8.4.21):
/tailwindcss@3.3.1(postcss@8.4.23):
resolution: {integrity: sha512-Vkiouc41d4CEq0ujXl6oiGFQ7bA3WEhUZdTgXAhtKxSy49OmKs8rEfQmupsfF0IGW8fv2iQkp1EVUuapCFrZ9g==}
engines: {node: '>=12.13.0'}
hasBin: true
@@ -3497,11 +3517,11 @@ packages:
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.0.0
postcss: 8.4.21
postcss-import: 14.1.0(postcss@8.4.21)
postcss-js: 4.0.1(postcss@8.4.21)
postcss-load-config: 3.1.4(postcss@8.4.21)
postcss-nested: 6.0.0(postcss@8.4.21)
postcss: 8.4.23
postcss-import: 14.1.0(postcss@8.4.23)
postcss-js: 4.0.1(postcss@8.4.23)
postcss-load-config: 3.1.4(postcss@8.4.23)
postcss-nested: 6.0.0(postcss@8.4.23)
postcss-selector-parser: 6.0.11
postcss-value-parser: 4.2.0
quick-lru: 5.1.1
@@ -3717,8 +3737,8 @@ packages:
engines: {node: '>= 0.10'}
dev: false
/vite@4.2.1:
resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==}
/vite@4.3.1:
resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
@@ -3743,14 +3763,13 @@ packages:
optional: true
dependencies:
esbuild: 0.17.16
postcss: 8.4.21
resolve: 1.22.2
postcss: 8.4.23
rollup: 3.20.2
optionalDependencies:
fsevents: 2.3.2
dev: true
/vitefu@0.2.4(vite@4.2.1):
/vitefu@0.2.4(vite@4.3.1):
resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==}
peerDependencies:
vite: ^3.0.0 || ^4.0.0
@@ -3758,7 +3777,7 @@ packages:
vite:
optional: true
dependencies:
vite: 4.2.1
vite: 4.3.1
dev: true
/vm2@3.9.16:

View File

@@ -6,7 +6,7 @@
import { OpenAPI, AuthService } from "@odit/lfk-client-js";
import Footer from "../general/Footer.svelte";
import isEmail from "validator/es/lib/isEmail";
import Toastify from "toastify-js";
import toast from "svelte-french-toast";
// ------
let username = config.default_username || "";
let password = config.default_password || "";
@@ -20,11 +20,7 @@
OpenAPI.TOKEN = value.access_token;
const jwtinfo = JSON.parse(atob(OpenAPI.TOKEN.split(".")[1]));
store.login(value, jwtinfo);
Toastify({
text: $_("welcome_wavinghand"),
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
toast($_("welcome_wavinghand"));
}
}
});
@@ -33,10 +29,7 @@
// prevent login button spamming
if (last_loginclick_processed && is_blocked_by_autologin === false) {
last_loginclick_processed = false;
Toastify({
text: $_("login_is_checked"),
duration: 500,
}).showToast();
toast.loading($_("login_is_checked"));
let postdata = {};
if (isEmail(username)) {
postdata = {
@@ -56,31 +49,19 @@
const jwtinfo = JSON.parse(atob(OpenAPI.TOKEN.split(".")[1]));
store.login(result.access_token, jwtinfo);
location.replace("/");
Toastify({
text: $_("welcome_wavinghand"),
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
toast.dismiss();
toast($_("welcome_wavinghand"));
})
.catch((err) => {
Toastify({
text: $_("error_on_login"),
duration: 500,
backgroundColor:
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
}).showToast();
toast.dismiss();
toast.error($_("error_on_login"));
})
.finally(() => {
last_loginclick_processed = true;
});
// last login was not processed yet
} else {
Toastify({
text: $_('please-wait-a-moment-your-login-is-still-being-processed'),
duration: 1500,
backgroundColor:
"linear-gradient(90deg, hsla(281, 37%, 45%, 1) 0%, hsla(1, 62%, 48%, 1) 100%)",
}).showToast();
toast($_("please-wait-a-moment-your-login-is-still-being-processed"));
}
};
function handleKeydown(e) {
@@ -91,34 +72,37 @@
</script>
<div
class="min-h-screen flex items-center justify-center bg-gray-100 text-gray-900">
class="min-h-screen flex items-center justify-center bg-gray-100 text-gray-900"
>
<div class="max-w-md w-full py-12 px-6" role="main">
<img style="height:10rem;" class="mx-auto" src="/lfk-logo.png" alt="" />
<p class="mt-6 text-lg text-center font-bold">{$_('application_name')}</p>
<p class="mt-6 text-sm text-center">{$_('log_in_to_your_account')}</p>
<p class="mt-6 text-lg text-center font-bold">{$_("application_name")}</p>
<p class="mt-6 text-sm text-center">{$_("log_in_to_your_account")}</p>
<div>
<div class="rounded-md shadow-sm">
<div>
<!-- svelte-ignore a11y-autofocus -->
<input
autofocus
aria-label={$_('email_address_or_username')}
aria-label={$_("email_address_or_username")}
type="text"
required=""
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
on:keydown={handleKeydown}
placeholder={$_('email_address_or_username')}
bind:value={username} />
placeholder={$_("email_address_or_username")}
bind:value={username}
/>
</div>
<div class="-mt-px relative">
<input
aria-label={$_('password')}
aria-label={$_("password")}
type="password"
required=""
bind:value={password}
class="border-gray-300 placeholder-gray-500 appearance-none rounded-none relative block w-full px-3 py-2 border rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm"
on:keydown={handleKeydown}
placeholder={$_('password')} />
placeholder={$_("password")}
/>
</div>
</div>
@@ -126,27 +110,31 @@
<button
on:click={login}
type="submit"
class="relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm">
class="relative block w-full py-2 px-3 border border-transparent rounded-md text-white font-semibold bg-gray-800 hover:bg-gray-700 focus:bg-gray-900 focus:outline-none focus:shadow-outline sm:text-sm"
>
<span class="absolute left-0 inset-y pl-3">
<svg
class="h-5 w-5 text-gray-500"
fill="currentColor"
viewBox="0 0 20 20">
viewBox="0 0 20 20"
>
<path
fill-rule="evenodd"
d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
clip-rule="evenodd" />
clip-rule="evenodd"
/>
</svg>
</span>
{$_('log_in')}
{$_("log_in")}
</button>
</div>
</div>
<div class="mt-2">
<a
href="/forgot_password"
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm">
{$_('forgot_password')}
class="block w-full text-center py-2 px-3 border border-gray-300 rounded-md font-medium hover:border-gray-400 focus:outline-none focus:border-gray-400 sm:text-sm"
>
{$_("forgot_password")}
</a>
</div>
</div>

View File

@@ -2,7 +2,7 @@
import { _ } from "svelte-i18n";
import { RunnerCardService } from "@odit/lfk-client-js";
import store from "../../store";
import Toastify from "toastify-js";
import toast from "svelte-french-toast";
import CardsEmptyState from "./CardsEmptyState.svelte";
import CardDetailModal from "./CardDetailModal.svelte";
import GenerateRunnerCards from "../pdf_generation/GenerateRunnerCards.svelte";
@@ -148,14 +148,11 @@
...options,
data: current_cards,
}));
Toastify({
text: $_("card-deleted"),
duration: 3500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
toast.success($_("card-deleted"));
}
onMount(async () => {
toast.loading($_("loading-cards"));
let page = 0;
while (page >= 0) {
const cards = await RunnerCardService.runnerCardControllerGetAll(
@@ -175,7 +172,8 @@
dataLoaded = true;
page++;
}
console.log("All cards loaded");
toast.dismiss();
toast.success($_('all-cards-loaded'));
});
</script>

View File

@@ -1,57 +0,0 @@
<script>
export let handler;
let filterValue = "";
</script>
<th>
<input
on:input={() => {
setTimeout(() => {
const v = filterValue.toLowerCase();
handler.filter(v, (c) => {
// if (v === "") {
// return c;
// }
if (!c.runner && v === "blanko") {
return "blanko";
}
if (v.startsWith("#")) {
return `#${c.runner?.id}`;
}
if (c.runner) {
let runnerName = `${c.runner.firstname} ${c.runner.lastname}`;
if (c.runner.middlename) {
runnerName = `${c.runner.firstname} ${c.runner.middlename} ${c.runner.lastname}`;
}
runnerName = runnerName.toLowerCase();
return runnerName;
}
return "";
});
}, 150);
}}
bind:value={filterValue}
type="text"
name="runnerfilter"
id="runnerfilter"
/>
</th>
<style>
th {
border-bottom: 1px solid #e0e0e0;
}
input {
margin: -1px 0 0 0;
padding: 0;
width: 100%;
height: 24px;
border: none;
text-align: left;
background: inherit;
outline: 0;
font-size: 14px;
}
</style>

View File

@@ -1,45 +0,0 @@
<script>
import { _ } from "svelte-i18n";
export let handler;
let selected = "all";
</script>
<th>
<select
on:input={() => {
setTimeout(() => {
if (`${selected}`.trim()) {
if (selected === "all") {
handler.filter("", "enabled");
} else {
handler.filter(selected, "enabled");
}
}
}, 50);
}}
bind:value={selected}
name="statusfilter"
id="statusfilter"
>
<option value="all">{$_("all")}</option>
<option value="true">{$_("enabled")}</option>
<option value="false">{$_("disabled")}</option>
</select>
</th>
<style>
th {
border-bottom: 1px solid #e0e0e0;
}
select {
margin: -1px 0 0 0;
padding: 0;
width: 100%;
height: 24px;
border: none;
text-align: left;
background: inherit;
outline: 0;
font-size: 14px;
}
</style>

View File

@@ -5,6 +5,7 @@
import { router } from "tinro";
import NoComponentLoaded from "../base/NoComponentLoaded.svelte";
import { AuthService } from "@odit/lfk-client-js";
import { Toaster } from 'svelte-french-toast';
$: navOpen = false;
function logout() {
localForage.clear();
@@ -345,6 +346,7 @@
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4A1 1 0 013 5zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
clip-rule="evenodd" /></svg></button>
</header>
<Toaster position="top-right" />
<slot>
<NoComponentLoaded />
</slot>

View File

@@ -143,7 +143,7 @@
<StatCard
title={$_("total-distance")}
value={`${stats.total_distance / 1000} km`}
href="#"
href="/scans/"
>
<svg
fill="currentColor"
@@ -159,7 +159,7 @@
<StatCard
title={$_("average-distance")}
value={`${(stats.average_distance / 1000).toFixed(2)} km`}
href="#"
href="/scans/"
>
<svg
fill="currentColor"

View File

@@ -23,7 +23,10 @@
import DonationStatus from "./DonationStatus.svelte";
import DonationTableAction from "./DonationTableAction.svelte";
import DeleteDonationModal from "./DeleteDonationModal.svelte";
import { donationDonorFilter, donationRunnerFilter } from "../shared/tablefilters";
import {
donationDonorFilter,
donationRunnerFilter,
} from "../shared/tablefilters";
$: searchvalue = "";
$: active_deletes = [];
$: active_edits = [];
@@ -173,7 +176,7 @@
while (page >= 0) {
const donations = await DonationService.donationControllerGetAll(
page,
500
100
);
if (donations.length == 0) {
page = -2;

View File

@@ -1,35 +0,0 @@
<script>
import { _ } from "svelte-i18n";
export let groups;
export let handler;
let selected = "all";
</script>
<th style="border-bottom: 1px solid #ddd;">
<select
on:input={() => {
setTimeout(() => {
if (`${selected}`.trim()) {
const value = selected;
handler.filter(value, (runner) => {
if (
runner.group.id === value ||
runner?.group?.parentGroup?.id === value ||
value === "all"
)
return runner;
return "";
});
}
}, 50);
}}
bind:value={selected}
name="groupfilter"
id="groupfilter"
>
<option value="all">{$_('all')}</option>
{#each groups as g}
<option value={g.value}>{g.label}</option>
{/each}
</select>
</th>

View File

@@ -1,50 +0,0 @@
<script>
export let handler;
let filterValue = "";
</script>
<th>
<input
on:input={() => {
setTimeout(() => {
const v = filterValue.toLowerCase();
handler.filter(v, (c) => {
if (v.startsWith("#")) {
return `#${c.runner?.id}`;
}
if (c.runner) {
let runnerName = `${c.runner.firstname} ${c.runner.lastname}`;
if (c.runner.middlename) {
runnerName = `${c.runner.firstname} ${c.runner.middlename} ${c.runner.lastname}`;
}
runnerName = runnerName.toLowerCase();
return runnerName;
}
return "";
});
}, 150);
}}
placeholder="Filter"
bind:value={filterValue}
type="text"
name="runnerfilter"
id="runnerfilter"
/>
</th>
<style>
th {
border-bottom: 1px solid #e0e0e0;
}
input {
margin: -1px 0 0 0;
padding: 0;
width: 100%;
height: 24px;
border: none;
text-align: left;
background: inherit;
outline: 0;
font-size: 14px;
}
</style>

View File

@@ -1,31 +0,0 @@
<script>
import { _ } from "svelte-i18n";
export let tracks;
export let handler;
let selected = "all";
</script>
<th style="border-bottom: 1px solid #ddd;">
<select
on:input={() => {
setTimeout(() => {
if (`${selected}`.trim()) {
const value = selected;
handler.filter(value, (scan) => {
// TODO: fix filter
if (scan.track.id === value || value === "all") return scan.track.id;
return "";
});
}
}, 50);
}}
bind:value={selected}
name="trackfilter"
id="trackfilter"
>
<option value="all">{$_("all")}</option>
{#each tracks as track}
<option value={track.id}>{track.name}</option>
{/each}
</select>
</th>

View File

@@ -103,26 +103,6 @@
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="shadow sm:rounded-md sm:overflow-hidden">
<div class="px-4 py-5 bg-white space-y-6 sm:p-6">
<div>
<!-- svelte-ignore a11y-label-has-associated-control -->
<label class="block text-sm font-medium text-gray-700">
{$_('profile-picture')}
</label>
<div class="mt-2 flex items-center">
<span
class="inline-block h-20 w-20 rounded-full overflow-hidden bg-gray-100">
<img
alt={$_('profile-picture')}
class="h-20 w-20 rounded-full overflow-hidden bg-gray-100"
src={editable.profilePic || 'https://lauf-fuer-kaya.de/lfk-logo.png'} />
</span>
<!-- <button
type="button"
class="ml-5 bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Change
</button> -->
</div>
</div>
<div class="text-sm w-full">
<label
for="username"

View File

@@ -191,13 +191,6 @@
{/if}
</span>
</div>
<div class="mt-3 text-sm w-full">
<p class="ml-1 font-medium text-gray-700">{$_('profile-picture')}</p>
<img
alt={$_('profile-picture')}
class="h-20 w-20 rounded-full overflow-hidden bg-gray-100"
src={editable_userdata.profilePic} />
</div>
<div class="mt-3 text-sm w-full">
<label
for="enabled"

View File

@@ -35,6 +35,7 @@
"all-associated-runners-will-be-deleted-too": "Alle zugehörigen Läufer:innen werden auch gelöscht!",
"all-associated-scans-will-get-deleted-as-well": "Alle Scans dieser Station werden ebenfalls gelöscht",
"all-associated-teams-and-runners-will-be-deleted-too": "Alle assoziierten Teams und Läufer:innen werden auch gelöscht!",
"all-cards-loaded": "Alle Karten geladen",
"already-paid": "Bereits bezahlt",
"amount": "Anzahl",
"amount-per-kilometer": "Betrag pro Kilometer",
@@ -94,8 +95,8 @@
"contacts-are-being-loaded": "Kontakte werden geladen ...",
"copied-link-to-clipboard": "Link wurde in die Zwischenablage kopiert",
"copied-token-to-clipboard": "Token wurde in die Zwischenablage kopiert",
"count_organizations": "Organisationen (Anzahl)",
"count_teams": "Teams (Anzahl)",
"count_organizations": "Organisationen",
"count_teams": "Teams",
"create": "Erstellen",
"create-a-new": "Erstelle eine neue",
"create-a-new-card": "Neue Läuferkarte erstellen",
@@ -439,11 +440,11 @@
"token": "Token",
"total-distance": "gelaufene Strecke",
"total-donation-amount": "Gesamtbetrag",
"total-donation-count": "Gesamte Sponsorings",
"total-donation-count": "Sponsorings",
"total-donations": "Spendensumme",
"total-donors": "gesamte Sponsor:innen",
"total-donors": "Sponsor:innen",
"total-paid-amount": "Gezahlt",
"total-scans": "gesamte Scans",
"total-scans": "Scans",
"total_donation_amount_in_eur": "Gesamtbetrag in €",
"track": "Track",
"track-added": "Track hinzugefügt",
@@ -495,6 +496,6 @@
"you-dont-have-any-scanstations-yet": "Es gibt noch keine Scannerstationen",
"you-have-to-provide-an-organization": "Du musst eine Organisation angeben",
"you-have-to-save-your-changes-to-generate-a-link": "Du musst deine Änderungen speichern, um einen Link zu generieren.",
"you-must-create-at-least-one-card-or-cancel": "Du musst mindestens eine Blankokarte erstellen (oder abbrechen).",
"you-must-create-at-least-one-card-or-cancel": "Du musst mindestens eine Blankokarte erstellen.",
"zip-postal-code": "Postleitzahl"
}

View File

@@ -35,6 +35,7 @@
"all-associated-runners-will-be-deleted-too": "All associated runners will be deleted too!",
"all-associated-scans-will-get-deleted-as-well": "All associated scans will get deleted as well",
"all-associated-teams-and-runners-will-be-deleted-too": "All associated teams and runners will be deleted too!",
"all-cards-loaded": "All cards loaded",
"already-paid": "Already paid",
"amount": "Amount",
"amount-per-kilometer": "Amount per kilometer",
@@ -495,6 +496,6 @@
"you-dont-have-any-scanstations-yet": "You don't have any scanstations yet",
"you-have-to-provide-an-organization": "You have to provide an organization",
"you-have-to-save-your-changes-to-generate-a-link": "You have to save your changes to generate a link.",
"you-must-create-at-least-one-card-or-cancel": "You must create at least one card (or cancel).",
"you-must-create-at-least-one-card-or-cancel": "You must create at least one card.",
"zip-postal-code": "ZIP/ postal code"
}