Compare commits

...

77 Commits

Author SHA1 Message Date
21265e20cb Merge branch 'notification' of ssh://git.hofer.link:2222/Ruderverein-Donau-Linz/rowt into notification
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m39s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-09 17:22:39 +01:00
aef5748f5f add table 2024-03-09 17:21:15 +01:00
5af1860607 notifications 2024-03-09 17:20:38 +01:00
e94fc79580 deployed :-)
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m53s
CI/CD Pipeline / deploy-staging (push) Successful in 4m5s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-09 17:02:50 +01:00
2445e82c69 Merge pull request 'boatshouse' (#259) from boatshouse into staging
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
Reviewed-on: #259
2024-03-09 16:59:56 +01:00
ad2f2241aa show messages in kiosk mode
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m56s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-09 16:56:32 +01:00
f14177d497 MB: styling of boathouse
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-09 16:49:04 +01:00
1e96c113a9 single location for flash message
Some checks failed
CI/CD Pipeline / test (push) Failing after 15m13s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-09 16:15:47 +01:00
75be5d3ca2 Merge pull request 'boatshouse' (#257) from boatshouse into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m12s
CI/CD Pipeline / deploy-staging (push) Successful in 4m13s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #257
2024-03-08 22:23:42 +01:00
a61f7cebbb no fee for 'ehrenmitglieder
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m53s
CI/CD Pipeline / deploy-staging (push) Successful in 4m7s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-08 13:57:45 +01:00
69edb63ddd styling
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m9s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-08 13:46:00 +01:00
3deb1e40fc boatshouse functionality, fixes #183
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m13s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-08 13:13:20 +01:00
7e6b577315 update filter
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m51s
CI/CD Pipeline / deploy-staging (push) Successful in 4m0s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-08 10:16:36 +01:00
edb42717bc add schnupper management
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m59s
CI/CD Pipeline / deploy-staging (push) Successful in 4m4s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-06 15:55:13 +01:00
a3ce96d4bf clippy
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m47s
CI/CD Pipeline / deploy-staging (push) Successful in 4m10s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-06 13:27:03 +01:00
4af1f48ebf sort boats by name
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m27s
CI/CD Pipeline / deploy-staging (push) Successful in 4m11s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-06 08:15:18 +01:00
8854ef36f3 fix ci
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m20s
CI/CD Pipeline / deploy-staging (push) Successful in 4m1s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 15:01:44 +01:00
ef4323b275 fix ci
Some checks failed
CI/CD Pipeline / test (push) Failing after 3m43s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 14:29:27 +01:00
1a662acf3b fix ci
Some checks failed
CI/CD Pipeline / test (push) Failing after 14m37s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 14:12:57 +01:00
94b622a5e7 update filter
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy-staging (push) Waiting to run
CI/CD Pipeline / deploy-main (push) Waiting to run
2024-03-05 13:45:19 +01:00
6f5fcd59ea fix ci
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m30s
CI/CD Pipeline / deploy-staging (push) Successful in 4m0s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 09:45:54 +01:00
1a482db9e2 fix ci
Some checks failed
CI/CD Pipeline / test (push) Failing after 8m43s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 09:34:50 +01:00
10a0e82392 fix ci
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
2024-03-05 09:33:18 +01:00
8b0cbe23d1 show year selector to admins for logbook
Some checks failed
CI/CD Pipeline / test (push) Failing after 8m58s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 09:19:15 +01:00
58f8cb14b8 allow admins to show logbook for any year
Some checks failed
CI/CD Pipeline / test (push) Failing after 10m41s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 08:59:44 +01:00
ae98a4278d fix wording
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m28s
CI/CD Pipeline / deploy-staging (push) Successful in 4m9s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 08:31:03 +01:00
4b59cdfc8f fix ci?
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m39s
CI/CD Pipeline / deploy-staging (push) Successful in 4m11s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 07:50:43 +01:00
16e7c2379a remove timeout again
Some checks failed
CI/CD Pipeline / test (push) Failing after 13m53s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-05 00:56:40 +01:00
737af80c39 wait for webserver to respond with 2xx, fix failing first (flaky) test
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-05 00:53:09 +01:00
212ef5faa7 faster tests
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-05 00:46:19 +01:00
5078c5f341 use local timezone where appropriate and fix tests between 0 and 1 o'clock
Some checks failed
CI/CD Pipeline / deploy-staging (push) Waiting to run
CI/CD Pipeline / deploy-main (push) Waiting to run
CI/CD Pipeline / test (push) Has been cancelled
2024-03-05 00:17:02 +01:00
007b87e8ad add scheckbook functionality, Fixes #184 (#235)
All checks were successful
CI/CD Pipeline / test (push) Successful in 19m38s
CI/CD Pipeline / deploy-staging (push) Successful in 4m17s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #235
2024-03-04 23:11:44 +01:00
c813e2b3da scheckbuch people don't get error
All checks were successful
CI/CD Pipeline / test (push) Successful in 15m46s
CI/CD Pipeline / deploy-staging (push) Successful in 4m9s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-04 22:04:22 +01:00
4a81d2d624 alphabetically order stat if same ranking
All checks were successful
CI/CD Pipeline / test (push) Successful in 20m38s
CI/CD Pipeline / deploy-staging (push) Successful in 17m34s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-04 17:12:16 +01:00
842cc00812 Merge branch 'staging' of ssh://git.hofer.link:2222/Ruderverein-Donau-Linz/rowt into staging
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 17:01:33 +01:00
ff6d8adefd add new functionality to menu 2024-03-04 17:01:25 +01:00
05b7b7fbbf Create admin function to use copy-pasted users from ekey, return the ones which don't match to "Donau Linz" rowt user, Fixes #204 (#230)
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
Reviewed-on: #230
2024-03-04 16:59:44 +01:00
8edbf15235 show user icon in all vorstand users
Some checks are pending
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Successful in 15m40s
2024-03-04 16:37:53 +01:00
b6a318df85 fix link
All checks were successful
CI/CD Pipeline / test (push) Successful in 15m26s
CI/CD Pipeline / deploy-staging (push) Successful in 4m1s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-04 15:57:06 +01:00
a1b5c26518 Merge branch 'main' into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 15m41s
CI/CD Pipeline / deploy-staging (push) Successful in 4m3s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-04 15:18:56 +01:00
dfa0eaeb4f fix ci, more output @ ci
All checks were successful
CI/CD Pipeline / test (push) Successful in 18m51s
CI/CD Pipeline / deploy-staging (push) Successful in 4m3s
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-03-04 14:55:11 +01:00
4eeb2162d8 fix spacing issues
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 14:28:19 +01:00
df9f1c398b fix spacing issues
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 14:26:42 +01:00
62ff5f0c2e fix spacing issues 2024-03-04 14:25:14 +01:00
ee17bc2ab3 fix tests
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 14:08:46 +01:00
eb483d9959 also verify logbook entry successfully created
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 14:04:13 +01:00
c98170636b show proper amount of guests
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 13:35:13 +01:00
442257df01 reformat files
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
2024-03-04 13:28:42 +01:00
7ce535f500 Merge pull request 'staging' (#226) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m21s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m59s
Reviewed-on: #226
2024-03-04 10:03:14 +01:00
29284b30a6 Merge pull request 'update deps and fix ci' (#219) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m32s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m57s
Reviewed-on: #219
2024-03-01 09:09:34 +01:00
966254807c Merge pull request 'allow sending mails w/o attachments :-)' (#218) from staging into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 12m11s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #218
2024-03-01 08:41:12 +01:00
4f6dacb907 Merge pull request 'use old lock file to make ci work' (#216) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m24s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m19s
Reviewed-on: #216
2024-02-21 15:39:22 +01:00
4ddac52a93 Merge pull request 'increase timeout for frontend tests' (#215) from staging into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 16m28s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #215
2024-02-21 15:08:31 +01:00
cdd57eb147 Merge pull request 'code cleanup' (#214) from staging into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #214
2024-02-21 14:47:54 +01:00
4a0026a9ee Merge pull request 'staging' (#213) from staging into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 15m5s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #213
2024-02-21 13:58:29 +01:00
ce2e4e5219 Merge pull request 'dont expect money from deleted users :-)' (#212) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m54s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m23s
Reviewed-on: #212
2024-02-16 13:14:49 +01:00
b2fd52e4a5 Merge pull request 'also remove js function for (unnecessary) filtering of months' (#211) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 7m44s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m25s
Reviewed-on: #211
2024-02-16 10:48:05 +01:00
14fbfd200b Merge pull request 'remove useless button' (#210) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m12s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m33s
Reviewed-on: #210
2024-02-16 08:05:57 +01:00
ebbd9215ea Merge pull request 'staging' (#209) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 7m57s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m31s
Reviewed-on: #209
2024-02-15 22:30:02 +01:00
f58d0d010e Merge pull request 'upgrade major deps' (#208) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m59s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 4m20s
Reviewed-on: #208
2024-02-13 23:25:55 +01:00
86f2f3fb0c Merge pull request 'update deps' (#207) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m1s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 4m1s
Reviewed-on: #207
2024-02-13 14:20:19 +01:00
d731f97169 Merge pull request 'only show donauLinz user in stats, otherwise count as guest' (#206) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m57s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m31s
Reviewed-on: #206
2024-02-12 20:10:03 +01:00
808cdbaddc Merge pull request 'add remark about bank synchornistaion' (#205) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m51s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m35s
Reviewed-on: #205
2024-02-12 19:08:28 +01:00
cef1d91ee3 Merge pull request 'better wording' (#203) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m49s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m28s
Reviewed-on: #203
2024-02-11 16:05:37 +01:00
08d935e6a5 Merge pull request 'update list of filtered log in attempts' (#201) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m7s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m50s
Reviewed-on: #201
2024-02-07 12:37:15 +01:00
49b810d200 Merge pull request 'staging' (#198) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m39s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 3m42s
Reviewed-on: #198
2024-02-06 16:42:55 +01:00
123efa1c8c Merge pull request 'only send mails to proper addresses' (#197) from staging into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #197
2024-02-05 22:22:08 +01:00
ded9ed984b Merge pull request 'increase whitelist of not logging certain (wp logins)' (#196) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m24s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 4m11s
Reviewed-on: #196
2024-01-31 10:24:14 +01:00
5c61998ff7 Merge pull request 'update deps' (#195) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m35s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m3s
Reviewed-on: #195
2024-01-26 13:26:58 +01:00
9181b79166 Merge pull request 'update tests to new name field in update' (#194) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m13s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m4s
Reviewed-on: #194
2024-01-24 23:05:04 +01:00
24667e56a4 Merge pull request 'allow changing title of planned-event; fixes #52' (#193) from staging into main
Some checks failed
CI/CD Pipeline / test (push) Failing after 3m29s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #193
2024-01-24 22:48:18 +01:00
29486ac7a2 Merge pull request 'supply all variables for planned_event roles' (#191) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m8s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m31s
Reviewed-on: #191
2024-01-24 18:18:51 +01:00
20e2be114a Merge pull request 'fix edit/delete trip' (#190) from staging into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #190
2024-01-24 18:12:53 +01:00
4ecdc8968f Merge pull request 'don't spam logs with (unsuccessful) wordpress login attempts' (#189) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m7s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m6s
Reviewed-on: #189
2024-01-24 13:10:02 +01:00
7f564100b1 Merge pull request 'add has-paid filter' (#181) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m48s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m1s
Reviewed-on: #181
2024-01-22 22:59:03 +01:00
353b413d9f Merge pull request 'update deps' (#180) from staging into main
Some checks failed
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions
CI/CD Pipeline / test (push) Has been cancelled
Reviewed-on: #180
2024-01-22 22:39:17 +01:00
2e3be062c6 Merge pull request 'staging' (#178) from staging into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m28s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 4m40s
Reviewed-on: #178
2024-01-22 22:24:24 +01:00
67 changed files with 3512 additions and 2406 deletions

View File

@ -34,7 +34,7 @@ jobs:
cargo build cargo build
cd frontend && npm install && npm run build cd frontend && npm install && npm run build
- name: Frontend tests - name: Frontend tests
run: cd frontend && npx playwright install && npx playwright test --workers 1 run: cd frontend && npx playwright install && npx playwright test --workers 1 --reporter line
- name: Backend tests - name: Backend tests
run: cargo test --verbose run: cargo test --verbose
#- uses: actions/upload-artifact@v3 #- uses: actions/upload-artifact@v3

22
Cargo.lock generated
View File

@ -521,6 +521,27 @@ dependencies = [
"typenum", "typenum",
] ]
[[package]]
name = "csv"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe"
dependencies = [
"csv-core",
"itoa",
"ryu",
"serde",
]
[[package]]
name = "csv-core"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "ctr" name = "ctr"
version = "0.9.2" version = "0.9.2"
@ -2195,6 +2216,7 @@ dependencies = [
"argon2", "argon2",
"chrono", "chrono",
"chrono-tz", "chrono-tz",
"csv",
"env_logger", "env_logger",
"futures", "futures",
"ics", "ics",

View File

@ -23,6 +23,7 @@ tera = { version = "1.18", features = ["date-locale"], optional = true}
ics = "0.5" ics = "0.5"
futures = "0.3" futures = "0.3"
lettre = "0.11" lettre = "0.11"
csv = "1.3"
[target.'cfg(not(windows))'.dependencies] [target.'cfg(not(windows))'.dependencies]
openssl = { version = "0.10", features = [ "vendored" ] } openssl = { version = "0.10", features = [ "vendored" ] }

View File

@ -16,3 +16,9 @@
## Backend (Unit + Integration) ## Backend (Unit + Integration)
`cargo t` `cargo t`
# Lints
- Rust: `cargo check`
- Tera files: `djlint **.html.tera --profile=jinja --reformat`
- Typescript: `prettier -w *.ts`

View File

@ -1,77 +1,76 @@
import * as d3 from 'd3'; import * as d3 from "d3";
export interface Data { export interface Data {
date: Date; date: Date;
km: number; km: number;
} }
if(sessionStorage.getItem('userStats')) { if (sessionStorage.getItem("userStats")) {
const data = JSON.parse(sessionStorage.getItem('userStats') || '{}') as Data[]; const data = JSON.parse(
sessionStorage.getItem("userStats") || "{}",
) as Data[];
if(data.length >= 2) { if (data.length >= 2) {
const margin = { top: 20, right: 20, bottom: 50, left: 50 }; const margin = { top: 20, right: 20, bottom: 50, left: 50 };
const width: number = 960 - margin.left - margin.right; const width: number = 960 - margin.left - margin.right;
const height: number = 500 - margin.top - margin.bottom; const height: number = 500 - margin.top - margin.bottom;
data.forEach((d: Data) => { data.forEach((d: Data) => {
d.date = <Date> new Date(d.date) d.date = <Date>new Date(d.date);
d.km = +d.km; d.km = +d.km;
}); });
const x = d3.scaleTime() const x = d3
.scaleTime()
.domain(<[Date, Date]>d3.extent(data, (d: Data) => d.date)) .domain(<[Date, Date]>d3.extent(data, (d: Data) => d.date))
.range([0, width]); .range([0, width]);
const y = d3.scaleLinear() const y = d3
.scaleLinear()
.domain([0, Number(d3.max(data, (d: Data) => d.km))]) .domain([0, Number(d3.max(data, (d: Data) => d.km))])
.range([height, 0]); .range([height, 0]);
const line = d3.line<Data>() const line = d3
.line<Data>()
.x((d: Data) => x(d.date)) .x((d: Data) => x(d.date))
.y((d: Data) => y(d.km)); .y((d: Data) => y(d.km));
const svg = d3.select('#container') const svg = d3
.append('svg') .select("#container")
.attr('width', width + margin.left + margin.right) .append("svg")
.attr('height', height + margin.top + margin.bottom) .attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.call(responsivefy) .call(responsivefy)
.append('g') .append("g")
.attr('transform', `translate(${margin.left},${margin.top})`); .attr("transform", `translate(${margin.left},${margin.top})`);
svg.append('path') svg.append("path").data([data]).attr("class", "line").attr("d", line);
.data([data])
.attr('class', 'line') svg
.attr('d', line); .append("g")
.attr("transform", `translate(0,${height})`)
svg.append('g')
.attr('transform', `translate(0,${height})`)
.call(d3.axisBottom(x)); .call(d3.axisBottom(x));
svg.append('g') svg.append("g").call(d3.axisLeft(y));
.call(d3.axisLeft(y));
} }
} }
function responsivefy(svg: any) { function responsivefy(svg: any) {
const container = d3.select(svg.node().parentNode); const container = d3.select(svg.node().parentNode);
const width = parseInt(svg.style('width'), 10); const width = parseInt(svg.style("width"), 10);
const height = parseInt(svg.style('height'), 10); const height = parseInt(svg.style("height"), 10);
const aspect = width / height; const aspect = width / height;
svg.attr('viewBox', `0 0 ${width} ${height}`) svg
.attr('preserveAspectRatio', 'xMinYMid') .attr("viewBox", `0 0 ${width} ${height}`)
.attr("preserveAspectRatio", "xMinYMid")
.call(resize); .call(resize);
d3.select(window).on( d3.select(window).on("resize." + container.attr("id"), resize);
'resize.' + container.attr('id'),
resize
);
function resize() { function resize() {
const w = parseInt(container.style('width')); const w = parseInt(container.style("width"));
svg.attr('width', w); svg.attr("width", w);
svg.attr('height', Math.round(w / aspect)); svg.attr("height", Math.round(w / aspect));
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,6 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
export default defineConfig({ export default defineConfig({
timeout: 180000,
testDir: './tests', testDir: './tests',
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: true, fullyParallel: true,
@ -25,7 +24,7 @@ export default defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: { use: {
/* Base URL to use in actions like `await page.goto('/')`. */ /* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000', baseURL: 'http://127.0.0.1:8000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry', trace: 'on-first-retry',

View File

@ -1,114 +1,144 @@
import { test, expect, Page } from '@playwright/test'; import { test, expect, Page } from "@playwright/test";
test('cox can create and delete trip', async ({ page }) => { test("cox can create and delete trip", async ({ page }) => {
await page.goto('http://localhost:8000/auth'); await page.goto("/auth");
await page.getByPlaceholder('Name').click(); await page.getByPlaceholder("Name").click();
await page.getByPlaceholder('Name').fill('cox'); await page.getByPlaceholder("Name").fill("cox");
await page.getByPlaceholder('Name').press('Tab'); await page.getByPlaceholder("Name").press("Tab");
await page.getByPlaceholder('Passwort').fill('cox'); await page.getByPlaceholder("Passwort").fill("cox");
await page.getByPlaceholder('Passwort').press('Enter'); await page.getByPlaceholder("Passwort").press("Enter");
await page.getByRole('link', { name: 'Geplante Ausfahrten' }).click(); await page.getByRole("link", { name: "Geplante Ausfahrten" }).click();
await page.locator('.relative').first().click(); await page.locator(".relative").first().click();
await page.locator('#sidebar #planned_starting_time').click(); await page.locator("#sidebar #planned_starting_time").click();
await page.locator('#sidebar #planned_starting_time').fill('18:00'); await page.locator("#sidebar #planned_starting_time").fill("18:00");
await page.locator('#sidebar #planned_starting_time').press('Tab'); await page.locator("#sidebar #planned_starting_time").press("Tab");
await page.locator('#sidebar #planned_starting_time').press('Tab'); await page.locator("#sidebar #planned_starting_time").press("Tab");
await page.getByRole('spinbutton').fill('5'); await page.getByRole("spinbutton").fill("5");
await page.getByRole('button', { name: 'Erstellen', exact: true }).click(); await page.getByRole("button", { name: "Erstellen", exact: true }).click();
await expect(page.locator('body')).toContainText('18:00 Uhr (cox) Details'); await expect(page.locator("body")).toContainText("18:00 Uhr (cox) Details");
await page.goto('http://localhost:8000/planned'); await page.goto("/planned");
await page.getByRole('link', { name: 'Details' }).click(); await page.getByRole("link", { name: "Details" }).click();
await page.getByRole('link', { name: 'Termin löschen' }).click(); await page.getByRole("link", { name: "Termin löschen" }).click();
await expect(page.locator('body')).toContainText('Erfolgreich gelöscht!'); await expect(page.locator("body")).toContainText("Erfolgreich gelöscht!");
}); });
// TODO: group -> cox can create trips // TODO: group -> cox can create trips
// TODO: cox can help/register at trips/events // TODO: cox can help/register at trips/events
test.describe('cox can edit trips', () => { test.describe("cox can edit trips", () => {
let sharedPage: Page; let sharedPage: Page;
test.beforeEach(async ({ browser }) => { test.beforeAll(async ({ browser }) => {
const page = await browser.newPage(); const page = await browser.newPage();
await page.goto('http://localhost:8000/auth'); await page.goto("/auth");
await page.getByPlaceholder('Name').click(); await page.getByPlaceholder("Name").click();
await page.getByPlaceholder('Name').fill('cox'); await page.getByPlaceholder("Name").fill("cox");
await page.getByPlaceholder('Name').press('Tab'); await page.getByPlaceholder("Name").press("Tab");
await page.getByPlaceholder('Passwort').fill('cox'); await page.getByPlaceholder("Passwort").fill("cox");
await page.getByPlaceholder('Passwort').press('Enter'); await page.getByPlaceholder("Passwort").press("Enter");
await page.getByRole('link', { name: 'Geplante Ausfahrten' }).click(); await page.getByRole("link", { name: "Geplante Ausfahrten" }).click();
await page.locator('.relative').first().click(); await page.locator(".relative").first().click();
await page.locator('#sidebar #planned_starting_time').click(); await page.locator("#sidebar #planned_starting_time").click();
await page.locator('#sidebar #planned_starting_time').fill('18:00'); await page.locator("#sidebar #planned_starting_time").fill("18:00");
await page.locator('#sidebar #planned_starting_time').press('Tab'); await page.locator("#sidebar #planned_starting_time").press("Tab");
await page.locator('#sidebar #planned_starting_time').press('Tab'); await page.locator("#sidebar #planned_starting_time").press("Tab");
await page.getByRole('spinbutton').fill('5'); await page.getByRole("spinbutton").fill("5");
await page.getByRole('button', { name: 'Erstellen', exact: true }).click(); await page.getByRole("button", { name: "Erstellen", exact: true }).click();
sharedPage = page; sharedPage = page;
}); });
test('edit remarks', async () => { test("edit remarks", async () => {
await sharedPage.goto('http://localhost:8000/planned'); await sharedPage.goto("/planned");
await sharedPage.getByRole('link', { name: 'Details' }).click(); await sharedPage.getByRole("link", { name: "Details" }).click();
await sharedPage.locator('#sidebar #notes').click(); await sharedPage.locator("#sidebar #notes").click();
await sharedPage.locator('#sidebar #notes').fill('Meine Anmerkung'); await sharedPage.locator("#sidebar #notes").fill("Meine Anmerkung");
await sharedPage.getByRole('button', { name: 'Speichern' }).click(); await sharedPage.getByRole("button", { name: "Speichern" }).click();
await sharedPage.getByRole('link', { name: 'Details' }).click(); await sharedPage.getByRole("link", { name: "Details" }).click();
await expect(sharedPage.locator('#sidebar')).toContainText('Meine Anmerkung'); await expect(sharedPage.locator("#sidebar")).toContainText(
"Meine Anmerkung",
);
await sharedPage.getByRole('button', { name: 'Ausfahrt erstellen schließen' }).click(); await sharedPage
.getByRole("button", { name: "Ausfahrt erstellen schließen" })
.click();
}); });
test('add and remove guest', async () => { test("add and remove guest", async () => {
await sharedPage.goto('http://localhost:8000/planned'); await sharedPage.goto("/planned");
await sharedPage.getByRole('link', { name: 'Details' }).click(); await sharedPage.getByRole("link", { name: "Details" }).click();
await sharedPage.locator('#sidebar #user_note').click(); await sharedPage.locator("#sidebar #user_note").click();
await sharedPage.locator('#sidebar #user_note').fill('Mein Gast'); await sharedPage.locator("#sidebar #user_note").fill("Mein Gast");
await sharedPage.getByRole('button', { name: 'Gast hinzufügen' }).click(); await sharedPage.getByRole("button", { name: "Gast hinzufügen" }).click();
await expect(sharedPage.locator('body')).toContainText('Erfolgreich angemeldet!'); await expect(sharedPage.locator("body")).toContainText(
await sharedPage.getByRole('link', { name: 'Details' }).click(); "Erfolgreich angemeldet!",
await expect(sharedPage.locator('#sidebar')).toContainText('Freie Plätze: 4'); );
await expect(sharedPage.locator('#sidebar')).toContainText('Mein Gast (Gast) Abmelden'); await sharedPage.getByRole("link", { name: "Details" }).click();
await expect(sharedPage.getByRole('link', { name: 'Termin löschen' })).not.toBeVisible(); await expect(sharedPage.locator("#sidebar")).toContainText(
"Freie Plätze: 4",
);
await expect(sharedPage.locator("#sidebar")).toContainText(
"Mein Gast (Gast) Abmelden",
);
await expect(
sharedPage.getByRole("link", { name: "Termin löschen" }),
).not.toBeVisible();
await sharedPage.getByRole('link', { name: 'Abmelden' }).click(); await sharedPage.getByRole("link", { name: "Abmelden" }).click();
await expect(sharedPage.locator('body')).toContainText('Erfolgreich abgemeldet!'); await expect(sharedPage.locator("body")).toContainText(
await sharedPage.getByRole('link', { name: 'Details' }).click(); "Erfolgreich abgemeldet!",
await expect(sharedPage.locator('#sidebar')).toContainText('Freie Plätze: 5'); );
await expect(sharedPage.locator('#sidebar')).toContainText('Keine Ruderer angemeldet'); await sharedPage.getByRole("link", { name: "Details" }).click();
await expect(sharedPage.getByRole('link', { name: 'Termin löschen' })).toBeVisible(); await expect(sharedPage.locator("#sidebar")).toContainText(
"Freie Plätze: 5",
);
await expect(sharedPage.locator("#sidebar")).toContainText(
"Keine Ruderer angemeldet",
);
await expect(
sharedPage.getByRole("link", { name: "Termin löschen" }),
).toBeVisible();
await sharedPage.getByRole('button', { name: 'Ausfahrt erstellen schließen' }).click(); await sharedPage
.getByRole("button", { name: "Ausfahrt erstellen schließen" })
.click();
}); });
test('change amount rower', async () => { test("change amount rower", async () => {
await sharedPage.goto('http://localhost:8000/planned'); await sharedPage.goto("/planned");
await sharedPage.getByRole('link', { name: 'Details' }).click(); await sharedPage.getByRole("link", { name: "Details" }).click();
await expect(sharedPage.locator('#sidebar')).toContainText('Freie Plätze: 5'); await expect(sharedPage.locator("#sidebar")).toContainText(
await sharedPage.getByRole('spinbutton').click(); "Freie Plätze: 5",
await sharedPage.getByRole('spinbutton').fill('3'); );
await sharedPage.getByRole('button', { name: 'Speichern' }).click(); await sharedPage.getByRole("spinbutton").click();
await expect(sharedPage.locator('body')).toContainText('Ausfahrt erfolgreich aktualisiert.'); await sharedPage.getByRole("spinbutton").fill("3");
await sharedPage.getByRole("button", { name: "Speichern" }).click();
await expect(sharedPage.locator("body")).toContainText(
"Ausfahrt erfolgreich aktualisiert.",
);
}); });
test('call off trip', async () => { test("call off trip", async () => {
await sharedPage.goto('http://localhost:8000/planned'); await sharedPage.goto("/planned");
await sharedPage.getByRole('link', { name: 'Details' }).click(); await sharedPage.getByRole("link", { name: "Details" }).click();
await expect(sharedPage.locator('#sidebar')).toContainText('Freie Plätze: 5'); await expect(sharedPage.locator("#sidebar")).toContainText(
await sharedPage.getByRole('spinbutton').click(); "Freie Plätze: 3",
await sharedPage.getByRole('spinbutton').fill('0'); );
await sharedPage.getByRole('button', { name: 'Speichern' }).click(); await sharedPage.getByRole("spinbutton").click();
await expect(sharedPage.locator('body')).toContainText('Ausfahrt erfolgreich aktualisiert.'); await sharedPage.getByRole("spinbutton").fill("0");
await expect(sharedPage.locator('body')).toContainText('(Absage cox )'); await sharedPage.getByRole("button", { name: "Speichern" }).click();
await expect(sharedPage.locator("body")).toContainText(
"Ausfahrt erfolgreich aktualisiert.",
);
await expect(sharedPage.locator("body")).toContainText("(Absage cox)");
}); });
test.afterEach(async () => { test.afterAll(async () => {
await sharedPage.goto('http://localhost:8000/planned'); await sharedPage.goto("/planned");
await sharedPage.getByRole('link', { name: 'Details' }).click(); await sharedPage.getByRole("link", { name: "Details" }).click();
await sharedPage.getByRole('link', { name: 'Termin löschen' }).click(); await sharedPage.getByRole("link", { name: "Termin löschen" }).click();
await sharedPage.close(); await sharedPage.close();
}); });

View File

@ -1,69 +1,184 @@
import { test, expect } from '@playwright/test'; import { test, expect } from "@playwright/test";
test('Cox can start and cancel trip', async ({ page }, testInfo) => { test("Cox can start and cancel trip", async ({ page }, testInfo) => {
await page.goto('http://localhost:8000/auth'); await page.goto("/auth");
await page.getByPlaceholder('Name').click(); await page.getByPlaceholder("Name").click();
await page.getByPlaceholder('Name').fill('cox2'); await page.getByPlaceholder("Name").fill("cox2");
await page.getByPlaceholder('Name').press('Tab'); await page.getByPlaceholder("Name").press("Tab");
await page.getByPlaceholder('Passwort').fill('cox'); await page.getByPlaceholder("Passwort").fill("cox");
await page.getByPlaceholder('Passwort').press('Enter'); await page.getByPlaceholder("Passwort").press("Enter");
await page.goto('http://localhost:8000/'); await page.goto("/");
await page.getByRole('link', { name: 'Ausfahrt eintragen' }).click(); await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
if (testInfo.project.name.includes('Mobile')) { // No left boat selector on mobile views if (testInfo.project.name.includes("Mobile")) {
await page.getByText('Kaputtes Boot :-( (7 x)').nth(1).click(); // No left boat selector on mobile views
await page.getByRole('option', { name: 'Joe' }).click(); await page.getByText("Kaputtes Boot :-( (7 x)").nth(1).click();
} else{ await page.getByRole("option", { name: "Joe" }).click();
await page.getByText('Joe', { exact: true }).click(); } else {
await page.getByText("Joe", { exact: true }).click();
} }
await page.getByPlaceholder('Ruderer auswählen').click(); await page.getByPlaceholder("Ruderer auswählen").click();
await page.getByRole('option', { name: 'rower2' }).click(); await page.getByRole("option", { name: "rower2" }).click();
await page.getByRole('option', { name: 'cox2' }).click(); await page.getByRole("option", { name: "cox2" }).click();
await expect(page.getByRole('listbox')).toContainText('Nur 2 Ruderer können hinzugefügt werden'); await expect(page.getByRole("listbox")).toContainText(
await expect(page.locator('#shipmaster-newrowerjs')).toContainText('cox'); "Nur 2 Ruderer können hinzugefügt werden",
await expect(page.locator('#steering_person-newrowerjs')).toContainText('rower2 cox'); );
await page.getByRole('button', { name: 'Ausfahrt eintragen' }).click(); await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
await expect(page.locator('body')).toContainText('Ausfahrt erfolgreich hinzugefügt'); await expect(page.locator("#steering_person-newrowerjs")).toContainText(
await expect(page.locator('body')).toContainText('Joe'); "rower2 cox",
);
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
await expect(page.locator("body")).toContainText(
"Ausfahrt erfolgreich hinzugefügt",
);
await expect(page.locator("body")).toContainText("Joe");
await page.getByRole('link', { name: 'Joe' }).click(); await page.getByRole("link", { name: "Joe" }).click();
page.once('dialog', dialog => { page.once("dialog", (dialog) => {
dialog.accept().catch(() => {}); dialog.accept().catch(() => {});
}); });
await page.getByRole('link', { name: 'Löschen' }).click(); await page.getByRole("link", { name: "Löschen" }).click();
}); });
test('Cox can start and finish trip', async ({ page }, testInfo) => { test("Cox can start and finish trip", async ({ page }, testInfo) => {
await page.goto('http://localhost:8000/auth'); await page.goto("/auth");
await page.getByPlaceholder('Name').click(); await page.getByPlaceholder("Name").click();
await page.getByPlaceholder('Name').fill('cox2'); await page.getByPlaceholder("Name").fill("cox2");
await page.getByPlaceholder('Name').press('Tab'); await page.getByPlaceholder("Name").press("Tab");
await page.getByPlaceholder('Passwort').fill('cox'); await page.getByPlaceholder("Passwort").fill("cox");
await page.getByPlaceholder('Passwort').press('Enter'); await page.getByPlaceholder("Passwort").press("Enter");
await page.goto('http://localhost:8000/'); await page.goto("/");
await page.getByRole('link', { name: 'Ausfahrt eintragen' }).click(); await page.getByRole("link", { name: "Ausfahrt eintragen" }).click();
if (testInfo.project.name.includes('Mobile')) { // No left boat selector on mobile views if (testInfo.project.name.includes("Mobile")) {
await page.getByText('Kaputtes Boot :-( (7 x)').nth(1).click(); // No left boat selector on mobile views
await page.getByRole('option', { name: 'Joe' }).click(); await page.getByText("Kaputtes Boot :-( (7 x)").nth(1).click();
} else{ await page.getByRole("option", { name: "Joe" }).click();
await page.getByText('Joe', { exact: true }).click(); } else {
await page.getByText("Joe", { exact: true }).click();
} }
await page.getByPlaceholder('Ruderer auswählen').click(); await page.getByPlaceholder("Ruderer auswählen").click();
await page.getByRole('option', { name: 'rower2' }).click(); await page.getByRole("option", { name: "rower2" }).click();
await page.getByRole('option', { name: 'cox2' }).click(); await page.getByRole("option", { name: "cox2" }).click();
await expect(page.getByRole('listbox')).toContainText('Nur 2 Ruderer können hinzugefügt werden'); await expect(page.getByRole("listbox")).toContainText(
await expect(page.locator('#shipmaster-newrowerjs')).toContainText('cox'); "Nur 2 Ruderer können hinzugefügt werden",
await expect(page.locator('#steering_person-newrowerjs')).toContainText('rower2 cox'); );
await page.getByRole('button', { name: 'Ausfahrt eintragen' }).click(); await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
await expect(page.locator('body')).toContainText('Ausfahrt erfolgreich hinzugefügt'); await expect(page.locator("#steering_person-newrowerjs")).toContainText(
await expect(page.locator('body')).toContainText('Joe'); "rower2 cox",
);
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
await expect(page.locator("body")).toContainText(
"Ausfahrt erfolgreich hinzugefügt",
);
await expect(page.locator("body")).toContainText("Joe");
await page.goto('http://localhost:8000/log'); await page.goto("/log");
await page.waitForTimeout(60000); await page.locator("div:nth-child(2) > .border-0").click();
await page.locator('div:nth-child(2) > .border-0').click();
await page.getByRole('combobox', { name: 'Destination' }).click(); // Add a minute
await page.getByRole('combobox', { name: 'Destination' }).fill('Ottensheim'); const datetimeSelector = '#arrivaljs';
await page.getByRole('button', { name: 'Ausfahrt beenden' }).click(); const currentValue = await page.$eval(datetimeSelector, el => el.value);
await expect(page.locator('body')).toContainText('Ausfahrt korrekt eingetragen'); const currentDate = new Date(currentValue);
currentDate.setMinutes(currentDate.getMinutes() + 1);
currentDate.setHours(currentDate.getHours() + 1);
const newDatetime = currentDate.toISOString().slice(0, 16);
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
await page.getByRole("combobox", { name: "Destination" }).click();
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
await page.getByRole("button", { name: "Ausfahrt beenden" }).click();
await expect(page.locator("body")).toContainText(
"Ausfahrt korrekt eingetragen",
);
await page.goto('/log/show');
await expect(page.locator('body')).toContainText('Joe');
await expect(page.locator('body')).toContainText('(cox2)');
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
});
test("Kiosk can start and cancel trip", async ({ page }, testInfo) => {
await page.goto("/log/kiosk/ekrv2019/Linz");
if (testInfo.project.name.includes("Mobile")) {
// No left boat selector on mobile views
await page.getByText("Kaputtes Boot :-( (7 x)").nth(1).click();
await page.getByRole("option", { name: "Joe" }).click();
} else {
await page.getByText("Joe", { exact: true }).click();
}
await page.getByPlaceholder("Ruderer auswählen").click();
await page.getByRole("option", { name: "rower2" }).click();
await page.getByRole("option", { name: "cox2" }).click();
await expect(page.getByRole("listbox")).toContainText(
"Nur 2 Ruderer können hinzugefügt werden",
);
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
"rower2 cox",
);
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
await expect(page.locator("body")).toContainText(
"Ausfahrt erfolgreich hinzugefügt",
);
await expect(page.locator("body")).toContainText("Joe");
await page.getByRole("link", { name: "Joe" }).click();
page.once("dialog", (dialog) => {
dialog.accept().catch(() => {});
});
await page.getByRole("link", { name: "Löschen" }).click();
});
test("Kiosk can start and finish trip", async ({ page }, testInfo) => {
await page.goto("/log/kiosk/ekrv2019/Linz");
if (testInfo.project.name.includes("Mobile")) {
// No left boat selector on mobile views
await page.getByText("Kaputtes Boot :-( (7 x)").nth(1).click();
await page.getByRole("option", { name: "Joe" }).click();
} else {
await page.getByText("Joe", { exact: true }).click();
}
await page.getByPlaceholder("Ruderer auswählen").click();
await page.getByRole("option", { name: "rower2" }).click();
await page.getByRole("option", { name: "cox2" }).click();
await expect(page.getByRole("listbox")).toContainText(
"Nur 2 Ruderer können hinzugefügt werden",
);
await expect(page.locator("#shipmaster-newrowerjs")).toContainText("cox");
await expect(page.locator("#steering_person-newrowerjs")).toContainText(
"rower2 cox",
);
await page.getByRole("button", { name: "Ausfahrt eintragen" }).click();
await expect(page.locator("body")).toContainText(
"Ausfahrt erfolgreich hinzugefügt",
);
await expect(page.locator("body")).toContainText("Joe");
await page.goto("/log");
await page.locator('div:nth-child(2) > .pt-2 > div > div > div:nth-child(2) > .border-0').click(); // 2 trips currently running, try to close second one
// Add a minute
const datetimeSelector = '#arrivaljs';
const currentValue = await page.$eval(datetimeSelector, el => el.value);
const currentDate = new Date(currentValue);
currentDate.setMinutes(currentDate.getMinutes() + 1);
currentDate.setHours(currentDate.getHours() + 1);
const newDatetime = currentDate.toISOString().slice(0, 16);
await page.$eval(datetimeSelector, (el, value) => el.value = value, newDatetime);
await page.getByRole("combobox", { name: "Destination" }).click();
await page.getByRole("combobox", { name: "Destination" }).fill("Ottensheim");
await page.getByRole("button", { name: "Ausfahrt beenden" }).click();
await expect(page.locator("body")).toContainText(
"Ausfahrt korrekt eingetragen",
);
await page.getByRole('link', { name: 'Logbuch' }).click();
await expect(page.locator('body')).toContainText('Joe');
await expect(page.locator('body')).toContainText('(cox2)');
await expect(page.locator('body')).toContainText('Ottensheim (25 km)');
await expect(page.locator('body')).toContainText('Ruderer: cox2, rower2');
}); });

View File

@ -15,5 +15,6 @@
"noUnusedParameters": true, "noUnusedParameters": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"skipLibCheck": true "skipLibCheck": true
} },
"exclude": ["tests/"]
} }

View File

@ -141,6 +141,15 @@ CREATE TABLE IF NOT EXISTS "boat_damage" (
"lock_boat" boolean not null default false -- if true: noone can use the boat "lock_boat" boolean not null default false -- if true: noone can use the boat
); );
CREATE TABLE IF NOT EXISTS "boathouse" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"boat_id" INTEGER NOT NULL REFERENCES boat(id),
"aisle" TEXT NOT NULL CHECK (aisle in ('water', 'middle', 'mountain')),
"side" TEXT NOT NULL CHECK(side IN ('mountain', 'water')),
"level" INTEGER NOT NULL CHECK(level BETWEEN 0 AND 3),
CONSTRAINT unq UNIQUE (aisle, side, level) -- only 1 boat allowed to rest at each space
);
CREATE TABLE IF NOT EXISTS "notification" ( CREATE TABLE IF NOT EXISTS "notification" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"user_id" INTEGER NOT NULL REFERENCES user(id), "user_id" INTEGER NOT NULL REFERENCES user(id),

View File

@ -5,6 +5,8 @@ INSERT INTO "role" (name) VALUES ('tech');
INSERT INTO "role" (name) VALUES ('Donau Linz'); INSERT INTO "role" (name) VALUES ('Donau Linz');
INSERT INTO "role" (name) VALUES ('planned_event'); INSERT INTO "role" (name) VALUES ('planned_event');
INSERT INTO "role" (name) VALUES ('Rennrudern'); INSERT INTO "role" (name) VALUES ('Rennrudern');
INSERT INTO "role" (name) VALUES ('paid');
INSERT INTO "role" (name) VALUES ('Vorstand');
INSERT INTO "user" (name, pw) VALUES('admin', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$4P4NCw4Ukhv80/eQYTsarHhnw61JuL1KMx/L9dm82YM'); INSERT INTO "user" (name, pw) VALUES('admin', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$4P4NCw4Ukhv80/eQYTsarHhnw61JuL1KMx/L9dm82YM');
INSERT INTO "user_role" (user_id, role_id) VALUES(1,1); INSERT INTO "user_role" (user_id, role_id) VALUES(1,1);
INSERT INTO "user_role" (user_id, role_id) VALUES(1,2); INSERT INTO "user_role" (user_id, role_id) VALUES(1,2);
@ -18,6 +20,7 @@ INSERT INTO "user_role" (user_id, role_id) VALUES(3,3);
INSERT INTO "user" (name, pw) VALUES('cox', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$lnWzHx3DdqS9GQyWYel82kIotZuK2wk9EyfhPFtjNzs'); INSERT INTO "user" (name, pw) VALUES('cox', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$lnWzHx3DdqS9GQyWYel82kIotZuK2wk9EyfhPFtjNzs');
INSERT INTO "user_role" (user_id, role_id) VALUES(4,5); INSERT INTO "user_role" (user_id, role_id) VALUES(4,5);
INSERT INTO "user_role" (user_id, role_id) VALUES(4,2); INSERT INTO "user_role" (user_id, role_id) VALUES(4,2);
INSERT INTO "user_role" (user_id, role_id) VALUES(4,8);
INSERT INTO "user" (name) VALUES('new'); INSERT INTO "user" (name) VALUES('new');
INSERT INTO "user_role" (user_id, role_id) VALUES(5,5); INSERT INTO "user_role" (user_id, role_id) VALUES(5,5);
INSERT INTO "user" (name, pw) VALUES('cox2', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$lnWzHx3DdqS9GQyWYel82kIotZuK2wk9EyfhPFtjNzs'); INSERT INTO "user" (name, pw) VALUES('cox2', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$lnWzHx3DdqS9GQyWYel82kIotZuK2wk9EyfhPFtjNzs');
@ -28,6 +31,9 @@ INSERT INTO "user_role" (user_id, role_id) VALUES(7,5);
INSERT INTO "user" (name, pw) VALUES('teen', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$jWKzDmI0jqT2dqINFt6/1NjVF4Dx15n07PL1ZMBmFsY'); INSERT INTO "user" (name, pw) VALUES('teen', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$jWKzDmI0jqT2dqINFt6/1NjVF4Dx15n07PL1ZMBmFsY');
INSERT INTO "user_role" (user_id, role_id) VALUES(8,5); INSERT INTO "user_role" (user_id, role_id) VALUES(8,5);
INSERT INTO "user_role" (user_id, role_id) VALUES(8,7); INSERT INTO "user_role" (user_id, role_id) VALUES(8,7);
INSERT INTO "user" (name, pw) VALUES('Vorstandsmitglied', '$argon2id$v=19$m=19456,t=2,p=1$dS/X5/sPEKTj4Rzs/CuvzQ$jWKzDmI0jqT2dqINFt6/1NjVF4Dx15n07PL1ZMBmFsY');
INSERT INTO "user_role" (user_id, role_id) VALUES(9,5);
INSERT INTO "user_role" (user_id, role_id) VALUES(9,9);
INSERT INTO "trip_details" (planned_starting_time, max_people, day, notes) VALUES('10:00', 2, '1970-01-01', 'trip_details for a planned event'); INSERT INTO "trip_details" (planned_starting_time, max_people, day, notes) VALUES('10:00', 2, '1970-01-01', 'trip_details for a planned event');
INSERT INTO "planned_event" (name, planned_amount_cox, trip_details_id) VALUES('test-planned-event', 2, 1); INSERT INTO "planned_event" (name, planned_amount_cox, trip_details_id) VALUES('test-planned-event', 2, 1);

View File

@ -181,6 +181,41 @@ ORDER BY amount_seats DESC
Self::boats_to_details(db, boats).await Self::boats_to_details(db, boats).await
} }
pub async fn all_for_boatshouse(db: &SqlitePool) -> Vec<BoatWithDetails> {
let boats = sqlx::query_as!(
Boat,
"
SELECT
b.id,
b.name,
b.amount_seats,
b.location_id,
b.owner,
b.year_built,
b.boatbuilder,
b.default_shipmaster_only_steering,
b.default_destination,
b.skull,
b.external
FROM
boat AS b
LEFT JOIN
boathouse AS bh ON b.id = bh.boat_id
WHERE
b.external = false
AND b.location_id = (SELECT id FROM location WHERE name = 'Linz')
AND bh.id IS NULL -- This ensures the boat does not have an entry in the boathouse table
ORDER BY
b.name DESC;
"
)
.fetch_all(db)
.await
.unwrap(); //TODO: fixme
Self::boats_to_details(db, boats).await
}
pub async fn for_user(db: &SqlitePool, user: &User) -> Vec<BoatWithDetails> { pub async fn for_user(db: &SqlitePool, user: &User) -> Vec<BoatWithDetails> {
if user.has_role(db, "admin").await { if user.has_role(db, "admin").await {
return Self::all(db).await; return Self::all(db).await;

90
src/model/boathouse.rs Normal file
View File

@ -0,0 +1,90 @@
use std::collections::HashMap;
use rocket::serde::{Deserialize, Serialize};
use sqlx::{FromRow, SqlitePool};
use crate::tera::board::boathouse::FormBoathouseToAdd;
use super::boat::Boat;
#[derive(FromRow, Debug, Serialize, Deserialize)]
pub struct Boathouse {
pub id: i64,
pub boat_id: i64,
pub aisle: String,
pub side: String,
pub level: i64,
}
impl Boathouse {
pub async fn get(db: &SqlitePool) -> HashMap<&str, HashMap<&str, [Option<(i64, Boat)>; 4]>> {
let mut ret: HashMap<&str, HashMap<&str, [Option<(i64, Boat)>; 4]>> = HashMap::new();
let mut mountain = HashMap::new();
mountain.insert("mountain", [None, None, None, None]);
mountain.insert("water", [None, None, None, None]);
ret.insert("mountain-aisle", mountain);
let mut middle = HashMap::new();
middle.insert("mountain", [None, None, None, None]);
middle.insert("water", [None, None, None, None]);
ret.insert("middle-aisle", middle);
let mut water = HashMap::new();
water.insert("mountain", [None, None, None, None]);
water.insert("water", [None, None, None, None]);
ret.insert("water-aisle", water);
let boathouses = sqlx::query_as!(
Boathouse,
"SELECT id, boat_id, aisle, side, level FROM boathouse"
)
.fetch_all(db)
.await
.unwrap(); //TODO: fixme
for boathouse in boathouses {
let aisle = ret
.get_mut(format!("{}-aisle", boathouse.aisle).as_str())
.unwrap();
let side = aisle.get_mut(boathouse.side.as_str()).unwrap();
side[boathouse.level as usize] = Some((
boathouse.id,
Boat::find_by_id(db, boathouse.boat_id as i32)
.await
.unwrap(),
));
}
ret
}
pub async fn create(db: &SqlitePool, data: FormBoathouseToAdd) -> Result<(), String> {
sqlx::query!(
"INSERT INTO boathouse(boat_id, aisle, side, level) VALUES (?,?,?,?)",
data.boat_id,
data.aisle,
data.side,
data.level
)
.execute(db)
.await
.map_err(|e| e.to_string())?;
Ok(())
}
pub async fn find_by_id(db: &SqlitePool, id: i32) -> Option<Self> {
sqlx::query_as!(Self, "SELECT * FROM boathouse WHERE id like ?", id)
.fetch_one(db)
.await
.ok()
}
pub async fn delete(&self, db: &SqlitePool) {
sqlx::query!("DELETE FROM boathouse WHERE id=?", self.id)
.execute(db)
.await
.unwrap(); //Okay, because we can only create a Boat of a valid id
}
}

View File

@ -1,6 +1,6 @@
use std::ops::DerefMut; use std::ops::DerefMut;
use chrono::{Datelike, NaiveDateTime, Utc}; use chrono::{Datelike, Local, NaiveDateTime};
use rocket::FromForm; use rocket::FromForm;
use serde::Serialize; use serde::Serialize;
use sqlx::{FromRow, Sqlite, SqlitePool, Transaction}; use sqlx::{FromRow, Sqlite, SqlitePool, Transaction};
@ -226,8 +226,44 @@ ORDER BY departure DESC
ret ret
} }
pub async fn completed_with_user(
db: &SqlitePool,
user: &User,
) -> Vec<LogbookWithBoatAndRowers> {
let logs = sqlx::query_as(
&format!("
SELECT id, boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km, comments, logtype
FROM logbook
JOIN rower ON logbook.id = rower.logbook_id
WHERE arrival is not null AND rower_id = {}
ORDER BY departure DESC
", user.id)
)
.fetch_all(db)
.await
.unwrap(); //TODO: fixme
let mut ret = Vec::new();
for log in logs {
ret.push(LogbookWithBoatAndRowers {
rowers: Rower::for_log(db, &log).await,
boat: Boat::find_by_id(db, log.boat_id as i32).await.unwrap(),
shipmaster_user: User::find_by_id(db, log.shipmaster as i32).await.unwrap(),
steering_user: User::find_by_id(db, log.steering_person as i32)
.await
.unwrap(),
logbook: log,
});
}
ret
}
pub async fn completed(db: &SqlitePool) -> Vec<LogbookWithBoatAndRowers> { pub async fn completed(db: &SqlitePool) -> Vec<LogbookWithBoatAndRowers> {
let year = chrono::Utc::now().year(); let year = chrono::Local::now().year();
Self::completed_in_year(db, year).await
}
pub async fn completed_in_year(db: &SqlitePool, year: i32) -> Vec<LogbookWithBoatAndRowers> {
let logs = sqlx::query_as( let logs = sqlx::query_as(
&format!(" &format!("
SELECT id, boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km, comments, logtype SELECT id, boat_id, shipmaster, steering_person, shipmaster_only_steering, departure, arrival, destination, distance_in_km, comments, logtype
@ -472,7 +508,7 @@ ORDER BY departure DESC
if arr.timestamp() <= dep.timestamp() { if arr.timestamp() <= dep.timestamp() {
return Err(LogbookUpdateError::ArrivalNotAfterDeparture); return Err(LogbookUpdateError::ArrivalNotAfterDeparture);
} }
let today = Utc::now().date_naive(); let today = Local::now().date_naive();
let day_diff = today - arr.date(); let day_diff = today - arr.date();
let day_diff = day_diff.num_days(); let day_diff = day_diff.num_days();
if day_diff >= 7 && !user.has_role_tx(db, "admin").await { if day_diff >= 7 && !user.has_role_tx(db, "admin").await {

View File

@ -9,6 +9,7 @@ use self::{
pub mod boat; pub mod boat;
pub mod boatdamage; pub mod boatdamage;
pub mod boathouse;
pub mod family; pub mod family;
pub mod location; pub mod location;
pub mod log; pub mod log;

View File

@ -1,4 +1,4 @@
use chrono::{DateTime, Local, NaiveDateTime, TimeZone, Utc}; use chrono::{DateTime, Local, NaiveDateTime, TimeZone};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sqlx::{FromRow, SqlitePool}; use sqlx::{FromRow, SqlitePool};

View File

@ -45,6 +45,19 @@ WHERE name like ?
.ok() .ok()
} }
pub async fn names_from_role(&self, db: &SqlitePool) -> Vec<String> {
let query = format!(
"SELECT u.name
FROM user u
JOIN user_role ur ON u.id = ur.user_id
JOIN role r ON ur.role_id = r.id
WHERE r.id = {} AND deleted=0;",
self.id
);
sqlx::query_scalar(&query).fetch_all(db).await.unwrap()
}
pub async fn mails_from_role(&self, db: &SqlitePool) -> Vec<String> { pub async fn mails_from_role(&self, db: &SqlitePool) -> Vec<String> {
let query = format!( let query = format!(
"SELECT u.mail "SELECT u.mail

View File

@ -13,7 +13,7 @@ impl Stat {
pub async fn boats(db: &SqlitePool, year: Option<i32>) -> Vec<Stat> { pub async fn boats(db: &SqlitePool, year: Option<i32>) -> Vec<Stat> {
let year = match year { let year = match year {
Some(year) => year, Some(year) => year,
None => chrono::Utc::now().year(), None => chrono::Local::now().year(),
}; };
//TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server) //TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server)
sqlx::query(&format!( sqlx::query(&format!(
@ -39,7 +39,7 @@ ORDER BY rowed_km DESC;
pub async fn guest(db: &SqlitePool, year: Option<i32>) -> Stat { pub async fn guest(db: &SqlitePool, year: Option<i32>) -> Stat {
let year = match year { let year = match year {
Some(year) => year, Some(year) => year,
None => chrono::Utc::now().year(), None => chrono::Local::now().year(),
}; };
//TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server) //TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server)
let rowed_km = sqlx::query(&format!( let rowed_km = sqlx::query(&format!(
@ -90,7 +90,7 @@ AND l.arrival LIKE '{year}-%';
pub async fn people(db: &SqlitePool, year: Option<i32>) -> Vec<Stat> { pub async fn people(db: &SqlitePool, year: Option<i32>) -> Vec<Stat> {
let year = match year { let year = match year {
Some(year) => year, Some(year) => year,
None => chrono::Utc::now().year(), None => chrono::Local::now().year(),
}; };
//TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server) //TODO: switch to query! macro again (once upgraded to sqlite 3.42 on server)
sqlx::query(&format!( sqlx::query(&format!(
@ -108,7 +108,7 @@ INNER JOIN rower r ON u.id = r.rower_id
INNER JOIN logbook l ON r.logbook_id = l.id INNER JOIN logbook l ON r.logbook_id = l.id
WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND u.name != 'Externe Steuerperson' WHERE l.distance_in_km IS NOT NULL AND l.arrival LIKE '{year}-%' AND u.name != 'Externe Steuerperson'
GROUP BY u.name GROUP BY u.name
ORDER BY rowed_km DESC; ORDER BY rowed_km DESC, u.name;
" "
)) ))
.fetch_all(db) .fetch_all(db)

View File

@ -108,6 +108,12 @@ pub struct Fee {
pub paid: bool, pub paid: bool,
} }
impl Default for Fee {
fn default() -> Self {
Self::new()
}
}
impl Fee { impl Fee {
pub fn new() -> Self { pub fn new() -> Self {
Self { Self {
@ -206,6 +212,8 @@ impl User {
} else if Family::find_by_opt_id(db, self.family_id).await.is_none() { } else if Family::find_by_opt_id(db, self.family_id).await.is_none() {
if self.has_role(db, "Student").await || self.has_role(db, "Schüler").await { if self.has_role(db, "Student").await || self.has_role(db, "Schüler").await {
fee.add("Schüler/Student".into(), STUDENT_OR_PUPIL); fee.add("Schüler/Student".into(), STUDENT_OR_PUPIL);
} else if self.has_role(db, "Ehrenmitglied").await {
fee.add("Ehrenmitglied".into(), 0);
} else { } else {
fee.add("Mitgliedsbeitrag".into(), REGULAR); fee.add("Mitgliedsbeitrag".into(), REGULAR);
} }
@ -225,28 +233,6 @@ impl User {
.count .count
} }
pub async fn rowed_km(&self, db: &SqlitePool) -> i32 {
sqlx::query!(
"SELECT COALESCE(SUM(distance_in_km),0) as rowed_km
FROM (
SELECT distance_in_km
FROM logbook
WHERE shipmaster = ?1
UNION
SELECT l.distance_in_km
FROM logbook l
INNER JOIN rower r ON r.logbook_id = l.id
WHERE r.rower_id = ?1
);",
self.id,
)
.fetch_one(db)
.await
.unwrap()
.rowed_km
}
pub async fn has_role(&self, db: &SqlitePool, role: &str) -> bool { pub async fn has_role(&self, db: &SqlitePool, role: &str) -> bool {
if sqlx::query!( if sqlx::query!(
"SELECT * FROM user_role WHERE user_id=? AND role_id = (SELECT id FROM role WHERE name = ?)", "SELECT * FROM user_role WHERE user_id=? AND role_id = (SELECT id FROM role WHERE name = ?)",
@ -266,7 +252,7 @@ impl User {
pub async fn roles(&self, db: &SqlitePool) -> Vec<String> { pub async fn roles(&self, db: &SqlitePool) -> Vec<String> {
sqlx::query!( sqlx::query!(
"SELECT r.name FROM role r JOIN user_role ur ON r.id = ur.role_id WHERE ur.user_id = ?;", "SELECT r.name FROM role r JOIN user_role ur ON r.id = ur.role_id JOIN user u ON u.id = ur.user_id WHERE ur.user_id = ? AND u.deleted = 0;",
self.id self.id
) )
.fetch_all(db) .fetch_all(db)
@ -379,6 +365,22 @@ ORDER BY last_access DESC
.unwrap() .unwrap()
} }
pub async fn all_with_role(db: &SqlitePool, role: &Role) -> Vec<Self> {
sqlx::query_as!(
Self,
"
SELECT id, name, pw, deleted, last_access, dob, weight, sex, member_since_date, birthdate, mail, nickname, notes, phone, address, family_id
FROM user u
JOIN user_role ur ON u.id = ur.user_id
WHERE ur.role_id = ? AND deleted = 0
ORDER BY name;
", role.id
)
.fetch_all(db)
.await
.unwrap()
}
pub async fn all_payer_groups(db: &SqlitePool) -> Vec<Self> { pub async fn all_payer_groups(db: &SqlitePool) -> Vec<Self> {
sqlx::query_as!( sqlx::query_as!(
Self, Self,
@ -524,6 +526,12 @@ ORDER BY last_access DESC
"m.birner", "m.birner",
"m-sageder", "m-sageder",
"a-almousa", "a-almousa",
"m.sageder",
"n.sageder",
"a.almousa",
"p.hofer",
"d.kortschak",
"[login]",
] ]
.contains(&name) .contains(&name)
{ {
@ -759,7 +767,7 @@ impl<'r> FromRequest<'r> for AdminUser {
if user.has_role(db, "admin").await { if user.has_role(db, "admin").await {
Outcome::Success(AdminUser { user }) Outcome::Success(AdminUser { user })
} else { } else {
Outcome::Error((Status::Forbidden, LoginError::NotACox)) Outcome::Forward(Status::Forbidden)
} }
} }
Outcome::Error(f) => Outcome::Error(f), Outcome::Error(f) => Outcome::Error(f),
@ -791,18 +799,18 @@ impl<'r> FromRequest<'r> for AllowedForPlannedTripsUser {
} }
} }
impl Into<User> for AllowedForPlannedTripsUser { impl From<AllowedForPlannedTripsUser> for User {
fn into(self) -> User { fn from(val: AllowedForPlannedTripsUser) -> Self {
self.0 val.0
} }
} }
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct DonauLinzUser(pub(crate) User); pub struct DonauLinzUser(pub(crate) User);
impl Into<User> for DonauLinzUser { impl From<DonauLinzUser> for User {
fn into(self) -> User { fn from(val: DonauLinzUser) -> Self {
self.0 val.0
} }
} }
@ -837,12 +845,49 @@ impl<'r> FromRequest<'r> for DonauLinzUser {
} }
} }
#[derive(Debug, Serialize, Deserialize)]
pub struct SchnupperBetreuerUser(pub(crate) User);
impl From<SchnupperBetreuerUser> for User {
fn from(val: SchnupperBetreuerUser) -> Self {
val.0
}
}
impl Deref for SchnupperBetreuerUser {
type Target = User;
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[async_trait]
impl<'r> FromRequest<'r> for SchnupperBetreuerUser {
type Error = LoginError;
async fn from_request(req: &'r Request<'_>) -> request::Outcome<Self, Self::Error> {
let db = req.rocket().state::<SqlitePool>().unwrap();
match User::from_request(req).await {
Outcome::Success(user) => {
if user.has_role(db, "schnupper-betreuer").await {
Outcome::Success(SchnupperBetreuerUser(user))
} else {
Outcome::Forward(Status::Forbidden)
}
}
Outcome::Error(f) => Outcome::Error(f),
Outcome::Forward(f) => Outcome::Forward(f),
}
}
}
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct VorstandUser(pub(crate) User); pub struct VorstandUser(pub(crate) User);
impl Into<User> for VorstandUser { impl From<VorstandUser> for User {
fn into(self) -> User { fn from(val: VorstandUser) -> Self {
self.0 val.0
} }
} }
@ -865,7 +910,7 @@ impl<'r> FromRequest<'r> for VorstandUser {
if user.has_role(db, "Vorstand").await { if user.has_role(db, "Vorstand").await {
Outcome::Success(VorstandUser(user)) Outcome::Success(VorstandUser(user))
} else { } else {
Outcome::Error((Status::Forbidden, LoginError::NotACox)) Outcome::Forward(Status::Forbidden)
} }
} }
Outcome::Error(f) => Outcome::Error(f), Outcome::Error(f) => Outcome::Error(f),
@ -877,9 +922,9 @@ impl<'r> FromRequest<'r> for VorstandUser {
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
pub struct PlannedEventUser(pub(crate) User); pub struct PlannedEventUser(pub(crate) User);
impl Into<User> for PlannedEventUser { impl From<PlannedEventUser> for User {
fn into(self) -> User { fn from(val: PlannedEventUser) -> Self {
self.0 val.0
} }
} }

View File

@ -1,14 +1,17 @@
use rocket::{get, routes, Route, State}; use csv::ReaderBuilder;
use rocket::{form::Form, get, post, routes, FromForm, Route, State};
use rocket_dyn_templates::{context, Template};
use sqlx::SqlitePool; use sqlx::SqlitePool;
use crate::{ use crate::{
model::{log::Log, user::AdminUser}, model::{log::Log, role::Role, user::AdminUser},
tera::Config, tera::Config,
}; };
pub mod boat; pub mod boat;
pub mod mail; pub mod mail;
pub mod planned_event; pub mod planned_event;
pub mod schnupper;
pub mod user; pub mod user;
#[get("/rss?<key>")] #[get("/rss?<key>")]
@ -25,12 +28,57 @@ async fn show_rss(db: &State<SqlitePool>, _admin: AdminUser) -> String {
Log::show(db).await Log::show(db).await
} }
#[get("/list")]
async fn show_list(_admin: AdminUser) -> Template {
Template::render("admin/list/index", context!())
}
#[derive(FromForm)]
struct ListForm {
list: String,
}
#[post("/list", data = "<list_form>")]
async fn list(db: &State<SqlitePool>, _admin: AdminUser, list_form: Form<ListForm>) -> Template {
let role = Role::find_by_name(db, "Donau Linz").await.unwrap();
let acceptable_users = role.names_from_role(db).await;
let mut rdr = ReaderBuilder::new()
.has_headers(true)
.delimiter(b';')
.from_reader(list_form.list.trim().as_bytes());
let mut names_not_in_acceptable_users = Vec::new();
for result in rdr.records() {
println!("{result:?}");
let record = result.unwrap();
// Concatenate Vorname and Nachname
let vorname = record.get(2).unwrap_or_default().trim();
let nachname = record.get(3).unwrap_or_default().trim();
let full_name = format!("{} {}", vorname, nachname);
// Check if the concatenated name is not in the acceptable_users vector
if !acceptable_users.contains(&full_name) {
names_not_in_acceptable_users.push(full_name);
}
}
let context = context! {
result: names_not_in_acceptable_users
};
Template::render("admin/list/result", context)
}
pub fn routes() -> Vec<Route> { pub fn routes() -> Vec<Route> {
let mut ret = Vec::new(); let mut ret = Vec::new();
ret.append(&mut user::routes()); ret.append(&mut user::routes());
ret.append(&mut schnupper::routes());
ret.append(&mut boat::routes()); ret.append(&mut boat::routes());
ret.append(&mut mail::routes()); ret.append(&mut mail::routes());
ret.append(&mut planned_event::routes()); ret.append(&mut planned_event::routes());
ret.append(&mut routes![rss, show_rss]); ret.append(&mut routes![rss, show_rss, show_list, list]);
ret ret
} }

View File

@ -0,0 +1,60 @@
use crate::model::{
role::Role,
user::{SchnupperBetreuerUser, User, UserWithRoles},
};
use futures::future::join_all;
use rocket::{
get,
http::Status,
request::{FlashMessage, FromRequest, Outcome},
routes, Request, Route, State,
};
use rocket_dyn_templates::{tera::Context, Template};
use sqlx::SqlitePool;
// Custom request guard to extract the Referer header
struct Referer(String);
#[rocket::async_trait]
impl<'r> FromRequest<'r> for Referer {
type Error = ();
async fn from_request(request: &'r Request<'_>) -> Outcome<Self, Self::Error> {
match request.headers().get_one("Referer") {
Some(referer) => Outcome::Success(Referer(referer.to_string())),
None => Outcome::Error((Status::BadRequest, ())),
}
}
}
#[get("/schnupper")]
async fn index(
db: &State<SqlitePool>,
user: SchnupperBetreuerUser,
flash: Option<FlashMessage<'_>>,
) -> Template {
let schnupperant = Role::find_by_name(db, "schnupperant").await.unwrap();
let user_futures: Vec<_> = User::all_with_role(db, &schnupperant)
.await
.into_iter()
.map(|u| async move { UserWithRoles::from_user(u, db).await })
.collect();
let users: Vec<UserWithRoles> = join_all(user_futures).await;
let mut context = Context::new();
if let Some(msg) = flash {
context.insert("flash", &msg.into_inner());
}
context.insert("schnupperanten", &users);
context.insert(
"loggedin_user",
&UserWithRoles::from_user(user.into(), db).await,
);
Template::render("admin/schnupper/index", context.into_json())
}
pub fn routes() -> Vec<Route> {
routes![index]
}

View File

@ -2,20 +2,38 @@ use std::collections::HashMap;
use crate::model::{ use crate::model::{
family::Family, family::Family,
logbook::Logbook,
role::Role, role::Role,
user::{AdminUser, User, UserWithRoles, VorstandUser}, user::{AdminUser, User, UserWithRoles, VorstandUser},
}; };
use futures::future::join_all; use futures::future::join_all;
use rocket::{ use rocket::{
form::Form, form::Form,
get, post, get,
request::FlashMessage, http::Status,
post,
request::{FlashMessage, FromRequest, Outcome},
response::{Flash, Redirect}, response::{Flash, Redirect},
routes, FromForm, Route, State, routes, FromForm, Request, Route, State,
}; };
use rocket_dyn_templates::{tera::Context, Template}; use rocket_dyn_templates::{tera::Context, Template};
use sqlx::SqlitePool; use sqlx::SqlitePool;
// Custom request guard to extract the Referer header
struct Referer(String);
#[rocket::async_trait]
impl<'r> FromRequest<'r> for Referer {
type Error = ();
async fn from_request(request: &'r Request<'_>) -> Outcome<Self, Self::Error> {
match request.headers().get_one("Referer") {
Some(referer) => Outcome::Success(Referer(referer.to_string())),
None => Outcome::Error((Status::BadRequest, ())),
}
}
}
#[get("/user")] #[get("/user")]
async fn index( async fn index(
db: &State<SqlitePool>, db: &State<SqlitePool>,
@ -49,6 +67,39 @@ async fn index(
Template::render("admin/user/index", context.into_json()) Template::render("admin/user/index", context.into_json())
} }
#[get("/user", rank = 2)]
async fn index_admin(
db: &State<SqlitePool>,
user: AdminUser,
flash: Option<FlashMessage<'_>>,
) -> Template {
let user_futures: Vec<_> = User::all(db)
.await
.into_iter()
.map(|u| async move { UserWithRoles::from_user(u, db).await })
.collect();
let user: User = user.user;
let allowed_to_edit = user.has_role(db, "admin").await;
let users: Vec<UserWithRoles> = join_all(user_futures).await;
let roles = Role::all(db).await;
let families = Family::all_with_members(db).await;
let mut context = Context::new();
if let Some(msg) = flash {
context.insert("flash", &msg.into_inner());
}
context.insert("allowed_to_edit", &allowed_to_edit);
context.insert("users", &users);
context.insert("roles", &roles);
context.insert("families", &families);
context.insert("loggedin_user", &UserWithRoles::from_user(user, db).await);
Template::render("admin/user/index", context.into_json())
}
#[get("/user/fees")] #[get("/user/fees")]
async fn fees( async fn fees(
db: &State<SqlitePool>, db: &State<SqlitePool>,
@ -78,11 +129,43 @@ async fn fees(
Template::render("admin/user/fees", context.into_json()) Template::render("admin/user/fees", context.into_json())
} }
#[get("/user/scheckbuch")]
async fn scheckbuch(
db: &State<SqlitePool>,
user: VorstandUser,
flash: Option<FlashMessage<'_>>,
) -> Template {
let mut context = Context::new();
let scheckbooks = Role::find_by_name(db, "scheckbuch").await.unwrap();
let scheckbooks = User::all_with_role(db, &scheckbooks).await;
let mut scheckbooks_with_roles = Vec::new();
for s in scheckbooks {
scheckbooks_with_roles.push((
Logbook::completed_with_user(db, &s).await,
UserWithRoles::from_user(s, db).await,
))
}
context.insert("scheckbooks", &scheckbooks_with_roles);
if let Some(msg) = flash {
context.insert("flash", &msg.into_inner());
}
context.insert(
"loggedin_user",
&UserWithRoles::from_user(user.into(), db).await,
);
Template::render("admin/user/scheckbuch", context.into_json())
}
#[get("/user/fees/paid?<user_ids>")] #[get("/user/fees/paid?<user_ids>")]
async fn fees_paid( async fn fees_paid(
db: &State<SqlitePool>, db: &State<SqlitePool>,
_admin: AdminUser, _admin: AdminUser,
user_ids: Vec<i32>, user_ids: Vec<i32>,
referer: Referer,
) -> Flash<Redirect> { ) -> Flash<Redirect> {
let mut res = String::new(); let mut res = String::new();
for user_id in user_ids { for user_id in user_ids {
@ -100,7 +183,7 @@ async fn fees_paid(
res.truncate(res.len() - 3); // remove ' + ' from the end res.truncate(res.len() - 3); // remove ' + ' from the end
Flash::success( Flash::success(
Redirect::to("/admin/user/fees"), Redirect::to(referer.0),
format!("Zahlungsstatus von {} erfolgreich geändert", res), format!("Zahlungsstatus von {} erfolgreich geändert", res),
) )
} }
@ -193,5 +276,15 @@ async fn create(
} }
pub fn routes() -> Vec<Route> { pub fn routes() -> Vec<Route> {
routes![index, resetpw, update, create, delete, fees, fees_paid] routes![
index,
index_admin,
resetpw,
update,
create,
delete,
fees,
fees_paid,
scheckbuch
]
} }

View File

@ -0,0 +1,85 @@
use crate::model::{
boat::Boat,
boathouse::Boathouse,
user::{AdminUser, UserWithRoles, VorstandUser},
};
use rocket::{
form::Form,
get, post,
request::FlashMessage,
response::{Flash, Redirect},
routes, FromForm, Route, State,
};
use rocket_dyn_templates::{tera::Context, Template};
use sqlx::SqlitePool;
#[get("/boathouse")]
async fn index(
db: &State<SqlitePool>,
admin: VorstandUser,
flash: Option<FlashMessage<'_>>,
) -> Template {
let mut context = Context::new();
if let Some(msg) = flash {
context.insert("flash", &msg.into_inner());
}
let boats = Boat::all_for_boatshouse(db).await;
context.insert("boats", &boats);
let boathouse = Boathouse::get(db).await;
context.insert("boathouse", &boathouse);
context.insert(
"loggedin_user",
&UserWithRoles::from_user(admin.into(), db).await,
);
Template::render("board/boathouse", context.into_json())
}
#[derive(FromForm)]
pub struct FormBoathouseToAdd {
pub boat_id: i32,
pub aisle: String,
pub side: String,
pub level: i32,
}
#[post("/boathouse", data = "<data>")]
async fn new<'r>(
db: &State<SqlitePool>,
data: Form<FormBoathouseToAdd>,
_admin: AdminUser,
) -> Flash<Redirect> {
match Boathouse::create(db, data.into_inner()).await {
Ok(_) => Flash::success(Redirect::to("/board/boathouse"), "Boot hinzugefügt"),
Err(e) => Flash::error(Redirect::to("/board/boathouse"), e),
}
}
#[get("/boathouse/<boathouse_id>/delete")]
async fn delete(db: &State<SqlitePool>, _admin: AdminUser, boathouse_id: i32) -> Flash<Redirect> {
let boat = Boathouse::find_by_id(db, boathouse_id).await;
match boat {
Some(boat) => {
boat.delete(db).await;
Flash::success(Redirect::to("/board/boathouse"), "Bootsplatz gelöscht")
}
None => Flash::error(Redirect::to("/board/boathouse"), "Boatplace does not exist"),
}
}
//#[post("/boat/new", data = "<data>")]
//async fn create(
// db: &State<SqlitePool>,
// data: Form<BoatToAdd<'_>>,
// _admin: AdminUser,
//) -> Flash<Redirect> {
// match Boat::create(db, data.into_inner()).await {
// Ok(_) => Flash::success(Redirect::to("/admin/boat"), "Boot hinzugefügt"),
// Err(e) => Flash::error(Redirect::to("/admin/boat"), e),
// }
//}
pub fn routes() -> Vec<Route> {
routes![index, new, delete]
}

9
src/tera/board/mod.rs Normal file
View File

@ -0,0 +1,9 @@
use rocket::Route;
pub mod boathouse;
pub fn routes() -> Vec<Route> {
let mut ret = Vec::new();
ret.append(&mut boathouse::routes());
ret
}

View File

@ -23,7 +23,7 @@ use crate::model::{
LogbookUpdateError, LogbookUpdateError,
}, },
logtype::LogType, logtype::LogType,
user::{DonauLinzUser, User, UserWithRoles, UserWithWaterStatus}, user::{AdminUser, DonauLinzUser, User, UserWithRoles, UserWithWaterStatus},
}; };
pub struct KioskCookie(String); pub struct KioskCookie(String);
@ -86,7 +86,7 @@ async fn index(
Template::render("log", context.into_json()) Template::render("log", context.into_json())
} }
#[get("/show", rank = 2)] #[get("/show", rank = 3)]
async fn show(db: &State<SqlitePool>, user: DonauLinzUser) -> Template { async fn show(db: &State<SqlitePool>, user: DonauLinzUser) -> Template {
let logs = Logbook::completed(db).await; let logs = Logbook::completed(db).await;
@ -96,6 +96,16 @@ async fn show(db: &State<SqlitePool>, user: DonauLinzUser) -> Template {
) )
} }
#[get("/show?<year>", rank = 2)]
async fn show_for_year(db: &State<SqlitePool>, user: AdminUser, year: i32) -> Template {
let logs = Logbook::completed_in_year(db, year).await;
Template::render(
"log.completed",
context!(logs, loggedin_user: &UserWithRoles::from_user(user.user, db).await),
)
}
#[get("/show")] #[get("/show")]
async fn show_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template { async fn show_kiosk(db: &State<SqlitePool>, _kiosk: KioskCookie) -> Template {
let logs = Logbook::completed(db).await; let logs = Logbook::completed(db).await;
@ -378,6 +388,7 @@ pub fn routes() -> Vec<Route> {
new_kiosk, new_kiosk,
show, show,
show_kiosk, show_kiosk,
show_for_year,
delete, delete,
delete_kiosk delete_kiosk
] ]

View File

@ -21,6 +21,7 @@ use crate::model::user::{User, UserWithRoles};
pub(crate) mod admin; pub(crate) mod admin;
mod auth; mod auth;
pub(crate) mod board;
mod boatdamage; mod boatdamage;
mod cox; mod cox;
mod ergo; mod ergo;
@ -89,6 +90,7 @@ pub fn config(rocket: Rocket<Build>) -> Rocket<Build> {
.mount("/boatdamage", boatdamage::routes()) .mount("/boatdamage", boatdamage::routes())
.mount("/cox", cox::routes()) .mount("/cox", cox::routes())
.mount("/admin", admin::routes()) .mount("/admin", admin::routes())
.mount("/board", board::routes())
.mount("/", misc::routes()) .mount("/", misc::routes())
.mount("/public", FileServer::from("static/")) .mount("/public", FileServer::from("static/"))
.register("/", catchers![unauthorized_error, forbidden_error]) .register("/", catchers![unauthorized_error, forbidden_error])

View File

@ -10,6 +10,7 @@ use tera::Context;
use crate::model::{ use crate::model::{
log::Log, log::Log,
logbook::Logbook,
tripdetails::TripDetails, tripdetails::TripDetails,
triptype::TripType, triptype::TripType,
user::{AllowedForPlannedTripsUser, User, UserWithRoles}, user::{AllowedForPlannedTripsUser, User, UserWithRoles},
@ -31,6 +32,11 @@ async fn index(
context.insert("trip_types", &triptypes); context.insert("trip_types", &triptypes);
} }
if user.has_role(db, "scheckbuch").await {
let last_trips = Logbook::completed_with_user(db, &user).await;
context.insert("last_trips", &last_trips);
}
let days = user.get_days(db).await; let days = user.get_days(db).await;
if let Some(msg) = flash { if let Some(msg) = flash {

View File

@ -1,21 +1,10 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/boat" as boat %} {% import "includes/forms/boat" as boat %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
{% if flash %} <div class="max-w-screen-lg w-full">
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <h1 class="h1">Boats</h1>
{% endif %} {{ boat::new() }}
{% for boat in boats %}{{ boat::edit(boat=boat, uuid=loop.index) }}{% endfor %}
<div class="max-w-screen-lg w-full"> </div>
<h1 class="h1">Boats</h1>
{{ boat::new() }}
{% for boat in boats %}
{{ boat::edit(boat=boat, uuid=loop.index) }}
{% endfor %}
</div>
{% endblock content %} {% endblock content %}

View File

@ -0,0 +1,11 @@
{% import "includes/macros" as macros %}
{% extends "base" %}
{% block content %}
<div class="max-w-screen-lg w-full">
<h1 class="h1">List</h1>
<form action="/admin/list" method="post">
<textarea name="list" rows="4" cols="50"></textarea>
<input type="submit" />
</form>
</div>
{% endblock content %}

View File

@ -0,0 +1,10 @@
{% import "includes/macros" as macros %}
{% extends "base" %}
{% block content %}
<div class="max-w-screen-lg w-full">
<h1 class="h1">List - Result</h1>
<ol>
{% for person in result %}<li>{{ person }}</li>{% endfor %}
</ol>
</div>
{% endblock content %}

View File

@ -1,27 +1,17 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/boat" as boat %} {% import "includes/forms/boat" as boat %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
{% if flash %} <div class="max-w-screen-lg w-full">
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <h1 class="h1">Mail</h1>
{% endif %} <form action="/admin/mail" method="post" enctype="multipart/form-data">
<select name="role_id">
<div class="max-w-screen-lg w-full"> {% for role in roles %}<option value="{{ role.id }}">{{ role.name }}</option>{% endfor %}
<h1 class="h1">Mail</h1> </select>
<form action="/admin/mail" method="post" enctype="multipart/form-data"> <input type="text" name="subject" />
<select name="role_id"> <textarea name="body" rows="4" cols="50"></textarea>
{% for role in roles %} <input type="file" name="files" multiple />
<option value="{{ role.id }}">{{ role.name }}</option> <input type="submit" />
{% endfor %} </form>
</select> </div>
<input type="text" name="subject" />
<textarea name="body" rows="4" cols="50"></textarea>
<input type="file" name="files" multiple />
<input type="submit" />
</form>
</div>
{% endblock content %} {% endblock content %}

View File

@ -0,0 +1,18 @@
{% import "includes/macros" as macros %}
{% extends "base" %}
{% block content %}
<div class="max-w-screen-lg w-full">
<h1 class="h1">Schnupper Verwaltung</h1>
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Angemeldete Personen: {{ schnupperanten | length }}</h2>
<div class="text-sm p-3">
<ol class="ms-2" style="list-style: number;">
{% for user in schnupperanten %}<li class="py-1">{{ user.name }} ({{ user.mail }} | {{ user.notes }})</li>{% endfor %}
</ol>
</div>
</div>
</div>
</div>
{% endblock content %}

View File

@ -1,47 +1,43 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"> <div class="max-w-screen-lg w-full bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5">
{% if flash %} <h1 class="h1">Gebühren</h1>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <!-- START filterBar -->
{% endif %} <div class="search-wrapper">
<label for="name" class="sr-only">Suche</label>
<h1 class="h1">Gebühren</h1> <input type="search"
name="name"
<!-- START filterBar --> id="filter-js"
<div class="search-wrapper"> class="search-bar"
<label for="name" class="sr-only">Suche</label> placeholder="Suchen nach Name" />
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Name"/> </div>
</div> <!-- END filterBar -->
<!-- END filterBar --> <div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4">
<div id="filter-result-js"
<div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4"> class="text-primary-950 dark:text-white text-right"></div>
<div id="filter-result-js" class="text-primary-950 dark:text-white text-right"></div> {% for fee in fees | sort(attribute="name") %}
<div {% if fee.paid %}style="background-color: green;"{% endif %}
{% for fee in fees | sort(attribute="name") %} data-filterable="true"
<div {% if fee.paid %} style="background-color: green;" {% endif %} data-filterable="true" data-filter="{{ fee.name }} {% if fee.paid %} has-already-paid {% else %} has-not-paid {% endif %}" class="bg-white dark:bg-primary-900 p-3 rounded-md w-full"> data-filter="{{ fee.name }} {% if fee.paid %} has-already-paid {% else %} has-not-paid {% endif %}"
<div class="grid sm:grid-cols-1 gap-3"> class="bg-white dark:bg-primary-900 p-3 rounded-md w-full">
<div style="width: 100%" class="col-span-2"> <div class="grid sm:grid-cols-1 gap-3">
<b>{{ fee.name }}</b> <div style="width: 100%" class="col-span-2">
</div> <b>{{ fee.name }}</b>
<div style="width: 100%"> </div>
{{ fee.sum_in_cents / 100 }}€: <div style="width: 100%">{{ fee.sum_in_cents / 100 }}€:</div>
</div> <div style="width: 100%">
<div style="width: 100%"> {% for p in fee.parts %}
{% for p in fee.parts %} {{ p.0 }} ({{ p.1 / 100 }}€)
{{ p.0 }} ({{ p.1 / 100 }}€) {% if not loop.last %} + {% endif %} {% if not loop.last %}+{% endif %}
{% endfor %} {% endfor %}
</div> </div>
{% if "admin" in loggedin_user.roles %} {% if "admin" in loggedin_user.roles %}
<a href="/admin/user/fees/paid?{{ fee.user_ids }}">Zahlungsstatus ändern</a> <a href="/admin/user/fees/paid?{{ fee.user_ids }}">Zahlungsstatus ändern</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div>
</div>
{% endblock content %} {% endblock content %}

View File

@ -1,98 +1,96 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
{% if flash %} <h1 class="h1">Users</h1>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {% if allowed_to_edit %}
{% endif %} <form action="/admin/user/new"
method="post"
<h1 class="h1">Users</h1> class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between">
<div class="w-full">
{% if allowed_to_edit %} <h2 class="text-md font-bold mb-2 uppercase tracking-wide">Neuen User hinzufügen</h2>
<form action="/admin/user/new" method="post" class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between"> <div class="grid md:grid-cols-3">
<div class="w-full"> <div>
<h2 class="text-md font-bold mb-2 uppercase tracking-wide">Neuen User hinzufügen</h2> <label for="name" class="sr-only">Name</label>
<div class="grid md:grid-cols-3"> <input type="text"
<div> name="name"
<label for="name" class="sr-only">Name</label> class="relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0"
<input type="text" name="name" class="relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Name"/> placeholder="Name" />
</div> </div>
</div> </div>
</div> </div>
<div class="text-right"> <div class="text-right">
<input value="Hinzufügen" type="submit" class="w-28 mt-2 sm:mt-0 rounded-md bg-primary-500 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"/> <input value="Hinzufügen"
</div> type="submit"
</form> class="w-28 mt-2 sm:mt-0 rounded-md bg-primary-500 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" />
{% endif %} </div>
</form>
<!-- START filterBar --> {% endif %}
<div class="search-wrapper"> <!-- START filterBar -->
<label for="name" class="sr-only">Suche</label> <div class="search-wrapper">
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach (Name, [yes|no]-role:<name>)"/> <label for="name" class="sr-only">Suche</label>
</div> <input type="search"
<!-- END filterBar --> name="name"
id="filter-js"
<div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4"> class="search-bar"
<div id="filter-result-js" class="text-primary-950 dark:text-white text-right"></div> placeholder="Suchen nach (Name, [yes|no]-role:<name>)" />
{% for user in users %}
<div data-filterable="true" data-filter="{{ user.name }}
{% for role in roles %}
{% if role.name in user.roles %}
yes-role:{{role.name}}
{% else %}
no-role:{{role.name}}
{% endif %}
role-{{role}}
{% endfor%}
">
<form action="/admin/user" method="post" class="bg-white dark:bg-primary-900 p-3 rounded-md w-full">
<div class="w-full grid gap-3">
<input type="hidden" name="id" value="{{ user.id }}"/>
<div class="font-bold mb-1 text-black dark:text-white">{{ user.name }}
{% if user.last_access %}
(last access:
{{ user.last_access | date }})
{% endif %}
{% if user.pw %}
<a class="block mt-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline" href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a>
{% endif %}
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3">
{% for role in roles %}
{{ macros::checkbox(label=role.name, name="roles[" ~ role.id ~ "]", id=loop.index , checked=role.name in user.roles, disabled=allowed_to_edit == false) }}
{% endfor%}
{{ macros::input(label='DOB', name='dob', id=loop.index, type="text", value=user.dob, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Weight (kg)', name='weight', id=loop.index, type="text", value=user.weight, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Sex', name='sex', id=loop.index, type="text", value=user.sex, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Mitglied seit', name='member_since_date', id=loop.index, type="text", value=user.member_since_date, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Geburtsdatum', name='birthdate', id=loop.index, type="text", value=user.birthdate, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Mail', name='mail', id=loop.index, type="text", value=user.mail, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Nickname', name='nickname', id=loop.index, type="text", value=user.nickname, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Notizen', name='notes', id=loop.index, type="text", value=user.notes, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Telefon', name='phone', id=loop.index, type="text", value=user.phone, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Adresse', name='address', id=loop.index, type="text", value=user.address, readonly=allowed_to_edit == false) }}
{% if allowed_to_edit %}
{{ macros::select(label="Familie", data=families, name='family_id', selected_id=user.family_id, display=['names'], default="Keine Familie", new_last_entry='Neue Familie anlegen') }}
{% endif %}
</div>
</div>
{% if allowed_to_edit %}
<div class="mt-3 text-right">
<a href="/admin/user/{{ user.id }}/delete" class="w-28 btn btn-alert" onclick="return confirm('Wirklich löschen?');">
{% include "includes/delete-icon" %}
Löschen
</a>
<input value="Ändern" type="submit" class="w-28 btn btn-primary ml-1"/>
</div>
{% endif %}
</form>
</div> </div>
{% endfor %} <!-- END filterBar -->
</div> <div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4">
<div id="filter-result-js"
</div> class="text-primary-950 dark:text-white text-right"></div>
{% for user in users %}
<div data-filterable="true"
data-filter="{{ user.name }} {% for role in roles %} {% if role.name in user.roles %} yes-role:{{ role.name }} {% else %} no-role:{{ role.name }} {% endif %} role-{{ role }} {% endfor %} ">
<form action="/admin/user"
method="post"
class="bg-white dark:bg-primary-900 p-3 rounded-md w-full">
<div class="w-full grid gap-3">
<input type="hidden" name="id" value="{{ user.id }}" />
<div class="font-bold mb-1 text-black dark:text-white">
{{ user.name }}
{% if user.last_access %}
(last access:
{{ user.last_access | date }})
{% endif %}
{% if user.pw %}
<a class="block mt-1 font-normal text-primary-600 dark:text-primary-200 hover:text-primary-900 dark:hover:text-primary-300 underline"
href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a>
{% endif %}
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-3">
{% for role in roles %}
{{ macros::checkbox(label=role.name, name="roles[" ~ role.id ~ "]", id=loop.index , checked=role.name in user.roles, disabled=allowed_to_edit == false) }}
{% endfor %}
{{ macros::input(label='DOB', name='dob', id=loop.index, type="text", value=user.dob, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Weight (kg)', name='weight', id=loop.index, type="text", value=user.weight, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Sex', name='sex', id=loop.index, type="text", value=user.sex, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Mitglied seit', name='member_since_date', id=loop.index, type="text", value=user.member_since_date, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Geburtsdatum', name='birthdate', id=loop.index, type="text", value=user.birthdate, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Mail', name='mail', id=loop.index, type="text", value=user.mail, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Nickname', name='nickname', id=loop.index, type="text", value=user.nickname, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Notizen', name='notes', id=loop.index, type="text", value=user.notes, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Telefon', name='phone', id=loop.index, type="text", value=user.phone, readonly=allowed_to_edit == false) }}
{{ macros::input(label='Adresse', name='address', id=loop.index, type="text", value=user.address, readonly=allowed_to_edit == false) }}
{% if allowed_to_edit %}
{{ macros::select(label="Familie", data=families, name='family_id', selected_id=user.family_id, display=['names'], default="Keine Familie", new_last_entry='Neue Familie anlegen') }}
{% endif %}
</div>
</div>
{% if allowed_to_edit %}
<div class="mt-3 text-right">
<a href="/admin/user/{{ user.id }}/delete"
class="w-28 btn btn-alert"
onclick="return confirm('Wirklich löschen?');">
{% include "includes/delete-icon" %}
Löschen
</a>
<input value="Ändern" type="submit" class="w-28 btn btn-primary ml-1" />
</div>
{% endif %}
</form>
</div>
{% endfor %}
</div>
</div>
{% endblock content %} {% endblock content %}

View File

@ -0,0 +1,42 @@
{% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %}
{% extends "base" %}
{% block content %}
<div class="max-w-screen-lg w-full bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5">
<h1 class="h1">Scheckbücher</h1>
<!-- START filterBar -->
<div class="search-wrapper">
<label for="name" class="sr-only">Suche</label>
<input type="search"
name="name"
id="filter-js"
class="search-bar"
placeholder="Suchen nach Name" />
</div>
<!-- END filterBar -->
<div class="bg-primary-100 dark:bg-primary-950 p-3 rounded-b-md grid gap-4">
<div id="filter-result-js"
class="text-primary-950 dark:text-white text-right"></div>
{% for scheckbook in scheckbooks %}
{% set user = scheckbook.1 %}
{% set trips = scheckbook.0 %}
<div {% if "paid" in user.roles %}style="background-color: green;"{% endif %}
data-filterable="true"
data-filter="{{ user.name }} {% if "paid" in user.roles %} has-already-paid {% else %} has-not-paid {% endif %}"
class="bg-white dark:bg-primary-900 p-3 rounded-md w-full">
<div class="grid sm:grid-cols-1 gap-3">
<div style="width: 100%" class="col-span-2">
<b>{{ user.name }} - Ausfahrten: {{ trips | length }}</b>
{% for trip in trips %}
<li>{{ log::show_old(log=trip, state="completed", only_ones=false, index=loop.index) }}</li>
{% endfor %}
</div>
{% if "admin" in loggedin_user.roles %}
<a href="/admin/user/fees/paid?user_ids[]={{ user.id }}">Zahlungsstatus ändern</a>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock content %}

View File

@ -1,39 +1,34 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="w-full max-w-md space-y-8"> <div class="w-full max-w-md space-y-8">
<div> <div>
<img class="mx-auto h-16 w-auto" src="https://rudernlinz.at/wp-content/uploads/2021/02/cropped-logo.png" alt="Logo Ruderassistent"> <img class="mx-auto h-16 w-auto"
<h1 class="mt-6 h1">Ruderassistent</h1> src="https://rudernlinz.at/wp-content/uploads/2021/02/cropped-logo.png"
</div> alt="Logo Ruderassistent">
<h1 class="mt-6 h1">Ruderassistent</h1>
{% if flash %} </div>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {% if flash %}{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}{% endif %}
{% endif %} <form class="mt-8 space-y-6" method="post" action="/auth">
<form class="mt-8 space-y-6" method="post" action="/auth"> <input type="hidden" name="remember" value="true">
<input type="hidden" name="remember" value="true"> <div class="-space-y-px rounded-md shadow-sm">
<div class="-space-y-px rounded-md shadow-sm"> <div>
<div> {% if name %}
{% if name %} {{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true,value=name, autofocus=true) }}
{{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true,value=name, autofocus=true) }} {% else %}
{% else %} {{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true, autofocus=true) }}
{{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true, autofocus=true) }} {% endif %}
</div>
{% endif %} <div>
</div> {{ macros::input(label='Passwort', name='password', type='password', class='rounded-b-md',hide_label=true) }}
<div> </div>
{{ macros::input(label='Passwort', name='password', type='password', class='rounded-b-md',hide_label=true) }} </div>
</div> <div>
</div> <button type="submit"
class="group relative flex w-full justify-center btn btn-primary">
<div> <span class="absolute inset-y-0 left-0 flex items-center pl-3">{% include "includes/lock-icon" %}</span>
<button type="submit" class="group relative flex w-full justify-center btn btn-primary"> Einloggen
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> </button>
{% include "includes/lock-icon" %} </div>
</span> </form>
Einloggen </div>
</button>
</div>
</form>
</div>
{% endblock content %} {% endblock content %}

View File

@ -1,30 +1,25 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="w-full max-w-md space-y-8"> <div class="w-full max-w-md space-y-8">
<h1 class="mt-6 h1">Passwort setzen</h1> <h1 class="mt-6 h1">Passwort setzen</h1>
<form class="mt-8 space-y-6" action="/auth/set-pw" method="post">
<form class="mt-8 space-y-6" action="/auth/set-pw" method="post"> <input type="hidden" name="remember" value="true">
<input type="hidden" name="remember" value="true"> <input type="hidden" name="userid" value="{{ userid }}" />
<input type="hidden" name="userid" value="{{ userid }}"/> <div class="-space-y-px rounded-md shadow-sm">
<div class="-space-y-px rounded-md shadow-sm"> <div>
<div> {{ macros::input(label='Passwort', name='password', type='password', required=true, class='rounded-t-md',hide_label=true) }}
{{ macros::input(label='Passwort', name='password', type='password', required=true, class='rounded-t-md',hide_label=true) }} </div>
</div> <div>
<div> {{ macros::input(label='Passwort bestätigen', name='password_confirm', type='password', required=true, class='rounded-b-md',hide_label=true) }}
{{ macros::input(label='Passwort bestätigen', name='password_confirm', type='password', required=true, class='rounded-b-md',hide_label=true) }} </div>
</div> </div>
</div> <div>
<button type="submit"
<div> class="group relative flex w-full justify-center btn btn-primary">
<button type="submit" class="group relative flex w-full justify-center btn btn-primary"> <span class="absolute inset-y-0 left-0 flex items-center pl-3">{% include "includes/lock-icon" %}</span>
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> Bestätigen
{% include "includes/lock-icon" %} </button>
</span> </div>
Bestätigen </form>
</button> </div>
</div>
</form>
</div>
{% endblock content %} {% endblock content %}

View File

@ -1,46 +1,45 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport"
<link rel="manifest" href="public/manifest.json"/> content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="/public/main.css"/> <link rel="manifest" href="public/manifest.json" />
<link rel="icon" type="image/x-icon" href="/public/images/favicon.ico"> <link rel="stylesheet" href="/public/main.css" />
<title>Ruderassistent - ASKÖ Ruderverein Donau Linz</title> <link rel="icon" type="image/x-icon" href="/public/images/favicon.ico">
</head> <title>Ruderassistent - ASKÖ Ruderverein Donau Linz</title>
<body class="bg-gray-100 dark:bg-black"> </head>
{% if loggedin_user %} <body class="bg-gray-100 dark:bg-black">
{{ macros::header(loggedin_user=loggedin_user) }} {% if loggedin_user %}{{ macros::header(loggedin_user=loggedin_user) }}{% endif %}
{% endif %} {% if show_kiosk_header %}
{% if show_kiosk_header %} <header class="bg-primary-900 text-white flex justify-between px-4 py-3 w-full z-10 ">
<header class="bg-primary-900 text-white flex justify-between px-4 py-3 w-full z-10 "> <div>
<div> <a href="/log">Hü</a>
<a href="/log"> </div>
<div>
</a> <a href="/log" class="px-2">Ausfahrt eintragen</a>
</div> <a href="/log/show" class="px-2">Logbuch</a>
<div> <a href="/stat" class="px-2">Statistik</a>
<a href="/log" class="px-2">Ausfahrt eintragen</a> <a href="/stat/boats" class="px-2">Bootsauswertung</a>
<a href="/log/show" class="px-2">Logbuch</a> <a href="/boatdamage" class="px-2">Bootsschaden</a>
<a href="/stat" class="px-2">Statistik</a> </div>
<a href="/stat/boats" class="px-2">Bootsauswertung</a> </header>
<a href="/boatdamage" class="px-2">Bootsschaden</a> {% endif %}
</div> <div class="flex flex-wrap min-h-screen {% if not loggedin_user and not show_kiosk_header %} items-center dark:bg-primary-900 {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8">
</header> {% if flash and loggedin_user %}
{% endif %} <div class="max-w-screen-lg w-full mb-3">
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
<div class="flex min-h-screen {%if not loggedin_user and not show_kiosk_header %} items-center dark:bg-primary-900 {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8"> {% block content %}{% endblock content %} </div>
</div> {% endif %}
{% block content %}
{% if loggedin_user %} {% endblock content %}
{% include "includes/footer" %} </div>
{% if loggedin_user %}
{% include "includes/footer" %}
{% endif %} {% endif %}
{% include "dynamics/sidebar" %} {% include "dynamics/sidebar" %}
<script src="/public/main.js"></script>
<script src="/public/main.js"></script> </body>
</body> </html>
</html> </body>
</body> </html>
</html>

View File

@ -0,0 +1,54 @@
{% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %}
{% import "includes/forms/boat" as boat %}
{% extends "base" %}
{% macro show_place(aisle_name, side_name, level) %}
<li class="truncate p-2 flex relative w-full">
{% set aisle = aisle_name ~ "-aisle" %}
{% set place = boathouse[aisle][side_name] %}
{% if place[level] %}
{{ place[level].1.name }} <a class="btn btn-primary absolute end-0" href="/board/boathouse/{{ place[level].0 }}/delete">X</a>
{% elif boats | length > 0 %}
<details>
<summary>Kein Boot</summary>
<form action="/board/boathouse" method="post" class="grid gap-3">
{{ macros::select(label="Boot", data=boats, name="boat_id", id="boat_id", display=["name", " (","amount_seats", " x)"], wrapper_class="col-span-4") }}
<input type="hidden" name="aisle" value="{{ aisle_name }}" />
<input type="hidden" name="side" value="{{ side_name }}" />
<input type="hidden" name="level" value="{{ level }}" />
<input type="submit"
class="btn btn-primary w-full col-span-4"
value="Boot eintragen" />
</form>
</details>
{% else %}
Kein Boot
{% endif %}
</li>
{% endmacro show_place %}
{% macro show_side(aisle_name, side_name) %}
<div class="{{ side_name }}-side">
<ol>
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 0) }}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 1) }}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 2) }}
{{ self::show_place(aisle_name = aisle_name, side_name = side_name, level = 3) }}
</ol>
</div>
{% endmacro show_side %}
{% macro show_aisle(name, last=false) %}
<div id="{{ name }}-aisle" class="grid grid-cols-2 gap-4 {% if not last %}md:border-r{% endif %}">
{{ self::show_side(aisle_name = name, side_name = "mountain") }}
{{ self::show_side(aisle_name = name, side_name = "water") }}
</div>
{% endmacro show_aisle %}
{% block content %}
<div class="max-w-screen-lg w-full dark:text-white">
<h1 class="h1">Bootshaus</h1>
<div class="grid md:grid-cols-3 gap-4">
{{ self::show_aisle(name = "mountain") }}
{{ self::show_aisle(name = "middle") }}
{{ self::show_aisle(name = "water", last = true) }}
</div>
</div>
{% endblock content %}

View File

@ -1,87 +1,106 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %} {% import "includes/forms/log" as log %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full">
<div class="max-w-screen-lg w-full"> <h1 class="h1">Bootschäden</h1>
<h1 class="h1">Bootschäden</h1> <h2 class="text-md font-bold tracking-wide bg-primary-900 mt-3 p-3 text-white flex justify-between items-center rounded-md">
Neuen Schaden
{% if flash %} <a href="#"
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3 mt-3") }} class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
{% endif %} data-sidebar="true"
data-trigger="sidebar"
<h2 class="text-md font-bold tracking-wide bg-primary-900 mt-3 p-3 text-white flex justify-between items-center rounded-md"> data-header="Neuen Schaden anlegen"
Neuen Schaden data-body="#new-damage">
{% include "includes/plus-icon" %}
<a href="#" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" <span class="sr-only">Neuen Schaden eintragen</span>
data-sidebar="true" data-trigger="sidebar" data-header="Neuen Schaden anlegen" data-body="#new-damage"> </a>
{% include "includes/plus-icon" %} </h2>
<span class="sr-only">Neuen Schaden eintragen</span> <div class="hidden">
</a> <div id="new-damage">
</h2> <form action="/boatdamage" method="post" class="grid gap-3">
{{ log::boat_select(only_ones=false, id='boat') }}
<div class="hidden"> {% if not loggedin_user %}{{ macros::select(label='Gemeldet von', data=user, name='user_id') }}{% endif %}
<div id="new-damage"> {{ macros::input(label='Beschreibung des Schadens', name='desc', type='text', required=true, wrapper_class='col-span-4') }}
<form action="/boatdamage" method="post" class="grid gap-3"> <div class="col-span-4">
{{ log::boat_select(only_ones=false, id='boat') }} {{ macros::checkbox(label='Boot sperren', name='lock_boat', type='text', required=true) }}
{% if not loggedin_user %} </div>
{{ macros::select(label='Gemeldet von', data=user, name='user_id') }} <input type="submit"
{% endif %} class="btn btn-primary w-full col-span-4"
{{ macros::input(label='Beschreibung des Schadens', name='desc', type='text', required=true, wrapper_class='col-span-4') }} value="Schaden eintragen" />
<div class="col-span-4"> </form>
{{ macros::checkbox(label='Boot sperren', name='lock_boat', type='text', required=true) }} </div>
</div> </div>
<input type="submit" class="btn btn-primary w-full col-span-4" value="Schaden eintragen" /> <div class="search-wrapper">
</form> <label for="name" class="sr-only">Suche</label>
<input type="search"
name="name"
id="filter-js"
class="search-bar"
placeholder="Suchen nach Namen...">
</div>
<div id="filter-result-js" class="search-result"></div>
{% for boatdamage in boatdamages | sort(attribute="verified") %}
<div data-filterable="true"
data-filter="{{ boatdamage.boat.name }} {{ boatdamage.user_created.name }}"
class="w-full border-t bg-white dark:bg-primary-900 text-black dark:text-white p-3 {% if boatdamage.verified_at %}opacity-50{% endif %}">
<div class="w-full">
<strong>{{ boatdamage.created_at | date(format='%d.%m.%Y') }} <span class="font-normal text-gray-600 dark:text-gray-100">({{ boatdamage.boat.name }})</span></strong>
{% if boatdamage.boat.damage %}
<small class="block text-gray-600 dark:text-gray-100">(Boot gesperrt)</small>
{% endif %}
<div>{{ boatdamage.desc }}</div>
<small class="block text-gray-600 dark:text-gray-100">
Schaden eingetragen von {{ boatdamage.user_created.name }} am/um {{ boatdamage.created_at | date(format='%d.%m.%Y (%H:%M)') }}
</small>
{% if boatdamage.fixed_at %}
<small class="block text-gray-600 dark:text-gray-100">Repariert von {{ boatdamage.user_fixed.name }} am/um {{ boatdamage.fixed_at | date(format='%d.%m.%Y (%H:%M)') }}</small>
{% else %}
{% if loggedin_user and "cox" in loggedin_user.roles %}
<form action="/boatdamage/{{ boatdamage.id }}/fixed"
method="post"
class="flex justify-between mt-3">
<input type="text"
name="desc"
value="{{ boatdamage.desc }}"
class="grow input rounded-s" />
{% if loggedin_user and "tech" in loggedin_user.roles %}
<input type="submit"
class="btn btn-primary"
style="border-top-left-radius: 0;
border-bottom-left-radius: 0"
value="Repariert und verifiziert" />
{% else %}
<input type="submit"
class="btn btn-primary"
style="border-top-left-radius: 0;
border-bottom-left-radius: 0"
value="Repariert" />
{% endif %}
</form>
{% endif %}
{% endif %}
{% if boatdamage.verified_at %}
<small class="block text-gray-600 dark:text-gray-100">Verifziert von {{ boatdamage.user_verified.name }} am/um {{ boatdamage.verified_at | date(format='%d.%m.%Y (%H:%M)') }}</small>
{% else %}
{% if loggedin_user and "tech" in loggedin_user.roles and boatdamage.fixed_at %}
<form action="/boatdamage/{{ boatdamage.id }}/verified"
method="post"
class="flex justify-between mt-3">
<input type="text"
name="desc"
value="{{ boatdamage.desc }}"
class="grow input rounded-s" />
<input type="submit"
class="btn btn-dark"
style="border-top-left-radius: 0;
border-bottom-left-radius: 0"
value="Verifiziert" />
</form>
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
</div> </div>
</div> {% endblock content %}
<div class="search-wrapper">
<label for="name" class="sr-only">Suche</label>
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Namen...">
</div>
<div id="filter-result-js" class="search-result"></div>
{% for boatdamage in boatdamages | sort(attribute="verified") %}
<div data-filterable="true" data-filter="{{ boatdamage.boat.name }} {{ boatdamage.user_created.name }}" class="w-full border-t bg-white dark:bg-primary-900 text-black dark:text-white p-3 {% if boatdamage.verified_at %} opacity-50 {% endif %}">
<div class="w-full">
<strong>{{ boatdamage.created_at | date(format='%d.%m.%Y') }} <span class="font-normal text-gray-600 dark:text-gray-100">({{ boatdamage.boat.name }})</span></strong>{% if boatdamage.boat.damage %}<small class="block text-gray-600 dark:text-gray-100">(Boot gesperrt)</small>{% endif %}
<div>{{ boatdamage.desc }}</div>
<small class="block text-gray-600 dark:text-gray-100">
Schaden eingetragen von {{ boatdamage.user_created.name }} am/um {{ boatdamage.created_at | date(format='%d.%m.%Y (%H:%M)') }}
</small>
{% if boatdamage.fixed_at %}
<small class="block text-gray-600 dark:text-gray-100">Repariert von {{ boatdamage.user_fixed.name }} am/um {{ boatdamage.fixed_at | date(format='%d.%m.%Y (%H:%M)') }}</small>
{% else %}
{% if loggedin_user and "cox" in loggedin_user.roles %}
<form action="/boatdamage/{{ boatdamage.id }}/fixed" method="post" class="flex justify-between mt-3">
<input type="text" name="desc" value="{{ boatdamage.desc }}" class="grow input rounded-s" />
{% if loggedin_user and "tech" in loggedin_user.roles %}
<input type="submit" class="btn btn-primary" style="border-top-left-radius: 0; border-bottom-left-radius: 0;" value="Repariert und verifiziert" />
{% else %}
<input type="submit" class="btn btn-primary" style="border-top-left-radius: 0; border-bottom-left-radius: 0;" value="Repariert" />
{% endif %}
</form>
{% endif %}
{% endif %}
{% if boatdamage.verified_at %}
<small class="block text-gray-600 dark:text-gray-100">Verifziert von {{ boatdamage.user_verified.name }} am/um {{ boatdamage.verified_at | date(format='%d.%m.%Y (%H:%M)') }}</small>
{% else %}
{% if loggedin_user and "tech" in loggedin_user.roles and boatdamage.fixed_at %}
<form action="/boatdamage/{{ boatdamage.id }}/verified" method="post" class="flex justify-between mt-3">
<input type="text" name="desc" value="{{ boatdamage.desc }}" class="grow input rounded-s"/>
<input type="submit" class="btn btn-dark" style="border-top-left-radius: 0; border-bottom-left-radius: 0;" value="Verifiziert" />
</form>
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endblock content%}

View File

@ -1,16 +1,15 @@
<div class="sidebar slide-in from-right bg-white dark:bg-primary-950 dark:text-white" id="sidebar" aria-modal="false"> <div class="sidebar slide-in from-right bg-white dark:bg-primary-950 dark:text-white"
<div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header"> id="sidebar"
<div> aria-modal="false">
<span class="ps-1 header-js"> <div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header">
Überschrift (wird ersetzt) <div>
</span> <span class="ps-1 header-js">Überschrift (wird ersetzt)</span>
</div> </div>
<button type="button" title="Ausfahrt erstellen schließen" class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45" data-trigger="sidebar"> <button type="button"
{% include "includes/plus-icon" %} title="Ausfahrt erstellen schließen"
</button> class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45"
</div> data-trigger="sidebar">{% include "includes/plus-icon" %}</button>
<div class="body-js px-2 pt-2"> </div>
Formular wird ersetzt <div class="body-js px-2 pt-2">Formular wird ersetzt</div>
</div>
</div> </div>
<div class="sidebar-overlay" data-trigger="sidebar"></div> <div class="sidebar-overlay" data-trigger="sidebar"></div>

View File

@ -1,36 +1,39 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
{% if flash %} <h1 class="h1">Aktuelle Woche</h1>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <details>
{% endif %} <summary>Dirty Thirty</summary>
<p>
<h1 class="h1">Aktuelle Woche</h1> <div class="border-r border-l">
<details> {% for stat in thirty %}
<summary>Dirty Thirty</summary> {% set names = stat.name | split(pat=" ") %}{% set lastname_index = names | length - 1 %}{% set lastname = names[lastname_index] %}{{ lastname }}&#9;
<p> {% for name in names %}
<div class="border-r border-l"> {% if loop.index != lastname_index +1 %}{{ name }}{% endif %}
{% for stat in thirty %}{% set names = stat.name | split(pat=" ") %}{% set lastname_index = names | length - 1 %}{% set lastname = names[lastname_index] %}{{ lastname }}&#9;{% for name in names %}{% if loop.index != lastname_index +1 %}{{ name }} {% endif %}{% endfor %}&#9;{{ stat.dob }}&#9;{{ stat.weight }}&#9;{{ stat.sex }}&#9;&#9;DLI&#9;{{ stat.result }} {% endfor %}
{% endfor %} &#9;{{ stat.dob }}&#9;{{ stat.weight }}&#9;{{ stat.sex }}&#9;&#9;DLI&#9;{{ stat.result }}
</div> {% endfor %}
</p> </div>
</details> </p>
</details>
<details> <details>
<summary>Dirty Dozen</summary> <summary>Dirty Dozen</summary>
<p> <p>
<div class="border-r border-l">{% for stat in dozen %} <div class="border-r border-l">
{% set names = stat.name | split(pat=" ") %} {% for stat in dozen %}
{% set lastname_index = names | length - 1 %} {% set names = stat.name | split(pat=" ") %}
{% set lastname = names[lastname_index] %} {% set lastname_index = names | length - 1 %}
{{ lastname }};{% for name in names %}{% if loop.index != lastname_index +1 %}{{ name }} {% endif %}{% endfor %};{{ stat.dob }};{{ stat.weight }};{{ stat.sex }};DLI;{{ stat.result }}<br /> {% set lastname = names[lastname_index] %}
{% endfor %} {{ lastname }};
</div> {% for name in names %}
</p> {% if loop.index != lastname_index +1 %}{{ name }}{% endif %}
</details> {% endfor %}
</div> ;{{ stat.dob }};{{ stat.weight }};{{ stat.sex }};DLI;{{ stat.result }}
<br />
{% endblock content%} {% endfor %}
</div>
</p>
</details>
</div>
{% endblock content %}

View File

@ -1,174 +1,205 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Ergo Challenges</h1> <h1 class="h1">Ergo Challenges</h1>
<div class="grid gap-3">
{% if flash %} <div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
{{ macros::alert(message=flash.1, type=flash.0, class="my-3") }} role="alert">
{% endif %} <h2 class="h2">Ergo-Challenge?!</h2>
<div class="text-sm p-3">
<div class="grid gap-3"> <ul class="list-disc ms-2">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert"> <li class="py-1">
<h2 class="h2">Ergo-Challenge?!</h2> <a href="https://rudernlinz.at/termin"
<div class="text-sm p-3"> target="_blank"
<ul class="list-disc ms-2"> class="link-primary">Überblick der Challenges</a>
<li class="py-1"><a href="https://rudernlinz.at/termin" target="_blank" class="link-primary">Überblick der Challenges</a></li> </li>
<li class="py-1">Eintragung ist jederzeit möglich, alle Daten die bis Sonntag 23:59 hier hochgeladen wurden, werden gesammelt an die Ister Ergo Challenge geschickt <li class="py-1">
<li class="py-1">Dienstag + Donnerstag &rarr; gemeinsames Training; bitte um <a href="/" class="link-primary">Anmeldung</a>, damit jeder einen Ergo hat</li> Eintragung ist jederzeit möglich, alle Daten die bis Sonntag 23:59 hier hochgeladen wurden, werden gesammelt an die Ister Ergo Challenge geschickt
<li class="py-1">Offizielle Ergebnisse: <a href="https://rudernlinz.at/dt" target="_blank" style="text-decoration: underline;">Dirty Thirty (rudernlinz.at/dt)</a> / <a href="https://rudernlinz.at/dd" target="_blank" style="text-decoration: underline;">Dirty Dozen (rudernlinz.at/dd)</a>, bei Fehlern direkt mit <a href="mailto:office@ergochallenge.at" style="text-decoration: underline;">Christian (Ister)</a> Kontakt aufnehmen</li> <li class="py-1">
<li class="py-1"><a href="https://cloud.rudernlinz.at/s/m7mPQdwSWscpaXT" target="_blank" class="link-primary">Noch mehr Infos zur Ergo-Challenge findest du hier</a></li> Dienstag + Donnerstag &rarr; gemeinsames Training; bitte um <a href="/" class="link-primary">Anmeldung</a>, damit jeder einen Ergo hat
</ul> </li>
<li class="py-1">
Offizielle Ergebnisse: <a href="https://rudernlinz.at/dt"
target="_blank"
style="text-decoration: underline">Dirty Thirty (rudernlinz.at/dt)</a> / <a href="https://rudernlinz.at/dd"
target="_blank"
style="text-decoration: underline">Dirty Dozen (rudernlinz.at/dd)</a>, bei Fehlern direkt mit <a href="mailto:office@ergochallenge.at"
style="text-decoration: underline">Christian (Ister)</a> Kontakt aufnehmen
</li>
<li class="py-1">
<a href="https://cloud.rudernlinz.at/s/m7mPQdwSWscpaXT"
target="_blank"
class="link-primary">Noch mehr Infos zur Ergo-Challenge findest du hier</a>
</li>
</ul>
</div>
<details class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md p-2">
<summary class="cursor-pointer">Deine Daten</summary>
<div class="pt-3">
<p>
Folgende Daten hat der Ruderassistent von dir. Wenn diese nicht mehr aktuell sind, bitte gewünschte Änderungen an Philipp melden (Tel. nr siehe Signal, oder an <a href="mailto:it@rudernlinz.at"
class="text-primary-600 dark:text-primary-200 hover:text-primary-950 hover:dark:text-primary-300 underline"
target="_blank">it@rudernlinz.at</a>).
<br />
<br />
<ul>
<li>Geburtsdatum: {{ loggedin_user.dob }}</li>
<li>Gewicht: {{ loggedin_user.weight }} kg</li>
<li>Geschlecht: {{ loggedin_user.sex }}</li>
</ul>
</p>
</div>
</details>
</div>
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3">
<h2 class="h2">
Neuer Eintrag
</h1>
<details class="p-2">
<summary class="cursor-pointer">Dirty Thirty</summary>
<div class="mt-3">
<form action="/ergo/thirty"
class="grid gap-3"
method="post"
enctype="multipart/form-data">
<div>
<label for="user-thirty" class="text-sm text-gray-600 dark:text-gray-100">Ergo-Fahrer</label>
<select name="user" id="user-thirty" class="input rounded-md">
<option disabled="disabled">User auswählen</option>
{% for user in users %}
{% if user.id == loggedin_user.id %}
<option value="{{ user.id }}" selected="selected">{{ user.name }}</option>
{% else %}
<option value="{{ user.id }}">{{ user.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{{ macros::input(label="Distanz [m]", name="result", required=true, type="number", class="input rounded-md") }}
<div>
<label for="file-thirty" class="text-sm text-gray-600 dark:text-gray-100">Ergebnis-Foto vom Ergo-Display</label>
<input type="file"
id="file-thirty"
name="proof"
class="input rounded-md"
accept="image/*">
</div>
<div class="text-end">
<input type="submit" value="Speichern" class="btn btn-primary btn-fw m-auto" />
</div>
</form>
</div>
</details>
<details class="p-2">
<summary class="cursor-pointer">Dirty Dozen</summary>
<div class="mt-3">
<form action="/ergo/dozen"
class="grid gap-3"
method="post"
enctype="multipart/form-data">
<div>
<label for="user-dozen" class="text-sm text-gray-600 dark:text-gray-100">Ergo-Fahrer</label>
<select name="user" id="user-dozen" class="input rounded-md">
<option disabled="disabled">User auswählen</option>
{% for user in users %}
{% if user.id == loggedin_user.id %}
<option value="{{ user.id }}" selected="selected">{{ user.name }}</option>
{% else %}
<option value="{{ user.id }}">{{ user.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{{ macros::input(label="Zeit [hh:mm:ss.s] oder Distanz [m]", name="result", required=true, type="text", class="input rounded-md", pattern="(?:\d+:\d{2}:\d{2}\.\d+|\d{1,2}:\d{2}\.\d+|\d+(\.\d+)?)") }}
<div>
<label for="file-dozen" class="text-sm text-gray-600 dark:text-gray-100">Ergebnis-Foto vom Ergo-Display</label>
<input type="file"
id="file-dozen"
name="proof"
class="input rounded-md"
accept="image/*">
</div>
<div class="text-end">
<input type="submit" value="Speichern" class="btn btn-primary btn-fw m-auto" />
</div>
</form>
</div>
</details>
</div>
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3">
<h2 class="h2">Aktuelle Woche</h2>
<details class="p-2">
<summary class="cursor-pointer">
Dirty Thirty <small class="text-gray-600 dark:text-white">({{ thirty | length }})</small>
</summary>
<div class="mt-3">
<ol>
{% for stat in thirty %}
<li>
<strong>{{ stat.name }}:</strong> {{ stat.result }}
</li>
{% endfor %}
</ol>
</div>
</details>
<details class="p-2">
<summary class="cursor-pointer">
Dirty Dozen <small class="text-gray-600 dark:text-white">({{ dozen | length }})</small>
</summary>
<div class="mt-3">
<ol>
{% for stat in dozen %}
<li>
<strong>{{ stat.name }}:</strong> {{ stat.result }}
</li>
{% endfor %}
</ol>
</div>
</details>
</div>
{% if "admin" in loggedin_user.roles %}
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3">
<h2 class="h2">Update</h2>
<details class="p-2">
<summary class="cursor-pointer">
Dirty Thirty <small class="text-gray-600 dark:text-white">({{ thirty | length }})</small>
</summary>
<div class="mt-3">
<ol>
{% for stat in thirty %}
<li>
<form action="/ergo/thirty/user/{{ stat.id }}/new" method="get">
{{ stat.name }}:
<input type="text" value="{{ stat.result }}" name="new" style="color: black" />
<input type="submit" />
</form>
</li>
{% endfor %}
</ol>
</div>
</details>
<details class="p-2">
<summary class="cursor-pointer">
Dirty Dozen <small class="text-gray-600 dark:text-white">({{ dozen | length }})</small>
</summary>
<div class="mt-3">
<ol>
{% for stat in dozen %}
<li>
<form action="/ergo/dozen/user/{{ stat.id }}/new" method="get">
{{ stat.name }}:
<input type="text" value="{{ stat.result }}" name="new" style="color: black" />
<input type="submit" />
</form>
</li>
{% endfor %}
</ol>
</div>
</details>
</div>
</div>
{% endif %}
</div> </div>
<details class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md p-2">
<summary class="cursor-pointer">Deine Daten</summary>
<div class="pt-3">
<p>
Folgende Daten hat der Ruderassistent von dir. Wenn diese nicht mehr aktuell sind, bitte gewünschte Änderungen an Philipp melden (Tel. nr siehe Signal, oder an <a href="mailto:it@rudernlinz.at" class="text-primary-600 dark:text-primary-200 hover:text-primary-950 hover:dark:text-primary-300 underline" target="_blank">it@rudernlinz.at</a>).
<br /><br />
<ul>
<li>Geburtsdatum: {{ loggedin_user.dob }}</li>
<li>Gewicht: {{ loggedin_user.weight}} kg</li>
<li>Geschlecht: {{ loggedin_user.sex}}</li>
</ul>
</p>
</div>
</details>
</div>
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3">
<h2 class="h2">Neuer Eintrag</h1>
<details class="p-2">
<summary class="cursor-pointer">Dirty Thirty</summary>
<div class="mt-3">
<form action="/ergo/thirty" class="grid gap-3" method="post" enctype="multipart/form-data">
<div>
<label for="user-thirty" class="text-sm text-gray-600 dark:text-gray-100">Ergo-Fahrer</label>
<select name="user" id="user-thirty" class="input rounded-md">
<option disabled="disabled">User auswählen</option>
{% for user in users %}
{% if user.id == loggedin_user.id %}
<option value="{{ user.id }}" selected="selected">{{ user.name }}</option>
{% else %}
<option value="{{ user.id }}">{{ user.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{{ macros::input(label="Distanz [m]", name="result", required=true, type="number", class="input rounded-md") }}
<div>
<label for="file-thirty" class="text-sm text-gray-600 dark:text-gray-100">Ergebnis-Foto vom Ergo-Display</label>
<input type="file" id="file-thirty" name="proof" class="input rounded-md" accept="image/*">
</div>
<div class="text-end">
<input type="submit" value="Speichern" class="btn btn-primary btn-fw m-auto"/>
</div>
</form>
</div>
</details>
<details class="p-2">
<summary class="cursor-pointer">Dirty Dozen</summary>
<div class="mt-3">
<form action="/ergo/dozen" class="grid gap-3" method="post" enctype="multipart/form-data">
<div>
<label for="user-dozen" class="text-sm text-gray-600 dark:text-gray-100">Ergo-Fahrer</label>
<select name="user" id="user-dozen" class="input rounded-md">
<option disabled="disabled">User auswählen</option>
{% for user in users %}
{% if user.id == loggedin_user.id %}
<option value="{{ user.id }}" selected="selected">{{ user.name }}</option>
{% else %}
<option value="{{ user.id }}">{{ user.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
{{ macros::input(label="Zeit [hh:mm:ss.s] oder Distanz [m]", name="result", required=true, type="text", class="input rounded-md", pattern="(?:\d+:\d{2}:\d{2}\.\d+|\d{1,2}:\d{2}\.\d+|\d+(\.\d+)?)") }}
<div>
<label for="file-dozen" class="text-sm text-gray-600 dark:text-gray-100">Ergebnis-Foto vom Ergo-Display</label>
<input type="file" id="file-dozen" name="proof" class="input rounded-md" accept="image/*">
</div>
<div class="text-end">
<input type="submit" value="Speichern" class="btn btn-primary btn-fw m-auto"/>
</div>
</form>
</div>
</details>
</div> </div>
{% endblock content %}
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3">
<h2 class="h2">Aktuelle Woche</h2>
<details class="p-2">
<summary class="cursor-pointer">Dirty Thirty <small class="text-gray-600 dark:text-white">({{thirty | length}})</small></summary>
<div class="mt-3">
<ol>
{% for stat in thirty %}
<li><strong>{{ stat.name }}:</strong> {{ stat.result }}</li>
{% endfor %}
</ol>
</div>
</details>
<details class="p-2">
<summary class="cursor-pointer">Dirty Dozen <small class="text-gray-600 dark:text-white">({{dozen | length}})</small></summary>
<div class="mt-3">
<ol>
{% for stat in dozen %}
<li><strong>{{ stat.name }}:</strong> {{ stat.result }}</li>
{% endfor %}
</ol>
</div>
</details>
</div>
{% if "admin" in loggedin_user.roles %}
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow grid gap-3">
<h2 class="h2">Update</h2>
<details class="p-2">
<summary class="cursor-pointer">Dirty Thirty <small class="text-gray-600 dark:text-white">({{thirty | length}})</small></summary>
<div class="mt-3">
<ol>
{% for stat in thirty %}
<li>
<form action="/ergo/thirty/user/{{ stat.id }}/new" method="get">
{{ stat.name }}: <input type="text" value="{{stat.result}}" name="new" style="color: black;"/><input type="submit"/>
</form>
</li>
{% endfor %}
</ol>
</div>
</details>
<details class="p-2">
<summary class="cursor-pointer">Dirty Dozen <small class="text-gray-600 dark:text-white">({{dozen | length}})</small></summary>
<div class="mt-3">
<ol>
{% for stat in dozen %}
<li>
<form action="/ergo/dozen/user/{{ stat.id }}/new" method="get">
{{ stat.name }}: <input type="text" value="{{stat.result}}" name="new" style="color: black;"/><input type="submit"/>
</form>
</li>
{% endfor %}
</ol>
</div>
</details>
</div>
</div>
{% endif %}
</div>
</div>
{% endblock content%}

View File

@ -1,17 +1,18 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
<div class="hidden"> <div class="hidden">
<form action="/admin/planned-event" method="post" class="grid gap-3" id="addEventForm"> <form action="/admin/planned-event"
<input class="day-js" type="hidden" name="tripdetails.day" value=""/> method="post"
{{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }} class="grid gap-3"
{{ macros::input(label='Startzeit', name='tripdetails.planned_starting_time', type='time', required=true) }} id="addEventForm">
{{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true, min='0') }} <input class="day-js" type="hidden" name="tripdetails.day" value="" />
{{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='tripdetails.max_people', type='number', required=true, min='0') }} {{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }}
{{ macros::checkbox(label='Gäste erlauben', name='tripdetails.allow_guests') }} {{ macros::input(label='Startzeit', name='tripdetails.planned_starting_time', type='time', required=true) }}
{{ macros::checkbox(label='Immer anzeigen', name='tripdetails.always_show') }} {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true, min='0') }}
{{ macros::input(label='Anmerkungen', name='tripdetails.notes', type='input') }} {{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='tripdetails.max_people', type='number', required=true, min='0') }}
{{ macros::select(label='Typ', data=trip_types, name='tripdetails.trip_type', default='Reguläre Ausfahrt') }} {{ macros::checkbox(label='Gäste erlauben', name='tripdetails.allow_guests') }}
{{ macros::checkbox(label='Immer anzeigen', name='tripdetails.always_show') }}
<input value="Erstellen" class="w-full btn btn-primary" type="submit"/> {{ macros::input(label='Anmerkungen', name='tripdetails.notes', type='input') }}
</form> {{ macros::select(label='Typ', data=trip_types, name='tripdetails.trip_type', default='Reguläre Ausfahrt') }}
<input value="Erstellen" class="w-full btn btn-primary" type="submit" />
</form>
</div> </div>

View File

@ -1,15 +1,13 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
<div class="hidden"> <div class="hidden">
<form action="/cox/trip" method="post" class="grid gap-3" id="sidebarForm"> <form action="/cox/trip" method="post" class="grid gap-3" id="sidebarForm">
<input class="day-js" type="hidden" name="day" value=""/> <input class="day-js" type="hidden" name="day" value="" />
{{ macros::input(label='Startzeit (zB "10:00")', name='planned_starting_time', type='time', required=true) }} {{ macros::input(label='Startzeit (zB "10:00")', name='planned_starting_time', type='time', required=true) }}
{{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='max_people', type='number', required=true, min='0') }} {{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='max_people', type='number', required=true, min='0') }}
{{ macros::checkbox(label='Gäste erlauben', name='allow_guests') }} {{ macros::checkbox(label='Gäste erlauben', name='allow_guests') }}
{{ macros::checkbox(label='Immer anzeigen', name='always_show') }} {{ macros::checkbox(label='Immer anzeigen', name='always_show') }}
{{ macros::input(label='Anmerkungen', name='notes', type='input') }} {{ macros::input(label='Anmerkungen', name='notes', type='input') }}
{{ macros::select(label='Typ', data=trip_types, name='trip_type', default='Reguläre Ausfahrt') }} {{ macros::select(label='Typ', data=trip_types, name='trip_type', default='Reguläre Ausfahrt') }}
<input value="Erstellen" class="w-full btn btn-primary" type="submit" />
<input value="Erstellen" class="w-full btn btn-primary" type="submit"/> </form>
</form>
</div> </div>

View File

@ -1,4 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-journal" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg"
<path d="M3 0h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v1H1V2a2 2 0 0 1 2-2z"/> width="16"
<path d="M1 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1z"/> height="16"
</svg> fill="currentColor"
class="bi bi-journal"
viewBox="0 0 16 16">
<path d="M3 0h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v1H1V2a2 2 0 0 1 2-2z" />
<path d="M1 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1z" />
</svg>

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 532 B

View File

@ -1,12 +1,22 @@
{% if "cox" in loggedin_user.roles %} {% if "cox" in loggedin_user.roles %}
<div class="sm:col-span-2 lg:col-span-3 grid md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3"> <div class="sm:col-span-2 lg:col-span-3 grid md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3">
<button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-days" id="filterdays-js" aria-pressed="false"> <button type="button"
{% include "includes/funnel-icon" %} title="Toggle View"
Tage mit Ausfahrten class="group btn btn-primary filter-trips-js"
</button> data-action="filter-days"
<button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-coxs" id="filtertrips-js" aria-pressed="false"> id="filterdays-js"
{% include "includes/funnel-icon" %} aria-pressed="false">
Steuerleute gesucht {% include "includes/funnel-icon" %}
</button> Tage mit Ausfahrten
</div> </button>
<button type="button"
title="Toggle View"
class="group btn btn-primary filter-trips-js"
data-action="filter-coxs"
id="filtertrips-js"
aria-pressed="false">
{% include "includes/funnel-icon" %}
Steuerleute gesucht
</button>
</div>
{% endif %} {% endif %}

View File

@ -1,3 +1,8 @@
<svg width="16" height="16" fill="currentColor" class="inline-block mr-1 h-3 w-3" viewbox="0 0 16 16" style="margin-top: -0.2rem;"> <svg width="16"
<path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z"/> height="16"
fill="currentColor"
class="inline-block mr-1 h-3 w-3"
viewbox="0 0 16 16"
style="margin-top: -0.2rem">
<path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 367 B

View File

@ -1,4 +1,8 @@
<svg width="16" height="16" fill="currentColor" class="inline h-4 w-4" viewbox="0 0 16 16"> <svg width="16"
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/> height="16"
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/> fill="currentColor"
class="inline h-4 w-4"
viewbox="0 0 16 16">
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 568 B

View File

@ -1,23 +1,34 @@
<footer class="bg-primary-950 dark:bg-primary-900 text-white w-full flex justify-center p-3"> <footer class="bg-primary-950 dark:bg-primary-900 text-white w-full flex justify-center p-3">
<div class="max-w-screen-xl w-full flex justify-between items-center"> <div class="max-w-screen-xl w-full flex justify-between items-center">
<div> <div>
<span class="text-[#ff0000]">&hearts;</span> <span class="text-[#ff0000]">&hearts;</span>
Erstellt vom ASKÖ Ruderverein Donau Linz <a onclick="alert('Wir suchen kreative und motivierte Köpfe, die diesen Ruderassistenten mitgestalten möchten. Das Backend ist in Rust (Rocket), das Frontend in TypeScript und Teraform, wobei wir mit dem Gedanken spielen, zu Svelte(Kit) zu wechseln.\n\nWenn du Lust hast, deine Skills in ein Projekt zu stecken, das Wellen schlagen wird, dann komm an Bord! Wir sind offen für frische Ideen, haben jedoch auch selber noch genügend; langweilig wird uns bestimmt nicht.\n\nWirf den Anker bei uns ausi und melde dich bei Marie oder Philipp oder it@rudernlinz.at für eine Zukunft ohne optische Kenterung in Form von hässlichen Alerts ;)');" style="text-decoration:underline">... und dir?</a> Erstellt vom ASKÖ Ruderverein Donau Linz <a onclick="alert('Wir suchen kreative und motivierte Köpfe, die diesen Ruderassistenten mitgestalten möchten. Das Backend ist in Rust (Rocket), das Frontend in TypeScript und Teraform, wobei wir mit dem Gedanken spielen, zu Svelte(Kit) zu wechseln.\n\nWenn du Lust hast, deine Skills in ein Projekt zu stecken, das Wellen schlagen wird, dann komm an Bord! Wir sind offen für frische Ideen, haben jedoch auch selber noch genügend; langweilig wird uns bestimmt nicht.\n\nWirf den Anker bei uns ausi und melde dich bei Marie oder Philipp oder it@rudernlinz.at für eine Zukunft ohne optische Kenterung in Form von hässlichen Alerts ;)');"
</div> style="text-decoration:underline">... und dir?</a>
</div>
<div> <div>
<button id="theme-toggle-js" type="button" data-theme="light" class="btn btn-primary"> <button id="theme-toggle-js"
<span class="hidden dark:inline"> type="button"
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> data-theme="light"
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/> class="btn btn-primary">
</svg> <span class="hidden dark:inline">
</span> <svg xmlns="http://www.w3.org/2000/svg"
<span class="inline dark:hidden"> width="16"
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"> height="16"
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"/> fill="currentColor"
</svg> viewBox="0 0 16 16">
</span> <path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" />
</button> </svg>
</span>
<span class="inline dark:hidden">
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
viewBox="0 0 16 16">
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z" />
</svg>
</span>
</button>
</div>
</div> </div>
</div>
</footer> </footer>

View File

@ -1,69 +1,85 @@
{% macro new() %} {% macro new() %}
<div class="w-full"> <div class="w-full">
<h2 class="text-md font-bold tracking-wide bg-primary-900 mt-3 p-3 text-white flex justify-between items-center rounded-md"> <h2 class="text-md font-bold tracking-wide bg-primary-900 mt-3 p-3 text-white flex justify-between items-center rounded-md">
Neues Boot Neues Boot
<a href="#"
<a href="#" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
data-sidebar="true" data-trigger="sidebar" data-header="Neues Boot anlegen" data-body="#new-boat"> data-sidebar="true"
{% include "includes/plus-icon" %} data-trigger="sidebar"
<span class="sr-only">Neues Boot anlegen</span> data-header="Neues Boot anlegen"
</a> data-body="#new-boat">
</h2> {% include "includes/plus-icon" %}
<div class="hidden"> <span class="sr-only">Neues Boot anlegen</span>
<div id="new-boat"> </a>
<form action="/admin/boat/new" method="post" class="grid gap-3"> </h2>
{{ macros::input(label="Name", name="name", type="text", required=true) }} <div class="hidden">
{{ macros::input(label="Anzahl Sitze", name="amount_seats", type="number", required=true, min=1) }} <div id="new-boat">
{{ macros::input(label="Baujahr", name="year_built", type="number", min=1950, max=2050) }} <form action="/admin/boat/new" method="post" class="grid gap-3">
{{ macros::input(label="Bootsbauer", name="boatbuilder", type="text") }} {{ macros::input(label="Name", name="name", type="text", required=true) }}
{{ macros::select(label="Standort", data=locations, name='location_id', selected_id=1) }} {{ macros::input(label="Anzahl Sitze", name="amount_seats", type="number", required=true, min=1) }}
{{ macros::select(label="Besitzer", data=users, name='owner', default="Verein") }} {{ macros::input(label="Baujahr", name="year_built", type="number", min=1950, max=2050) }}
{{ macros::input(label='Default destination', name='default_destination', type='text') }} {{ macros::input(label="Bootsbauer", name="boatbuilder", type="text") }}
<div> {{ macros::select(label="Standort", data=locations, name='location_id', selected_id=1) }}
{{ macros::checkbox(label="handgesteuert", name="default_shipmaster_only_steering")}} {{ macros::select(label="Besitzer", data=users, name='owner', default="Verein") }}
{{ macros::checkbox(label="Skull", name="skull", checked=true)}} {{ macros::input(label='Default destination', name='default_destination', type='text') }}
{{ macros::checkbox(label="Externes Boot (anderer Verein)", name="external")}} <div>
</div> {{ macros::checkbox(label="handgesteuert", name="default_shipmaster_only_steering") }}
<input value="Hinzufügen" type="submit" class="w-full mt-2 rounded-md bg-primary-500 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"/> {{ macros::checkbox(label="Skull", name="skull", checked=true) }}
</form> {{ macros::checkbox(label="Externes Boot (anderer Verein)", name="external") }}
</div> </div>
</div> <input value="Hinzufügen"
</div> type="submit"
<div class="search-wrapper"> class="w-full mt-2 rounded-md bg-primary-500 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" />
<label for="name" class="sr-only">Suche</label> </form>
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Namen..."> </div>
</div>
<div id="filter-result-js" class="search-result"></div>
{% endmacro new %}
{% macro edit(boat, uuid) %}
<div data-filterable="true" data-filter="{{ boat.name }}" class="w-full border-t">
<form action="/admin/boat/{{ boat.id }}" data-filterable="true" method="post" class="bg-white dark:bg-primary-900 p-4 w-full">
<div class="w-full">
<input type="hidden" name="id" value="{{ boat.id }}"/>
<div class="font-bold mb-1 text-black dark:text-white">{{ boat.name }}<br/></div>
<div class="grid md:grid-cols-3 gap-3">
{{ macros::input(label='Name', name='name', type='text', value=boat.name) }}
{{ macros::input(label='Plätze', name='amount_seats', type='number', min=0, value=boat.amount_seats) }}
{{ macros::select(data=locations, label='Standort', name='location_id', selected_id=boat.location_id) }}
{{ macros::select(data=users, label='Besitzer', name='owner', selected_id=boat.owner, default="Vereinsboot") }}
{{ macros::input(label='Baujahr', name='year_built', type='number', min=1950, value=boat.year_built) }}
{{ macros::input(label='Bootsbauer', name='boatbuilder', type='text', value=boat.boatbuilder) }}
{{ macros::checkbox(label='handgesteuert', name='default_shipmaster_only_steering', id=uuid , checked=boat.default_shipmaster_only_steering) }}
{{ macros::input(label='Default destination', name='default_destination', type='text', value=boat.default_destination) }}
{{ macros::checkbox(label='Skull', name='skull', id=uuid , checked=boat.skull) }}
{{ macros::checkbox(label='Externes Boot', name='external', id=uuid , checked=boat.external) }}
</div> </div>
</div> </div>
<div class="text-right mt-3"> <div class="search-wrapper">
<a href="/admin/boat/{{ boat.id }}/delete" class="inline-block btn btn-alert" onclick="return confirm('Wirklich löschen?');"> <label for="name" class="sr-only">Suche</label>
{% include "includes/delete-icon" %} <input type="search"
Löschen name="name"
</a> id="filter-js"
<input value="Ändern" type="submit" class="w-28 btn btn-primary"/> class="search-bar"
</div> placeholder="Suchen nach Namen...">
</form> </div>
</div> <div id="filter-result-js" class="search-result"></div>
{% endmacro new %}
{% macro edit(boat, uuid) %}
<div data-filterable="true"
data-filter="{{ boat.name }}"
class="w-full border-t">
<form action="/admin/boat/{{ boat.id }}"
data-filterable="true"
method="post"
class="bg-white dark:bg-primary-900 p-4 w-full">
<div class="w-full">
<input type="hidden" name="id" value="{{ boat.id }}" />
<div class="font-bold mb-1 text-black dark:text-white">
{{ boat.name }}
<br />
</div>
<div class="grid md:grid-cols-3 gap-3">
{{ macros::input(label='Name', name='name', type='text', value=boat.name) }}
{{ macros::input(label='Plätze', name='amount_seats', type='number', min=0, value=boat.amount_seats) }}
{{ macros::select(data=locations, label='Standort', name='location_id', selected_id=boat.location_id) }}
{{ macros::select(data=users, label='Besitzer', name='owner', selected_id=boat.owner, default="Vereinsboot") }}
{{ macros::input(label='Baujahr', name='year_built', type='number', min=1950, value=boat.year_built) }}
{{ macros::input(label='Bootsbauer', name='boatbuilder', type='text', value=boat.boatbuilder) }}
{{ macros::checkbox(label='handgesteuert', name='default_shipmaster_only_steering', id=uuid , checked=boat.default_shipmaster_only_steering) }}
{{ macros::input(label='Default destination', name='default_destination', type='text', value=boat.default_destination) }}
{{ macros::checkbox(label='Skull', name='skull', id=uuid , checked=boat.skull) }}
{{ macros::checkbox(label='Externes Boot', name='external', id=uuid , checked=boat.external) }}
</div>
</div>
<div class="text-right mt-3">
<a href="/admin/boat/{{ boat.id }}/delete"
class="inline-block btn btn-alert"
onclick="return confirm('Wirklich löschen?');">
{% include "includes/delete-icon" %}
Löschen
</a>
<input value="Ändern" type="submit" class="w-28 btn btn-primary" />
</div>
</form>
</div>
{% endmacro edit %} {% endmacro edit %}

View File

@ -3,231 +3,261 @@
Inputs: boats Inputs: boats
#} #}
{% macro show_boats() %} {% macro show_boats() %}
{% for amount_seats, grouped_boats in boats | group_by(attribute="amount_seats") %} {% for amount_seats, grouped_boats in boats | group_by(attribute="amount_seats") %}
<div class="pb-2"> <div class="pb-2">
<div class="bg-gray-100 dark:bg-primary-600 text-primary-950 dark:text-white text-center text-sm mb-2"> <div class="bg-gray-100 dark:bg-primary-600 text-primary-950 dark:text-white text-center text-sm mb-2">
<strong>{{ amount_seats }}x</strong> <strong>{{ amount_seats }}x</strong>
</div> </div>
{% for boat in grouped_boats %} {% for boat in grouped_boats | sort(attribute="name") %}
<div id="boat-{{ boat.id }}" class="px-3 boats-js text-black dark:text-white {% if boat.damage != 'locked' and not boat.on_water %} cursor-pointer hover:text-primary-900 dark:hover:text-gray-100 {% endif %}" {% if boat.damage != 'locked' and not boat.on_water %} data-seats="{{boat.amount_seats}}" data-default_shipmaster_only_steering="{{boat.default_shipmaster_only_steering}}" data-default-destination="{{boat.default_destination}}" data-onclick="true" {% endif %} data-id="{{ boat.id }}"> <div id="boat-{{ boat.id }}"
<span class="status-damage status-damage-{{ boat.damage }}"></span> class="px-3 boats-js text-black dark:text-white {% if boat.damage != 'locked' and not boat.on_water %} cursor-pointer hover:text-primary-900 dark:hover:text-gray-100 {% endif %}"
<span {% if boat.damage == 'locked' or boat.on_water %} class="opacity-50" {% endif %}>{{ boat.name }} {% if boat.damage != 'locked' and not boat.on_water %} data-seats="{{ boat.amount_seats }}" data-default_shipmaster_only_steering="{{ boat.default_shipmaster_only_steering }}" data-default-destination="{{ boat.default_destination }}" data-onclick="true" {% endif %}
{% if boat.owner %} data-id="{{ boat.id }}">
<span class="opacity-50">(privat)</span> <span class="status-damage status-damage-{{ boat.damage }}"></span>
{% endif %} <span {% if boat.damage == 'locked' or boat.on_water %}class="opacity-50"{% endif %}>{{ boat.name }}
</span> {% if boat.owner %}<span class="opacity-50">(privat)</span>{% endif %}
</div> </span>
{% endfor %} </div>
</div> {% endfor %}
{% endfor %} </div>
{% endfor %}
{% endmacro show_boats %} {% endmacro show_boats %}
{# Shows the form for creating a new logbook entry. #} {# Shows the form for creating a new logbook entry. #}
{% macro new(shipmaster) %} {% macro new(shipmaster) %}
<form action="/log" method="post" id="form" class="grid grid-cols-4 gap-3" onsubmit="Array.from(this.elements).forEach(e=>!e.value.trim()&&(e.disabled=true));"> <form action="/log"
{{ log::boat_select() }} method="post"
<div class="col-span-4 md:col-span-1"> id="form"
<div class="text-sm text-gray-600 dark:text-gray-100">Bootssteuerung</div> class="grid grid-cols-4 gap-3"
<div class="h-10 flex items-center"> onsubmit="Array.from(this.elements).forEach(e=>!e.value.trim()&&(e.disabled=true));">
{{ macros::checkbox(label='handgesteuert', name='shipmaster_only_steering', disabled=true) }} {{ log::boat_select() }}
</div> <div class="col-span-4 md:col-span-1">
</div> <div class="text-sm text-gray-600 dark:text-gray-100">Bootssteuerung</div>
{{ log::rower_select(id="newrower", selected=[], class="col-span-4", init=true) }} <div class="h-10 flex items-center">
{{ macros::select(label="Schiffsführer", data=[], name='shipmaster', id="shipmaster-newrowerjs", wrapper_class="col-span-2") }} {{ macros::checkbox(label='handgesteuert', name='shipmaster_only_steering', disabled=true) }}
{{ macros::select(label="Steuerperson", data=[], name='steering_person', id="steering_person-newrowerjs", wrapper_class="col-span-2") }}
{{ macros::input(label='Abfahrtszeit', name='departure', type='datetime-local', required=true, wrapper_class='col-span-2') }}
{{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local', wrapper_class='col-span-2') }}
<div class="relative col-span-2">
<label for="destination" class="text-sm text-gray-600 dark:text-gray-100">Ziel</label>
<input class="input rounded-md set-distance-js" type="search" list="destinations" placeholder="Destination" id="destination" name="destination" value="" data-relation="distance_in_km"/>
<datalist id="destinations">
{% for distance in distances %}<option value="{{ distance.0 }}" distance="{{ distance.1 }}" />
{% endfor %}
</datalist>
</div>
<div class="relative col-span-2">
{{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km" , type="number", min=0, value='', class="rounded-md") }}
<span class="absolute right-0 bottom-0 py-1.5 px-2 bg-white dark:bg-primary-950 border-0 text-gray-600 dark:text-gray-100 ring-1 ring-inset ring-gray-300 dark:ring-primary-950 rounded-br-md rounded-tr-md">km</span>
</div>
{{ macros::input(label="Kommentar", name="comments", type="text", wrapper_class="col-span-4") }}
{{ macros::select(label="Typ", data=logtypes, name='logtype', default="Normal", wrapper_class="col-span-4") }}
<input type="submit" value="Ausfahrt eintragen" class="btn btn-primary w-full col-span-4 m-auto"/>
</form>
{% endmacro new %}
{% macro boat_select(id="boat_id") %}
{{ macros::select(label="Boot", data=boats, name="boat_id", id=id, display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats", "on_water", "default_destination"], wrapper_class="col-span-4", show_seats=true) }}
{% endmacro boat_select %}
{% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %}
{#{% if not amount_seats or amount_seats > 1 %}#}
<div class="{{ class }}">
<label for="{{id}}" class="text-sm text-gray-600 dark:text-gray-100">Ruderer (inkl. Schiffsführer und Steuerperson)</label>
<select style="width: 100%;" multiple name="rowers[]" id="{{id}}" class="w-full" data-seats="{{amount_seats}}" data-init={{init}}>
{% for user in users %}
{% set_global sel = false %}
{% for rower in selected %}
{% if rower.id == user.id %}
{% set_global sel = true %}
{% endif %}
{% endfor %}
<option value="{{ user.id }}" {% if sel %} selected {% endif %} {% if user.on_water %} disabled="disabled" {% endif %} data-custom-properties='{"is_cox": {{ "cox" in user.roles }}, "is_racing": {{ "Rennrudern" in user.roles }}, "steers": {{ user.id == steering_person_id }}, "cox_on_boat": {{ user.id == cox_on_boat}}}'>
{{user.name}}
{% if user.on_water %}
(am Wasser)
{% endif %}
</option>
{% endfor %}
</select>
</div>
{#{% endif %}#}
{% endmacro rower_select %}
{% macro show(log, state, allowed_to_close=false) %}
<div class="grid grid-cols-1 gap-3 mb-3 w-full">
<div class="pt-2 px-3 {% if not loop.first %} border-t {% endif %}">
<div class="w-full">
<div class="flex justify-between items-center">
<div>
<strong class="block text-primary-900 dark:text-white">
{{ log.departure | date(format="%H:%M") }}
Uhr
</strong>
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{{ log.departure | date(format="%H:%M") }} Uhr</strong> ({{ log.boat.name }})" data-body="#log{{ log.id }}" class="text-sm link-primary break-all">
{{ log.boat.name }}
</a>
</div>
<div>
{% if allowed_to_close and state == "on_water" %}
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{{ log.departure | date(format="%H:%M") }} Uhr</strong> ({{ log.boat.name }})" data-body="#close{{ log.id }}" class="border-0 btn btn-dark text-white flex items-center justify-center ml-3">
{% include "includes/pencil" %}
</a>
{% endif %}
</div>
</div>
<div class="hidden">
{% if allowed_to_close and state == "on_water" %}
<div id="close{{ log.id }}">
{{ log::home(log=log) }}
</div>
<div>
LÖSCHEN
</div>
{% endif %}
<div id="log{{ log.id }}">
{% if log.destination %}
{{ log.destination }}
{% endif %}
{% for rower in log.rowers %}
<p>{{ rower.name }} {% if rower.id == log.shipmaster or rower.id == log.steering_person %}<small class="text-gray-600 dark:text-primary-100">({% if rower.id == log.shipmaster %}Schiffsführer{% endif %}{% if rower.id == log.shipmaster and rower.id == log.steering_person %}/{% endif %}{% if rower.id == log.steering_person%}Steuerperson{% endif %})</small>{% endif %}</p>
{% endfor %}
{% set amount_rowers = log.rowers | length %}
{% set amount_guests = log.boat.amount_seats - amount_rowers -1 %}
{% if amount_guests > 0 %}
Gäste <small class="text-gray-600">(ohne Account)</small>:
{{ amount_guests }}
{% endif %}
{% if allowed_to_close and state == "on_water" %}
<a href="/log/{{ log.id }}/delete" class="btn btn-alert w-full absolute bottom-0 left-0" style="border-radius: 0;" onclick="return confirm('Willst du diesen Eintrag wirklich löschen? Die Daten gehen verloren');">Löschen</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endmacro show %}
{% macro show_old(log, state, allowed_to_close=false, index) %}
<div class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative" data-filterable="true" data-filter="{{ log.boat.name }} {% for rower in log.rowers %} {{ rower.name }} {% endfor %}">
{% if log.logtype %}
<div class="absolute top-0 right-0 bg-primary-100 rounded-bl-md text-primary-950 text-xs w-32 px-2 py-1 text-center font-bold">
{% if log.logtype == 1 %}
Wanderfahrt
{% else %}
{% if log.logtype == 2 %}
Regatta
{% else %}
{{ log.logtype }}
{% endif %}
{% endif %}
</div>
{% endif %}
<div {% if log.logtype %} class="mt-4 sm:mt-0" {% endif %}>
<strong class="text-black dark:text-white">{{ log.boat.name }}</strong> <small class="text-gray-600 dark:text-gray-100">({{ log.shipmaster_user.name }}{% if log.shipmaster_only_steering %} - handgesteuert {% endif %})</small>
<small class="block text-gray-600 dark:text-gray-100">
{% if state == "completed" and log.departure | date(format='%d.%m.%Y') == log.arrival | date(format='%d.%m.%Y') %}
{{ log.departure | date(format='%d.%m.%Y')}} ({{ log.departure | date(format='%H:%M')}} - {{ log.arrival | date(format='%H:%M')}})
{% else %}
{{ log.departure | date(format='%d.%m.%Y (%H:%M)') }} {% if state == "completed" %}- {{ log.arrival | date(format='%d.%m.%Y (%H:%M)') }}{% endif %}
{% endif %}
</small>
{% set amount_rowers = log.rowers | length %}
{% set amount_guests = log.boat.amount_seats - amount_rowers %}
{% if allowed_to_close and state == "on_water" %}
{{ log::home(log=log) }}
{% else %}
<div class="text-black dark:text-white">
{{ log.destination }}
{% if state == "completed" %}
<small class="text-gray-600 dark:text-gray-100">({{ log.distance_in_km }} km)</small>
{% endif %}
{% if log.comments %}
<span class="text-sm italic">- "{{ log.comments }}"</span>
{% endif %}
</div>
{% if amount_guests > 0 or log.rowers | length > 0 %}
<div class="text-sm text-gray-600 dark:text-gray-100">
Ruderer:
{% for rower in log.rowers %}
{{ rower.name }}{% if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %}, {% endif %}
{% endfor %}
{% if amount_guests > 0 and log.boat.name != 'Externes Boot' %}
Gäste <small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>: {{ amount_guests }}
{% endif %}
</div> </div>
{% endif %} </div>
{% endif %} {{ log::rower_select(id="newrower", selected=[], class="col-span-4", init=true) }}
{{ macros::select(label="Schiffsführer", data=[], name='shipmaster', id="shipmaster-newrowerjs", wrapper_class="col-span-2") }}
{{ macros::select(label="Steuerperson", data=[], name='steering_person', id="steering_person-newrowerjs", wrapper_class="col-span-2") }}
{{ macros::input(label='Abfahrtszeit', name='departure', type='datetime-local', required=true, wrapper_class='col-span-2') }}
{{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local', wrapper_class='col-span-2') }}
<div class="relative col-span-2">
<label for="destination" class="text-sm text-gray-600 dark:text-gray-100">Ziel</label>
<input class="input rounded-md set-distance-js"
type="search"
list="destinations"
placeholder="Destination"
id="destination"
name="destination"
value=""
data-relation="distance_in_km" />
<datalist id="destinations">
{% for distance in distances %}<option value="{{ distance.0 }}" distance="{{ distance.1 }}" />{% endfor %}
</datalist>
</div>
<div class="relative col-span-2">
{{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km" , type="number", min=0, value='', class="rounded-md") }}
<span class="absolute right-0 bottom-0 py-1.5 px-2 bg-white dark:bg-primary-950 border-0 text-gray-600 dark:text-gray-100 ring-1 ring-inset ring-gray-300 dark:ring-primary-950 rounded-br-md rounded-tr-md">km</span>
</div>
{{ macros::input(label="Kommentar", name="comments", type="text", wrapper_class="col-span-4") }}
{{ macros::select(label="Typ", data=logtypes, name='logtype', default="Normal", wrapper_class="col-span-4") }}
<input type="submit"
value="Ausfahrt eintragen"
class="btn btn-primary w-full col-span-4 m-auto" />
</form>
{% endmacro new %}
{% macro boat_select(id="boat_id") %}
{{ macros::select(label="Boot", data=boats, name="boat_id", id=id, display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats", "on_water", "default_destination"], wrapper_class="col-span-4", show_seats=true) }}
{% endmacro boat_select %}
{% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %}
{#{% if not amount_seats or amount_seats > 1 %}#}
<div class="{{ class }}">
<label for="{{ id }}" class="text-sm text-gray-600 dark:text-gray-100">
Ruderer (inkl. Schiffsführer und Steuerperson)
</label>
<select style="width: 100%;" multiple name="rowers[]" id="{{ id }}" class="w-full" data-seats="{{ amount_seats }}" data-init={{ init }}>
{% for user in users %}
{% set_global sel = false %}
{% for rower in selected %}
{% if rower.id == user.id %}
{% set_global sel = true %}
{% endif %}
{% endfor %}
<option value="{{ user.id }}"
{% if sel %}selected{% endif %}
{% if user.on_water %}disabled="disabled"{% endif %}
data-custom-properties='{"is_cox": {{ "cox" in user.roles }}, "is_racing": {{ "Rennrudern" in user.roles }}, "steers": {{ user.id == steering_person_id }}, "cox_on_boat": {{ user.id == cox_on_boat }}}'>
{{ user.name }}
{% if user.on_water %}(am Wasser){% endif %}
</option>
{% endfor %}
</select>
</div>
{#{% endif %}#}
{% endmacro rower_select %}
{% macro show(log, state, allowed_to_close=false) %}
<div class="grid grid-cols-1 gap-3 mb-3 w-full">
<div class="pt-2 px-3 {% if not loop.first %}border-t{% endif %}">
<div class="w-full">
<div class="flex justify-between items-center">
<div>
<strong class="block text-primary-900 dark:text-white">
{{ log.departure | date(format="%H:%M") }}
Uhr
</strong>
<a href="#"
data-sidebar="true"
data-trigger="sidebar"
data-header="<strong>{{ log.departure | date(format="%H:%M") }} Uhr</strong> ({{ log.boat.name }})"
data-body="#log{{ log.id }}"
class="text-sm link-primary break-all">{{ log.boat.name }}</a>
</div>
<div>
{% if allowed_to_close and state == "on_water" %}
<a href="#"
data-sidebar="true"
data-trigger="sidebar"
data-header="<strong>{{ log.departure | date(format="%H:%M") }} Uhr</strong> ({{ log.boat.name }})"
data-body="#close{{ log.id }}"
class="border-0 btn btn-dark text-white flex items-center justify-center ml-3">
{% include "includes/pencil" %}
</a>
{% endif %}
</div>
</div>
<div class="hidden">
{% if allowed_to_close and state == "on_water" %}
<div id="close{{ log.id }}">{{ log::home(log=log) }}</div>
<div>LÖSCHEN</div>
{% endif %}
<div id="log{{ log.id }}">
{% if log.destination %}{{ log.destination }}{% endif %}
{% for rower in log.rowers %}
<p>
{{ rower.name }}
{% if rower.id == log.shipmaster or rower.id == log.steering_person %}
<small class="text-gray-600 dark:text-primary-100">(
{% if rower.id == log.shipmaster %}Schiffsführer{% endif %}
{% if rower.id == log.shipmaster and rower.id == log.steering_person %}/{% endif %}
{% if rower.id == log.steering_person %}Steuerperson{% endif %}
)</small>
{% endif %}
</p>
{% endfor %}
{% set amount_rowers = log.rowers | length %}
{% set amount_guests = log.boat.amount_seats - amount_rowers %}
{% if amount_guests > 0 %}
Gäste <small class="text-gray-600">(ohne Account)</small>:
{{ amount_guests }}
{% endif %}
{% if allowed_to_close and state == "on_water" %}
<a href="/log/{{ log.id }}/delete"
class="btn btn-alert w-full absolute bottom-0 left-0"
style="border-radius: 0"
onclick="return confirm('Willst du diesen Eintrag wirklich löschen? Die Daten gehen verloren');">Löschen</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endmacro show %}
{% macro show_old(log, state, allowed_to_close=false, index) %}
<div class="border-t bg-white dark:bg-primary-900 py-3 px-4 relative"
data-filterable="true"
data-filter="{{ log.boat.name }} {% for rower in log.rowers %}{{ rower.name }}{% endfor %}">
{% if log.logtype %}
<div class="absolute top-0 right-0 bg-primary-100 rounded-bl-md text-primary-950 text-xs w-32 px-2 py-1 text-center font-bold">
{% if log.logtype == 1 %}
Wanderfahrt
{% else %}
{% if log.logtype == 2 %}
Regatta
{% else %}
{{ log.logtype }}
{% endif %}
{% endif %}
</div>
{% endif %}
<div {% if log.logtype %}class="mt-4 sm:mt-0"{% endif %}>
<strong class="text-black dark:text-white">{{ log.boat.name }}</strong> <small class="text-gray-600 dark:text-gray-100">({{ log.shipmaster_user.name -}}
{% if log.shipmaster_only_steering %}
- handgesteuert
{% endif -%}
)</small>
<small class="block text-gray-600 dark:text-gray-100">
{% if state == "completed" and log.departure | date(format='%d.%m.%Y') == log.arrival | date(format='%d.%m.%Y') %}
{{ log.departure | date(format='%d.%m.%Y') }} ({{ log.departure | date(format='%H:%M') }} - {{ log.arrival | date(format='%H:%M') }})
{% else %}
{{ log.departure | date(format='%d.%m.%Y (%H:%M)') }}
{% if state == "completed" %}
- {{ log.arrival | date(format='%d.%m.%Y (%H:%M)') }}
{% endif %}
{% endif %}
</small>
{% set amount_rowers = log.rowers | length %}
{% set amount_guests = log.boat.amount_seats - amount_rowers %}
{% if allowed_to_close and state == "on_water" %}
{{ log::home(log=log) }}
{% else %}
<div class="text-black dark:text-white">
{{ log.destination }}
{% if state == "completed" %}
<small class="text-gray-600 dark:text-gray-100">({{ log.distance_in_km }} km)</small>
{% endif %}
{% if log.comments %}<span class="text-sm italic">- "{{ log.comments }}"</span>{% endif %}
</div>
{% if amount_guests > 0 or log.rowers | length > 0 %}
<div class="text-sm text-gray-600 dark:text-gray-100">
Ruderer:
{% for rower in log.rowers -%}
{{ rower.name -}}
{% if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %},{% endif %}
{% endfor %}
{% if amount_guests > 0 and log.boat.name != 'Externes Boot' %}
Gäste <small class="text-gray-600 dark:text-gray-100">(ohne Account)</small>: {{ amount_guests }}
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
</div> </div>
</div>
{% endmacro show_old %} {% endmacro show_old %}
{% macro home(log) %} {% macro home(log) %}
<form class="grid grid-cols-1 gap-3" action="/log/{{log.id}}" method="post"> <form class="grid grid-cols-1 gap-3"
{{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local', required=true, class="change-id-js rounded-md current-date-time") }} action="/log/{{ log.id }}"
method="post">
<div> {{ macros::input(label='Ankunftszeit', name='arrival', type='datetime-local', required=true, class="change-id-js rounded-md current-date-time") }}
<label for="destination" class="text-sm text-gray-600 dark:text-gray-100">Ziel</label> <div>
<label for="destination" class="text-sm text-gray-600 dark:text-gray-100">Ziel</label>
<input class="input rounded-md set-distance-js change-id-js" type="search" list="destinations" placeholder="Destination" required="required" id="destination{{ log.id }}" name="destination" value="{{log.destination}}" data-relation="distance_in_km{{log.id}}"/> <input class="input rounded-md set-distance-js change-id-js"
</div> type="search"
list="destinations"
<div class="relative"> placeholder="Destination"
{{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km" ~ log.id , type="number", min=0, value=log.distance_in_km, required=true, class="rounded-md change-id-js") }} required="required"
<span class="absolute right-0 bottom-0 py-1.5 px-2 bg-white dark:bg-primary-950 border-0 text-gray-600 dark:text-gray-100 ring-1 ring-inset ring-gray-300 dark:ring-primary-950 rounded-br-md rounded-tr-md">km</span> id="destination{{ log.id }}"
</div> name="destination"
value="{{ log.destination }}"
{{ macros::input(label="Kommentar", name="comments", id="comments" ~ log.id, type="text", value=log.comments, class="rounded-md change-id-js") }} data-relation="distance_in_km{{ log.id }}" />
</div>
<details class="bg-gray-200 bg-opacity-80 dark:bg-primary-900 rounded-md p-2"> <div class="relative">
<summary class="cursor-pointer">Details ändern</summary> {{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km" ~ log.id , type="number", min=0, value=log.distance_in_km, required=true, class="rounded-md change-id-js") }}
<div class="grid grid-cols-1 gap-3"> <span class="absolute right-0 bottom-0 py-1.5 px-2 bg-white dark:bg-primary-950 border-0 text-gray-600 dark:text-gray-100 ring-1 ring-inset ring-gray-300 dark:ring-primary-950 rounded-br-md rounded-tr-md">km</span>
{{ macros::input(label='Abfahrtszeit', name='departure', type='datetime-local', required=true, class="change-id-js rounded-md", value=log.departure) }} </div>
{{ log::rower_select(id="rowers"~log.id, selected=log.rowers, amount_seats=log.boat.amount_seats, steering_person_id=log.steering_user.id, cox_on_boat=log.shipmaster_user.id) }} {{ macros::input(label="Kommentar", name="comments", id="comments" ~ log.id, type="text", value=log.comments, class="rounded-md change-id-js") }}
{{ macros::select(label="Schiffsführer", data=[], name='shipmaster', id="shipmaster-rowers"~log.id, class="change-id-js", selected_id=log.shipmaster_user.id, required=true) }} <details class="bg-gray-200 bg-opacity-80 dark:bg-primary-900 rounded-md p-2">
{{ macros::select(label="Steuerperson", data=[], name='steering_person', id="steering_person-rowers"~log.id, class="change-id-js", selected_id=log.steering_user.id, required=true) }} <summary class="cursor-pointer">Details ändern</summary>
<div>{{ macros::checkbox(label="Handgesteuert", name="shipmaster_only_steering", id="shipmaster_only_steering" ~ log.id , checked=log.shipmaster_only_steering,class="rounded-md change-id-js") }}</div> <div class="grid grid-cols-1 gap-3">
{{ macros::select(label="Typ", data=logtypes, name="logtype", id="logtype" ~ log.id, default="Normal", selected_id=log.logtype, class="rounded-md change-id-js") }} {{ macros::input(label='Abfahrtszeit', name='departure', type='datetime-local', required=true, class="change-id-js rounded-md", value=log.departure) }}
</div> {{ log::rower_select(id="rowers"~log.id, selected=log.rowers, amount_seats=log.boat.amount_seats, steering_person_id=log.steering_user.id, cox_on_boat=log.shipmaster_user.id) }}
</details> {{ macros::select(label="Schiffsführer", data=[], name='shipmaster', id="shipmaster-rowers"~log.id, class="change-id-js", selected_id=log.shipmaster_user.id, required=true) }}
{{ macros::select(label="Steuerperson", data=[], name='steering_person', id="steering_person-rowers"~log.id, class="change-id-js", selected_id=log.steering_user.id, required=true) }}
<div>
<input class="btn btn-primary" type="submit" value="Ausfahrt beenden"/> {{ macros::checkbox(label="Handgesteuert", name="shipmaster_only_steering", id="shipmaster_only_steering" ~ log.id , checked=log.shipmaster_only_steering,class="rounded-md change-id-js") }}
</form> </div>
{{ macros::select(label="Typ", data=logtypes, name="logtype", id="logtype" ~ log.id, default="Normal", selected_id=log.logtype, class="rounded-md change-id-js") }}
</div>
</details>
<input class="btn btn-primary" type="submit" value="Ausfahrt beenden" />
</form>
{% endmacro home %} {% endmacro home %}

View File

@ -1,3 +1,8 @@
<svg width="16" height="16" fill="currentColor" class="inline h-4 w-4 text-primary-300 group-hover:text-primary-400 mr-2" viewbox="0 0 16 16" style="margin-top: -0.2rem"> <svg width="16"
<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"/> height="16"
fill="currentColor"
class="inline h-4 w-4 text-primary-300 group-hover:text-primary-400 mr-2"
viewbox="0 0 16 16"
style="margin-top: -0.2rem">
<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 383 B

View File

@ -1,3 +1,6 @@
<svg class="h-5 w-5 text-primary-300 group-hover:text-primary-400" viewbox="0 0 20 20" fill="currentColor" aria-hidden="true"> <svg class="h-5 w-5 text-primary-300 group-hover:text-primary-400"
<path fill-rule="evenodd" d="M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z" clip-rule="evenodd"/> viewbox="0 0 20 20"
fill="currentColor"
aria-hidden="true">
<path fill-rule="evenodd" d="M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z" clip-rule="evenodd" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 347 B

View File

@ -1,237 +1,196 @@
{% macro header(loggedin_user) %} {% macro header(loggedin_user) %}
<header <header class="bg-primary-900 text-white flex justify-center p-3 fixed w-full z-10">
class="bg-primary-900 text-white flex justify-center p-3 fixed w-full z-10" <div class="max-w-screen-xl w-full flex justify-between items-center">
> <div class="w-1/3 truncate">
<div class="max-w-screen-xl w-full flex justify-between items-center"> {% if "Donau Linz" in loggedin_user.roles %}
<div class="w-1/3 truncate"> <a href="/planned">
{% if "Donau Linz" in loggedin_user.roles %} {% else %}
<a href="/planned"> <a href="/">
{% else %} {% endif %}
<a href="/">
{% endif %} {{ loggedin_user.name }}
</a>
{{ loggedin_user.name }} </div>
</a> <div>
</div> <a href="https://wiki.rudernlinz.at/ruderassistent#faq"
target="_blank"
<div> class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
<a {% include "includes/question-icon" %}
href="https://wiki.rudernlinz.at/ruderassistent#faq" <span class="sr-only">FAQs</span>
target="_blank" </a>
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" {% if "scheckbuch" in loggedin_user.roles and loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
> <a href="#"
{% include "includes/question-icon" %} class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
<span class="sr-only">FAQs</span> data-sidebar="true"
</a> data-trigger="sidebar"
{% if "scheckbuch" in loggedin_user.roles and loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %} data-header="Ergo Challenge"
<a data-body="#mobile-menu-guest">
href="#" {% include "includes/book" %}
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" <span class="sr-only">Ergo</span>
data-sidebar="true" </a>
data-trigger="sidebar" <div class="hidden">
data-header="Ergo Challenge" <div id="mobile-menu-guest">
data-body="#mobile-menu-guest" <a href="/ergo" class="block w-100 py-2 hover:text-primary-600 border-t">Ergo</a>
> </div>
{% include "includes/book" %} </div>
<span class="sr-only">Ergo</span> {% endif %}
</a> {% if "scheckbuch" not in loggedin_user.roles %}
<div class="hidden"> <a href="#"
<div id="mobile-menu-guest"> class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer"
<a data-sidebar="true"
href="/ergo" data-trigger="sidebar"
class="block w-100 py-2 hover:text-primary-600 border-t" data-header="Menü"
> data-body="#mobile-menu">
Ergo {% include "includes/book" %}
</a> <span class="sr-only">Logbuch</span>
</a>
<div class="hidden">
<div id="mobile-menu">
<a href="/log" class="block w-100 py-2 hover:text-primary-600">Ausfahrt eintragen</a>
<a href="/log/show"
class="block w-100 py-2 hover:text-primary-600 border-t">Logbuch</a>
{% if loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<a href="/ergo" class="block w-100 py-2 hover:text-primary-600 border-t">Ergo</a>
{% endif %}
<a href="/stat" class="block w-100 py-2 hover:text-primary-600 border-t">Statistik</a>
<a href="/stat/boats"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsauswertung</a>
{% if "admin" in loggedin_user.roles %}
<a href="/admin/boat"
class="block w-100 py-2 hover:text-primary-600 border-t">Boote</a>
{% endif %}
<a href="/boatdamage"
class="block w-100 py-2 hover:text-primary-600 border-t">Bootsschaden</a>
</div>
</div>
{% endif %}
{% if "admin" in loggedin_user.roles or "Vorstand" in loggedin_user.roles %}
<a href="/admin/user"
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
<svg class="inline h-4"
width="16"
height="16"
fill="currentColor"
class="bi bi-person-lines-fill"
viewbox="0 0 16 16">
<path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z" />
</svg>
<span class="sr-only">Userverwaltung</span>
</a>
{% endif %}
<a href="/auth/logout"
class="inline-flex justify-center rounded-md bg-gray-200 ml-1 px-3 py-2 text-sm font-semibold text-primary-950 hover:bg-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
<svg class="inline h-4"
width="24"
height="24"
viewbox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="feather feather-log-out">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
<polyline points="16 17 21 12 16 7"></polyline>
<line x1="21" y1="12" x2="9" y2="12"></line>
</svg>
<span class="sr-only">Ausloggen</span>
</a>
</div>
</div> </div>
</div> </header>
{% endif %} <div class="h-8"></div>
{% if "scheckbuch" not in loggedin_user.roles %} {% endmacro header %}
<a {% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='', pattern='', readonly=false) %}
href="#" <div class="{{ wrapper_class }}">
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" <label for="{{ name }}"
data-sidebar="true" class="{% if hide_label %} sr-only {% else %} text-sm text-gray-600 dark:text-white {% endif %}">
data-trigger="sidebar" {{ label }}
data-header="Menü" </label>
data-body="#mobile-menu" <input {% if type=='datetime-local' %}onclick='if (!this.value) setCurrentdate(this)'{% endif %}
> {% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
{% include "includes/book" %} name="{{ name }}"
<span class="sr-only">Logbuch</span> type="{{ type }}"
</a> {% if required %}required{% endif %}
<div class="hidden"> value="{{ value }}"
<div id="mobile-menu"> class="input {{ class }}"
<a href="/log" class="block w-100 py-2 hover:text-primary-600"> placeholder="{% if hide_label %}{{ label }}{% endif %}"
Ausfahrt eintragen {% if min is defined %}min="{{ min }}"{% endif %}
</a> {% if autofocus %}autofocus{% endif %}
<a {% if pattern %}pattern="{{ pattern }}"{% endif %}
href="/log/show" {% if readonly %}readonly{% endif %}>
class="block w-100 py-2 hover:text-primary-600 border-t"
>
Logbuch
</a>
{% if loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<a
href="/ergo"
class="block w-100 py-2 hover:text-primary-600 border-t"
>
Ergo
</a>
{% endif %}
<a
href="/stat"
class="block w-100 py-2 hover:text-primary-600 border-t"
>
Statistik
</a>
<a
href="/stat/boats"
class="block w-100 py-2 hover:text-primary-600 border-t"
>
Bootsauswertung
</a>
{% if "admin" in loggedin_user.roles %}
<a
href="/admin/boat"
class="block w-100 py-2 hover:text-primary-600 border-t"
>
Boote
</a>
{% endif %}
<a
href="/boatdamage"
class="block w-100 py-2 hover:text-primary-600 border-t"
>
Bootsschaden
</a>
</div>
</div> </div>
{% endif %} {% endmacro input %}
{% if "admin" in loggedin_user.roles %} {% macro checkbox(label, name, id='', checked=false, class='', disabled=false) %}
<a <label for="{{ name }}{{ id }}"
href="/admin/user" class="flex items-center cursor-pointer text-black dark:text-white hover:text-gray-900 dark:hover:text-gray-100 {{ class }}">
class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" <input type="checkbox"
> id="{{ name }}{{ id }}"
<svg name="{{ name }}"
class="inline h-4" {% if checked %}checked{% endif %}
width="16" {% if disabled %}disabled{% endif %}
height="16" class="h-4 w-4 accent-primary-600 dark:accent-primary-200 mr-2" />
fill="currentColor" {{ label }}
class="bi bi-person-lines-fill" </label>
viewbox="0 0 16 16" {% endmacro checkbox %}
> {% macro select(label, data, name='trip_type', default='', id='', selected_id='', display='', extras='', class='', wrapper_class='', required=false, show_seats=false, new_last_entry='') %}
<path <div class="{{ wrapper_class }}">
d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z" <label for="{{ name }}" class="text-sm text-gray-600 dark:text-gray-100">{{ label }}</label>
/> {% if display == '' %}
</svg> {% set display = ["name"] %}
<span class="sr-only">Userverwaltung</span> {% endif %}
</a> <select name="{{ name }}"
{% endif %} {% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %}
<a class="input rounded-md {{ class }}"
href="/auth/logout" {% if required %}required="required"{% endif %}>
class="inline-flex justify-center rounded-md bg-gray-200 ml-1 px-3 py-2 text-sm font-semibold text-primary-950 hover:bg-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer" {% if default %}<option selected value>{{ default }}</option>{% endif %}
> {% for d in data %}
<svg <option value="{{ d.id }}" {% if d.id == selected_id %}selected{% endif %} {% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data-{{ extra }}={{ d[extra] }} {% else %} {% if d[extra] %}disabled{% endif %} {% endif %} {% endfor %} {% endif %} {% if show_seats %} data-custom-properties='{"amount_seats": {{ d["amount_seats"] }}, "owner": "{{ d["owner"] }}", "default_destination": "{{ d["default_destination"] }}", "boat_in_ottensheim": {{ d["location_id"] == 2 }}}'{% endif %}>
class="inline h-4" {% for displa in display -%}
width="24" {%- if d[displa] -%}
height="24" {{- d[displa] -}}
viewbox="0 0 24 24" {%- else -%}
fill="none" {{- displa -}}
stroke="currentColor" {%- endif -%}
stroke-width="2" {%- endfor %}
stroke-linecap="round" </option>
stroke-linejoin="round" {% endfor %}
class="feather feather-log-out" {% if new_last_entry %}<option value="-1">{{ new_last_entry }}</option>{% endif %}
> </select>
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path> </div>
<polyline points="16 17 21 12 16 7"></polyline> {% endmacro select %}
<line x1="21" y1="12" x2="9" y2="12"></line> {% macro alert(message, type, class='') %}
</svg> <div class="{{ class }} alert-{{ type }} text-white px-3 py-1 rounded-md text-center">{{ message }}</div>
<span class="sr-only">Ausloggen</span> {% endmacro alert %}
</a> {% macro box(participants, empty_seats='', header='Freie Plätze:', text='Keine Ruderer angemeldet', bg='primary-600', color='white', trip_details_id='', allow_removing=false) %}
</div> <div class="text-{{ color }} bg-{{ bg }} text-center p-1 mt-1 rounded-t-md">
</div> {{ header }}
</header> {{ empty_seats }}
<div class="h-8"></div> </div>
{% endmacro header %} <div class="p-2 border border-t-0 border-{{ bg }} mb-4 rounded-b-md">
{% if participants | length > 0 %}
{% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='', pattern='', readonly=false) %} {% for rower in participants %}
<div class="{{wrapper_class}}"> {{ rower.name }}
<label for="{{ name }}" class="{% if hide_label %} sr-only {% else %} text-sm text-gray-600 dark:text-white {% endif %}">{{ label }}</label> {% if rower.is_guest %}<small class="text-gray-600 dark:text-gray-100">(Scheckbuch)</small>{% endif %}
<input {% if type=='datetime-local' %} onclick='if (!this.value) setCurrentdate(this)' {% endif %}{% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %} name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{% if hide_label %}{{ label }}{% endif %}" {% if min is defined %} min="{{ min }}" {% endif %} {% if autofocus %} autofocus {% endif %}{% if pattern %}pattern="{{ pattern }}"{% endif %}{% if readonly %}readonly{% endif %}> {% if rower.is_real_guest %}
</div> <small class="text-gray-600 dark:text-gray-100">(Gast)</small>
{% endmacro input %} {% if allow_removing %}
<a href="/planned/remove/{{ trip_details_id }}/{{ rower.name }}"
{% macro checkbox(label, name, id='', checked=false, class='', disabled=false) %} class="btn btn-attention btn-fw">Abmelden</a>
<label for="{{ name }}{{ id }}" class="flex items-center cursor-pointer text-black dark:text-white hover:text-gray-900 dark:hover:text-gray-100 {{ class }}"> {% endif %}
<input type="checkbox" id="{{ name }}{{ id }}" name="{{ name }}" {% if checked %} checked {% endif %} {% if disabled %} disabled {% endif %} class="h-4 w-4 accent-primary-600 dark:accent-primary-200 mr-2"/> {% endif %}
{{ label }} <span class="hidden">(angemeldet seit
</label> {{ rower.registered_at }})</span>
{% endmacro checkbox %} <br />
{% endfor %}
{% macro select(label, data, name='trip_type', default='', id='', selected_id='', display='', extras='', class='', wrapper_class='', required=false, show_seats=false, new_last_entry='') %} {% else %}
<div class="{{wrapper_class}}"> {{ text }}
<label for="{{ name }}" class="text-sm text-gray-600 dark:text-gray-100">{{ label }}</label> {% endif %}
{% if display == '' %} </div>
{% set display = ["name"] %} {% endmacro box %}
{% endif %} {% macro faq(question, answer) %}
<select name="{{ name }}" {% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %} class="input rounded-md {{ class }}" {% if required %}required="required"{% endif %}> <div>
{% if default %} <h2 class="flex mb-4 text-lg font-bold text-primary-900">{{ question }}</h2>
<option selected value>{{ default }}</option> <p class="text-primary-950">{{ answer | safe }}</p>
{% endif %} </div>
{% for d in data %} {% endmacro faq %}
<option value="{{ d.id }}" {% if d.id == selected_id %} selected {% endif %} {% if extras != '' %} {% for extra in extras %} {% if extra != 'on_water' and d[extra] %} data-{{extra}}={{d[extra]}} {% else %} {% if d[extra] %} disabled {% endif %} {% endif %} {% endfor %} {% endif %} {% if show_seats %} data-custom-properties='{"amount_seats": {{ d["amount_seats"] }}, "owner": "{{ d["owner"] }}", "default_destination": "{{ d["default_destination"] }}", "boat_in_ottensheim": {{ d["location_id"] == 2 }}}'{% endif %}>
{% for displa in display -%}
{%- if d[displa] -%}
{{- d[displa] -}}
{%- else -%}
{{- displa -}}
{%- endif -%}
{%- endfor %}
</option>
{% endfor %}
{% if new_last_entry %}
<option value="-1">{{ new_last_entry }}</option>
{% endif %}
</select>
</div>
{% endmacro select %}
{% macro alert(message, type, class='') %}
<div class="{{ class }} alert-{{ type }} text-white px-3 py-1 rounded-md text-center">
{{ message }}
</div>
{% endmacro alert %}
{% macro box(participants, empty_seats='', header='Freie Plätze:', text='Keine Ruderer angemeldet', bg='primary-600', color='white', trip_details_id='', allow_removing=false) %}
<div class="text-{{ color }} bg-{{ bg }} text-center p-1 mt-1 rounded-t-md">{{ header }}
{{ empty_seats }}</div>
<div class="p-2 border border-t-0 border-{{ bg }} mb-4 rounded-b-md">
{% if participants | length > 0 %}
{% for rower in participants %}
{{ rower.name }}
{% if rower.is_guest %}
<small class="text-gray-600 dark:text-gray-100">(Scheckbuch)</small>
{% endif %}
{% if rower.is_real_guest %}
<small class="text-gray-600 dark:text-gray-100">(Gast)</small>
{% if allow_removing %}
<a href="/planned/remove/{{ trip_details_id }}/{{ rower.name }}" class="btn btn-attention btn-fw">Abmelden</a>
{% endif %}
{% endif %}
<span class="hidden">(angemeldet seit
{{ rower.registered_at }})</span><br/>
{% endfor %}
{% else %}
{{ text }}
{% endif %}
</div>
{% endmacro box %}
{% macro faq(question, answer) %}
<div>
<h2 class="flex mb-4 text-lg font-bold text-primary-900">
{{ question }}
</h2>
<p class="text-primary-950">{{ answer | safe }}</p>
</div>
{% endmacro faq %}

View File

@ -1,4 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg"
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/> width="16"
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/> height="16"
fill="currentColor"
class="bi bi-pencil-square"
viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 579 B

After

Width:  |  Height:  |  Size: 610 B

View File

@ -1,3 +1,8 @@
<svg class="inline h-5 w-5" width="16" height="16" fill="currentColor" class="bi bi-plus" viewbox="0 0 16 16"> <svg class="inline h-5 w-5"
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/> width="16"
height="16"
fill="currentColor"
class="bi bi-plus"
viewbox="0 0 16 16">
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 262 B

View File

@ -1,4 +1 @@
<script>var QRCodep;!function(){function a(a){this.mode=j.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=0,c=this.data.length;c>b;b++){var d=[],e=this.data.charCodeAt(b);e>65536?(d[0]=240|(1835008&e)>>>18,d[1]=128|(258048&e)>>>12,d[2]=128|(4032&e)>>>6,d[3]=128|63&e):e>2048?(d[0]=224|(61440&e)>>>12,d[1]=128|(4032&e)>>>6,d[2]=128|63&e):e>128?(d[0]=192|(1984&e)>>>6,d[1]=128|63&e):d[0]=e,this.parsedData.push(d)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function c(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function d(a,b){this.totalCount=a,this.dataCount=b}function e(){this.buffer=[],this.length=0}function f(){return"undefined"!=typeof CanvasRenderingContext2D}function g(){var a=!1,b=navigator.userAgent;if(/android/i.test(b)){a=!0;var c=b.toString().match(/android ([0-9]\.[0-9])/i);c&&c[1]&&(a=parseFloat(c[1]))}return a}function h(a,b){for(var c=1,d=i(a),e=0,f=p.length;f>=e;e++){var g=0;switch(b){case k.L:g=p[e][0];break;case k.M:g=p[e][1];break;case k.Q:g=p[e][2];break;case k.H:g=p[e][3]}if(g>=d)break;c++}if(c>p.length)throw new Error("Too long data");return c}function i(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=m.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=a%2==0);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=b%2==0)},setupPositionAdjustPattern:function(){for(var a=m.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var g=-2;2>=g;g++)-2==f||2==f||-2==g||2==g||0==f&&0==g?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){for(var b=m.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=m.getBCHTypeInfo(c),e=0;15>e;e++){var f=!a&&1==(d>>e&1);6>e?this.modules[e][8]=f:8>e?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;15>e;e++){var f=!a&&1==(d>>e&1);8>e?this.modules[8][this.moduleCount-e-1]=f:9>e?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,g=this.moduleCount-1;g>0;g-=2)for(6==g&&g--;;){for(var h=0;2>h;h++)if(null==this.modules[d][g-h]){var i=!1;f<a.length&&(i=1==(a[f]>>>e&1));var j=m.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,-1==e&&(f++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,f){for(var g=d.getRSBlocks(a,c),h=new e,i=0;i<f.length;i++){var j=f[i];h.put(j.mode,4),h.put(j.getLength(),m.getLengthInBits(j.mode,a)),j.write(h)}for(var k=0,i=0;i<g.length;i++)k+=g[i].dataCount;if(h.getLengthInBits()>8*k)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+8*k+")");for(h.getLengthInBits()+4<=8*k&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;;){if(h.getLengthInBits()>=8*k)break;if(h.put(b.PAD0,8),h.getLengthInBits()>=8*k)break;h.put(b.PAD1,8)}return b.createBytes(h,g)},b.createBytes=function(a,b){for(var d=0,e=0,f=0,g=new Array(b.length),h=new Array(b.length),i=0;i<b.length;i++){var j=b[i].dataCount,k=b[i].totalCount-j;e=Math.max(e,j),f=Math.max(f,k),g[i]=new Array(j);for(var l=0;l<g[i].length;l++)g[i][l]=255&a.buffer[l+d];d+=j;var n=m.getErrorCorrectPolynomial(k),o=new c(g[i],n.getLength()-1),p=o.mod(n);h[i]=new Array(n.getLength()-1);for(var l=0;l<h[i].length;l++){var q=l+p.getLength()-h[i].length;h[i][l]=q>=0?p.get(q):0}}for(var r=0,l=0;l<b.length;l++)r+=b[l].totalCount;for(var s=new Array(r),t=0,l=0;e>l;l++)for(var i=0;i<b.length;i++)l<g[i].length&&(s[t++]=g[i][l]);for(var l=0;f>l;l++)for(var i=0;i<b.length;i++)l<h[i].length&&(s[t++]=h[i][l]);return s};for(var j={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var b=a<<10;m.getBCHDigit(b)-m.getBCHDigit(m.G15)>=0;)b^=m.G15<<m.getBCHDigit(b)-m.getBCHDigit(m.G15);return(a<<10|b)^m.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;m.getBCHDigit(b)-m.getBCHDigit(m.G18)>=0;)b^=m.G18<<m.getBCHDigit(b)-m.getBCHDigit(m.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return m.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case l.PATTERN000:return(b+c)%2==0;case l.PATTERN001:return b%2==0;case l.PATTERN010:return c%3==0;case l.PATTERN011:return(b+c)%3==0;case l.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case l.PATTERN101:return b*c%2+b*c%3==0;case l.PATTERN110:return(b*c%2+b*c%3)%2==0;case l.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new c([1],0),d=0;a>d;d++)b=b.multiply(new c([1,n.gexp(d)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case j.MODE_NUMBER:return 10;case j.MODE_ALPHA_NUM:return 9;case j.MODE_8BIT_BYTE:return 8;case j.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case j.MODE_NUMBER:return 12;case j.MODE_ALPHA_NUM:return 11;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case j.MODE_NUMBER:return 14;case j.MODE_ALPHA_NUM:return 13;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||0==h&&0==i||g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,0!=j&&4!=j||(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},n={glog:function(a){if(1>a)throw new Error("glog("+a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;8>o;o++)n.EXP_TABLE[o]=1<<o;for(var o=8;256>o;o++)n.EXP_TABLE[o]=n.EXP_TABLE[o-4]^n.EXP_TABLE[o-5]^n.EXP_TABLE[o-6]^n.EXP_TABLE[o-8];for(var o=0;255>o;o++)n.LOG_TABLE[n.EXP_TABLE[o]]=o;c.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var e=0;e<a.getLength();e++)b[d+e]^=n.gexp(n.glog(this.get(d))+n.glog(a.get(e)));return new c(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var b=n.glog(this.get(0))-n.glog(a.get(0)),d=new Array(this.getLength()),e=0;e<this.getLength();e++)d[e]=this.get(e);for(var e=0;e<a.getLength();e++)d[e]^=n.gexp(n.glog(a.get(e))+b);return new c(d,0).mod(a)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(a,b){var c=d.getRsBlockTable(a,b);if(void 0==c)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var e=c.length/3,f=[],g=0;e>g;g++)for(var h=c[3*g+0],i=c[3*g+1],j=c[3*g+2],k=0;h>k;k++)f.push(new d(i,j));return f},d.getRsBlockTable=function(a,b){switch(b){case k.L:return d.RS_BLOCK_TABLE[4*(a-1)+0];case k.M:return d.RS_BLOCK_TABLE[4*(a-1)+1];case k.Q:return d.RS_BLOCK_TABLE[4*(a-1)+2];case k.H:return d.RS_BLOCK_TABLE[4*(a-1)+3];default:return}},e.prototype={get:function(a){var b=Math.floor(a/8);return 1==(this.buffer[b]>>>7-a%8&1)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],q=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function b(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var c=this._htOption,d=this._el,e=a.getModuleCount();Math.floor(c.width/e),Math.floor(c.height/e);this.clear();var f=b("svg",{viewBox:"0 0 "+String(e)+" "+String(e),width:"100%",height:"100%",fill:c.colorLight});f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),d.appendChild(f),f.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"})),f.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(var g=0;e>g;g++)for(var h=0;e>h;h++)if(a.isDark(g,h)){var i=b("use",{x:String(h),y:String(g)});i.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),f.appendChild(i)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),r="svg"===document.documentElement.tagName.toLowerCase(),s=r?q:f()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function b(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&c._fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,void(d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var c=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,b,e,f,g,h,i,j,k){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*c;else"undefined"==typeof j&&(arguments[1]*=c,arguments[2]*=c,arguments[3]*=c,arguments[4]*=c);d.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=g(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&b.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCodep=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._htOption.useSVG&&(s=q),this._android=g(),this._el=a,this._oQRCode=null,this._htOption.text&&this.makeCode(this._htOption.text)},QRCodep.prototype.makeCode=function(a){this._oQRCode=new b(h(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,-1!=this._htOption.dpi&&-1!=this._htOption.mmPerDot&&(this._htOption.width=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot,this._htOption.height=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot),this._oDrawing=new s(this._el,this._htOption),this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCodep.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCodep.prototype.clear=function(){this._oDrawing.clear()},QRCodep.CorrectLevel=k}();var sepaQR;!function(){"use strict";var a={UTF_8:1,ISO8859_1:2,ISO8859_2:3,ISO8859_4:4,ISO8859_5:5,ISO8859_7:6,ISO8859_10:7,ISO8859_15:8};sepaQR=function(b){if(this._sOpt={serviceTag:"BCD",version:"001",charset:a.UTF_8,identificationCode:"SCT",benefBIC:"",benefName:"",benefAccNr:"",amountEuro:"",purpose:"",creditorRef:"",remittanceInf:"",information:""},b)for(var c in b)this._sOpt[c]=b[c]},sepaQR.prototype.validServiceTag=function(){return"BCD"===this._sOpt.serviceTag},sepaQR.prototype.validVersion=function(){return"001"===this._sOpt.version||"002"===this._sOpt.version},sepaQR.prototype.validCharset=function(){return this._sOpt.charset>0&&this._sOpt.charset<=8},sepaQR.prototype.validIdentificationCode=function(){return"SCT"===this._sOpt.identificationCode},sepaQR.prototype.validBenefName=function(){var a="string"==typeof this._sOpt.benefName&&this._sOpt.benefName.length>=1&&this._sOpt.benefName.length<=70;if(!a)throw new Error("benefName not valid!");return a},sepaQR.prototype.validBenefAccNr=function(){var a="string"==typeof this._sOpt.benefAccNr&&this._sOpt.benefAccNr.length>=1&&this._sOpt.benefAccNr.length<=34;if(!a)throw new Error("benefAccNr not valid!");return a},sepaQR.prototype.validAmountEuro=function(){if("string"==typeof this._sOpt.amountEuro)return 0===this._sOpt.amountEuro.length;if("number"==typeof this._sOpt.amountEuro){this._sOpt.amountEuro=Math.round(100*this._sOpt.amountEuro)/100;var a=this._sOpt.amountEuro>.01&&this._sOpt.amountEuro<=999999999.99;if(!a)throw new Error("Amount not valid!");return a}},sepaQR.prototype.validBenefBic=function(){var a="002"==this._sOpt.version||"string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11;if(!a)throw new Error("BIC is mandatory in Version 001!");if(a="string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11,!a)throw new Error("benefBIC not valid!");return a},sepaQR.prototype.validPurpose=function(){var a="string"==typeof this._sOpt.purpose&&this._sOpt.purpose.length>=0&&this._sOpt.purpose.length<=4;if(!a)throw new Error("Purpose not valid!");return a},sepaQR.prototype.validInformation=function(){var a="string"==typeof this._sOpt.information&&this._sOpt.information.length>=0&&this._sOpt.information.length<=70;if(!a)throw new Error("Information not valid!");return a},sepaQR.prototype.validCreditorRefOrRemittance=function(){var a="string"==typeof this._sOpt.creditorRef&&0===this._sOpt.creditorRef.length,b="string"==typeof this._sOpt.remittanceInf&&0===this._sOpt.remittanceInf.length,c=a&&"string"==typeof this._sOpt.remittanceInf&&this._sOpt.remittanceInf.length<=140||b&&"string"==typeof this._sOpt.creditorRef&&this._sOpt.creditorRef.length<=35;if(!c)throw new Error("creditorRef or Remittance not valid!");return c},sepaQR.prototype.validQRTextLength=function(){for(var a=this.prepareQRText(),b=0,c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b+=e>65536?4:e>2048?3:e>128?2:1}return 328>=b},sepaQR.prototype.valid=function(){var a=this.validServiceTag()&&this.validVersion()&&this.validCharset()&&this.validIdentificationCode()&&this.validBenefName()&&this.validBenefAccNr()&&this.validAmountEuro()&&this.validBenefBic()&&this.validPurpose()&&this.validInformation()&&this.validPurpose()&&this.validCreditorRefOrRemittance()&&this.validQRTextLength();return a},sepaQR.prototype.prepareQRText=function(){return(this._sOpt.serviceTag+"\n"+this._sOpt.version+"\n"+this._sOpt.charset+"\n"+this._sOpt.identificationCode+"\n"+this._sOpt.benefBIC+"\n"+this._sOpt.benefName+"\n"+this._sOpt.benefAccNr+"\nEUR"+this._sOpt.amountEuro+"\n"+this._sOpt.purpose+"\n"+this._sOpt.creditorRef+"\n"+this._sOpt.remittanceInf+"\n"+this._sOpt.information).trim()},sepaQR.prototype.toQRText=function(){return this.valid()?this.prepareQRText():""},sepaQR.prototype.makeCodeInto=function(a,b){var c={width:256,height:256,mmPerDot:.85,dpi:92,correctLevel:QRCodep.CorrectLevel.M,text:this.toQRText()};if(0!==c.text.length){if(b)for(var d in b)c[d]=b[d];return this.qrcode=new QRCodep(a,c),this.drawExplanatoryLink(document.getElementById(a).getElementsByTagName("canvas")[0],document.createElement("canvas")),this.qrcode}},sepaQR.prototype.drawExplanatoryLink=function(a,b){var c=3,d=12,e=8,f=6,g=a;b.width=g.width,b.height=g.height,b.getContext("2d").drawImage(g,0,0),g.width=b.width+2*(e+c+f),g.height=b.height+2*(e+c+f),CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e,f){return 2*e>c&&(e=c/2),2*e>d&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.lineTo(a+c-f,b+d),this.moveTo(a+c-110,b+d),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this};var h=g.getContext("2d");h.fillStyle="white",h.rect(0,0,g.width,g.height),h.fill(),h.drawImage(b,e+c+f,e+c+f),h.lineWidth=c,h.roundRect(f+c/2,f+c/2,g.width-c-2*f,g.height-c-2*f,d,3*e).stroke(),h.fillStyle="black",h.font=4.5*c+"px Arial",h.fillText("sepaQR.eu",g.width-110,g.height-f/2)},sepaQR.Charset=a}();</script> <script>var QRCodep;!function(){function a(a){this.mode=j.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=0,c=this.data.length;c>b;b++){var d=[],e=this.data.charCodeAt(b);e>65536?(d[0]=240|(1835008&e)>>>18,d[1]=128|(258048&e)>>>12,d[2]=128|(4032&e)>>>6,d[3]=128|63&e):e>2048?(d[0]=224|(61440&e)>>>12,d[1]=128|(4032&e)>>>6,d[2]=128|63&e):e>128?(d[0]=192|(1984&e)>>>6,d[1]=128|63&e):d[0]=e,this.parsedData.push(d)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function c(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function d(a,b){this.totalCount=a,this.dataCount=b}function e(){this.buffer=[],this.length=0}function f(){return"undefined"!=typeof CanvasRenderingContext2D}function g(){var a=!1,b=navigator.userAgent;if(/android/i.test(b)){a=!0;var c=b.toString().match(/android ([0-9]\.[0-9])/i);c&&c[1]&&(a=parseFloat(c[1]))}return a}function h(a,b){for(var c=1,d=i(a),e=0,f=p.length;f>=e;e++){var g=0;switch(b){case k.L:g=p[e][0];break;case k.M:g=p[e][1];break;case k.Q:g=p[e][2];break;case k.H:g=p[e][3]}if(g>=d)break;c++}if(c>p.length)throw new Error("Too long data");return c}function i(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=m.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=a%2==0);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=b%2==0)},setupPositionAdjustPattern:function(){for(var a=m.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var g=-2;2>=g;g++)-2==f||2==f||-2==g||2==g||0==f&&0==g?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){for(var b=m.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=m.getBCHTypeInfo(c),e=0;15>e;e++){var f=!a&&1==(d>>e&1);6>e?this.modules[e][8]=f:8>e?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;15>e;e++){var f=!a&&1==(d>>e&1);8>e?this.modules[8][this.moduleCount-e-1]=f:9>e?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,g=this.moduleCount-1;g>0;g-=2)for(6==g&&g--;;){for(var h=0;2>h;h++)if(null==this.modules[d][g-h]){var i=!1;f<a.length&&(i=1==(a [f]>>>e&1));var j=m.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,-1==e&&(f++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,f){for(var g=d.getRSBlocks(a,c),h=new e,i=0;i<f.length;i++){var j=f[i];h.put(j.mode,4),h.put(j.getLength(),m.getLengthInBits(j.mode,a)),j.write(h)}for(var k=0,i=0;i<g.length;i++)k+=g [i].dataCount;if(h.getLengthInBits()>8*k)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+8*k+")");for(h.getLengthInBits()+4<=8*k&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;;){if(h.getLengthInBits()>=8*k)break;if(h.put(b.PAD0,8),h.getLengthInBits()>=8*k)break;h.put(b.PAD1,8)}return b.createBytes(h,g)},b.createBytes=function(a,b){for(var d=0,e=0,f=0,g=new Array(b.length),h=new Array(b.length),i=0;i<b.length;i++){var j=b[i].dataCount,k=b[i].totalCount-j;e=Math.max(e,j),f=Math.max(f,k),g[i]=new Array(j);for(var l=0;l<g[i].length;l++)g[i][l]=255&a.buffer[l+d];d+=j;var n=m.getErrorCorrectPolynomial(k),o=new c(g[i],n.getLength()-1),p=o.mod(n);h[i]=new Array(n.getLength()-1);for(var l=0;l<h[i].length;l++){var q=l+p.getLength()-h[i].length;h[i][l]=q>=0?p.get(q):0}}for(var r=0,l=0;l<b.length;l++)r+=b [l].totalCount;for(var s=new Array(r),t=0,l=0;e>l;l++)for(var i=0;i<b.length;i++)l<g [i].length&&(s[t++]=g[i][l]);for(var l=0;f>l;l++)for(var i=0;i<b.length;i++)l<h[i].length&&(s[t++]=h[i][l]);return s};for(var j={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var b=a<<10;m.getBCHDigit(b)-m.getBCHDigit(m.G15 )>=0;)b^=m.G15<<m.getBCHDigit(b)-m.getBCHDigit(m.G15);return(a<<10|b)^m.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;m.getBCHDigit(b)-m.getBCHDigit(m.G18)>=0;)b^=m.G18<<m.getBCHDigit(b)-m.getBCHDigit(m.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return m.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case l.PATTERN000:return(b+c)%2==0;case l.PATTERN001:return b%2==0;case l.PATTERN010:return c%3==0;case l.PATTERN011:return(b+c)%3==0;case l.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case l.PATTERN101:return b*c%2+b*c%3==0;case l.PATTERN110:return(b*c%2+b*c%3)%2==0;case l.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new c([1],0),d=0;a>d;d++)b=b.multiply(new c([1,n.gexp(d)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case j.MODE_NUMBER:return 10;case j.MODE_ALPHA_NUM:return 9;case j.MODE_8BIT_BYTE:return 8;case j.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case j.MODE_NUMBER:return 12;case j.MODE_ALPHA_NUM:return 11;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case j.MODE_NUMBER:return 14;case j.MODE_ALPHA_NUM:return 13;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||0==h&&0==i||g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,0!=j&&4!=j||(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},n={glog:function(a){if(1>a)throw new Error("glog("+a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;8>o;o++)n.EXP_TABLE[o]=1<<o;for(var o=8;256>o;o++)n.EXP_TABLE[o]=n.EXP_TABLE[o-4]^n.EXP_TABLE[o-5]^n.EXP_TABLE[o-6]^n.EXP_TABLE[o-8];for(var o=0;255>o;o++)n.LOG_TABLE[n.EXP_TABLE[o]]=o;c.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var e=0;e<a.getLength();e++)b[d+e]^=n.gexp(n.glog(this.get(d))+n.glog(a.get(e)));return new c(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var b=n.glog(this.get(0))-n.glog(a.get(0)),d=new Array(this.getLength()),e=0;e<this.getLength();e++)d[e]=this.get(e);for(var e=0;e<a.getLength();e++)d[e]^=n.gexp(n.glog(a.get(e))+b);return new c(d,0).mod(a)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(a,b){var c=d.getRsBlockTable(a,b);if(void 0==c)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var e=c.length/3,f=[],g=0;e>g;g++)for(var h=c[3*g+0],i=c[3*g+1],j=c[3*g+2],k=0;h>k;k++)f.push(new d(i,j));return f},d.getRsBlockTable=function(a,b){switch(b){case k.L:return d.RS_BLOCK_TABLE[4*(a-1)+0];case k.M:return d.RS_BLOCK_TABLE[4*(a-1)+1];case k.Q:return d.RS_BLOCK_TABLE[4*(a-1)+2];case k.H:return d.RS_BLOCK_TABLE[4*(a-1)+3];default:return}},e.prototype={get:function(a){var b=Math.floor(a/8);return 1==(this.buffer[b]>>>7-a%8&1)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer [b]|=128>>>this.length%8),this.length++}};var p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],q=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function b(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var c=this._htOption,d=this._el,e=a.getModuleCount();Math.floor(c.width/e),Math.floor(c.height/e);this.clear();var f=b("svg",{viewBox:"0 0 "+String(e)+" "+String(e),width:"100%",height:"100%",fill:c.colorLight});f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),d.appendChild(f),f.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"})),f.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(var g=0;e>g;g++)for(var h=0;e>h;h++)if(a.isDark(g,h)){var i=b("use",{x:String(h),y:String(g)});i.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),f.appendChild(i)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),r="svg"===document.documentElement.tagName.toLowerCase(),s=r?q:f()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function b(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&c._fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,void(d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var c=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,b,e,f,g,h,i,j,k){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*c;else"undefined"==typeof j&&(arguments[1]*=c,arguments[2]*=c,arguments[3]*=c,arguments[4]*=c);d.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=g(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&b.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCodep=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._htOption.useSVG&&(s=q),this._android=g(),this._el=a,this._oQRCode=null,this._htOption.text&&this.makeCode(this._htOption.text)},QRCodep.prototype.makeCode=function(a){this._oQRCode=new b(h(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,-1!=this._htOption.dpi&&-1!=this._htOption.mmPerDot&&(this._htOption.width=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot,this._htOption.height=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot),this._oDrawing=new s(this._el,this._htOption),this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCodep.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCodep.prototype.clear=function(){this._oDrawing.clear()},QRCodep.CorrectLevel=k}();var sepaQR;!function(){"use strict";var a={UTF_8:1,ISO8859_1:2,ISO8859_2:3,ISO8859_4:4,ISO8859_5:5,ISO8859_7:6,ISO8859_10:7,ISO8859_15:8};sepaQR=function(b){if(this._sOpt={serviceTag:"BCD",version:"001",charset:a.UTF_8,identificationCode:"SCT",benefBIC:"",benefName:"",benefAccNr:"",amountEuro:"",purpose:"",creditorRef:"",remittanceInf:"",information:""},b)for(var c in b)this._sOpt[c]=b[c]},sepaQR.prototype.validServiceTag=function(){return"BCD"===this._sOpt.serviceTag},sepaQR.prototype.validVersion=function(){return"001"===this._sOpt.version||"002"===this._sOpt.version},sepaQR.prototype.validCharset=function(){return this._sOpt.charset>0&&this._sOpt.charset<=8},sepaQR.prototype.validIdentificationCode=function(){return"SCT"===this._sOpt.identificationCode},sepaQR.prototype.validBenefName=function(){var a="string"==typeof this._sOpt.benefName&&this._sOpt.benefName.length>=1&&this._sOpt.benefName.length<=70;if(!a)throw new Error("benefName not valid!");return a},sepaQR.prototype.validBenefAccNr=function(){var a="string"==typeof this._sOpt.benefAccNr&&this._sOpt.benefAccNr.length>=1&&this._sOpt.benefAccNr.length<=34;if(!a)throw new Error("benefAccNr not valid!");return a},sepaQR.prototype.validAmountEuro=function(){if("string"==typeof this._sOpt.amountEuro)return 0===this._sOpt.amountEuro.length;if("number"==typeof this._sOpt.amountEuro){this._sOpt.amountEuro=Math.round(100*this._sOpt.amountEuro)/100;var a=this._sOpt.amountEuro>.01&&this._sOpt.amountEuro<=999999999.99;if(!a)throw new Error("Amount not valid!");return a}},sepaQR.prototype.validBenefBic=function(){var a="002"==this._sOpt.version||"string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11;if (!a)throw new Error("BIC is mandatory in Version 001!");if(a="string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11,!a)throw new Error("benefBIC not valid!");return a},sepaQR.prototype.validPurpose=function(){var a="string"==typeof this._sOpt.purpose&&this._sOpt.purpose.length>=0&&this._sOpt.purpose.length<=4;if(!a)throw new Error("Purpose not valid!");return a},sepaQR.prototype.validInformation=function(){var a="string"==typeof this._sOpt.information&&this._sOpt.information.length>=0&&this._sOpt.information.length<=70;if(!a)throw new Error("Information not valid!");return a},sepaQR.prototype.validCreditorRefOrRemittance=function(){var a="string"==typeof this._sOpt.creditorRef&&0===this._sOpt.creditorRef.length,b="string"==typeof this._sOpt.remittanceInf&&0===this._sOpt.remittanceInf.length,c=a&&"string"==typeof this._sOpt.remittanceInf&&this._sOpt.remittanceInf.length<=140||b&&"string "==typeof this._sOpt.creditorRef&&this._sOpt.creditorRef.length<=35;if(!c)throw new Error("creditorRef or Remittance not valid!");return c},sepaQR.prototype.validQRTextLength=function(){for(var a=this.prepareQRText(),b=0,c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b+=e>65536?4:e>2048?3:e>128?2:1}return 328>=b},sepaQR.prototype.valid=function(){var a=this.validServiceTag()&&this.validVersion()&&this.validCharset()&&this.validIdentificationCode()&&this.validBenefName()&&this.validBenefAccNr()&&this.validAmountEuro()&&this.validBenefBic()&&this.validPurpose()&&this.validInformation()&&this.validPurpose()&&this.validCreditorRefOrRemittance()&&this.validQRTextLength();return a},sepaQR.prototype.prepareQRText=function(){return(this._sOpt.serviceTag+"\n"+this._sOpt.version+"\n"+this._sOpt.charset+"\n"+this._sOpt.identificationCode+"\n"+this._sOpt.benefBIC+"\n"+this._sOpt.benefName+"\n"+this._sOpt.benefAccNr+"\nEUR"+this._sOpt.amountEuro+"\n"+this._sOpt.purpose+"\n"+this._sOpt.creditorRef+"\n"+this._sOpt.remittanceInf+"\n"+this._sOpt.information).trim()},sepaQR.prototype.toQRText=function(){return this.valid()?this.prepareQRText():""},sepaQR.prototype.makeCodeInto=function(a,b){var c={width:256,height:256,mmPerDot:.85,dpi:92,correctLevel:QRCodep.CorrectLevel.M,text:this.toQRText()};if(0!==c.text.length){if(b)for(var d in b)c[d]=b[d];return this.qrcode=new QRCodep(a,c),this.drawExplanatoryLink(document.getElementById(a).getElementsByTagName("canvas")[0],document.createElement("canvas")),this.qrcode}},sepaQR.prototype.drawExplanatoryLink=function(a,b){var c=3,d=12,e=8,f=6,g=a;b.width=g.width,b.height=g.height,b.getContext("2d").drawImage(g,0,0),g.width=b.width+2*(e+c+f),g.height=b.height+2*(e+c+f),CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e,f){return 2*e>c&&(e=c/2),2*e>d&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.lineTo(a+c-f,b+d),this.moveTo(a+c-110,b+d),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this};var h=g.getContext("2d");h.fillStyle="white",h.rect(0,0,g.width,g.height),h.fill(),h.drawImage(b,e+c+f,e+c+f),h.lineWidth=c,h.roundRect(f+c/2,f+c/2,g.width-c-2*f,g.height-c-2*f,d,3*e).stroke(),h.fillStyle="black",h.font=4.5*c+"px Arial",h.fillText("sepaQR.eu",g.width-110,g.height-f/2)},sepaQR.Charset=a}();</script> <script>var QRCodep;!function(){function a(a){this.mode=j.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=0,c=this.data.length;c>b;b++){var d=[],e=this.data.charCodeAt(b);e>65536?(d[0]=240|(1835008&e)>>>18,d[1]=128|(258048&e)>>>12,d[2]=128|(4032&e)>>>6,d[3]=128|63&e):e>2048?(d[0]=224|(61440&e)>>>12,d[1]=128|(4032&e)>>>6,d[2]=128|63&e):e>128?(d[0]=192|(1984&e)>>>6,d[1]=128|63&e):d[0]=e,this.parsedData.push(d)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function c(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function d(a,b){this.totalCount=a,this.dataCount=b}function e(){this.buffer=[],this.length=0}function f(){return"undefined"!=typeof CanvasRenderingContext2D}function g(){var a=!1,b=navigator.userAgent;if(/android/i.test(b)){a=!0;var c=b.toString().match(/android ([0-9]\.[0-9])/i);c&&c[1]&&(a=parseFloat(c[1]))}return a}function h(a,b){for(var c=1,d=i(a),e=0,f=p.length;f>=e;e++){var g=0;switch(b){case k.L:g=p[e][0];break;case k.M:g=p[e][1];break;case k.Q:g=p[e][2];break;case k.H:g=p[e][3]}if(g>=d)break;c++}if(c>p.length)throw new Error("Too long data");return c}function i(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=m.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=a%2==0);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=b%2==0)},setupPositionAdjustPattern:function(){for(var a=m.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var g=-2;2>=g;g++)-2==f||2==f||-2==g||2==g||0==f&&0==g?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){for(var b=m.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=m.getBCHTypeInfo(c),e=0;15>e;e++){var f=!a&&1==(d>>e&1);6>e?this.modules[e][8]=f:8>e?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;15>e;e++){var f=!a&&1==(d>>e&1);8>e?this.modules[8][this.moduleCount-e-1]=f:9>e?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,g=this.moduleCount-1;g>0;g-=2)for(6==g&&g--;;){for(var h=0;2>h;h++)if(null==this.modules[d][g-h]){var i=!1;f<a.length&&(i=1==(a[f]>>>e&1));var j=m.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,-1==e&&(f++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,f){for(var g=d.getRSBlocks(a,c),h=new e,i=0;i<f.length;i++){var j=f[i];h.put(j.mode,4),h.put(j.getLength(),m.getLengthInBits(j.mode,a)),j.write(h)}for(var k=0,i=0;i<g.length;i++)k+=g[i].dataCount;if(h.getLengthInBits()>8*k)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+8*k+")");for(h.getLengthInBits()+4<=8*k&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;;){if(h.getLengthInBits()>=8*k)break;if(h.put(b.PAD0,8),h.getLengthInBits()>=8*k)break;h.put(b.PAD1,8)}return b.createBytes(h,g)},b.createBytes=function(a,b){for(var d=0,e=0,f=0,g=new Array(b.length),h=new Array(b.length),i=0;i<b.length;i++){var j=b[i].dataCount,k=b[i].totalCount-j;e=Math.max(e,j),f=Math.max(f,k),g[i]=new Array(j);for(var l=0;l<g[i].length;l++)g[i][l]=255&a.buffer[l+d];d+=j;var n=m.getErrorCorrectPolynomial(k),o=new c(g[i],n.getLength()-1),p=o.mod(n);h[i]=new Array(n.getLength()-1);for(var l=0;l<h[i].length;l++){var q=l+p.getLength()-h[i].length;h[i][l]=q>=0?p.get(q):0}}for(var r=0,l=0;l<b.length;l++)r+=b [l].totalCount;for(var s=new Array(r),t=0,l=0;e>l;l++)for(var i=0;i<b.length;i++)l<g [i].length&&(s[t++]=g[i][l]);for(var l=0;f>l;l++)for(var i=0;i<b.length;i++)l<h[i].length&&(s[t++]=h[i][l]);return s};for(var j={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var b=a<<10;m.getBCHDigit(b)-m.getBCHDigit(m.G15 )>=0;)b^=m.G15<<m.getBCHDigit(b)-m.getBCHDigit(m.G15);return(a<<10|b)^m.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;m.getBCHDigit(b)-m.getBCHDigit(m.G18)>=0;)b^=m.G18<<m.getBCHDigit(b)-m.getBCHDigit(m.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return m.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case l.PATTERN000:return(b+c)%2==0;case l.PATTERN001:return b%2==0;case l.PATTERN010:return c%3==0;case l.PATTERN011:return(b+c)%3==0;case l.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case l.PATTERN101:return b*c%2+b*c%3==0;case l.PATTERN110:return(b*c%2+b*c%3)%2==0;case l.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new c([1],0),d=0;a>d;d++)b=b.multiply(new c([1,n.gexp(d)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case j.MODE_NUMBER:return 10;case j.MODE_ALPHA_NUM:return 9;case j.MODE_8BIT_BYTE:return 8;case j.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case j.MODE_NUMBER:return 12;case j.MODE_ALPHA_NUM:return 11;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case j.MODE_NUMBER:return 14;case j.MODE_ALPHA_NUM:return 13;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||0==h&&0==i||g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,0!=j&&4!=j||(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},n={glog:function(a){if(1>a)throw new Error("glog("+a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;8>o;o++)n.EXP_TABLE[o]=1<<o;for(var o=8;256>o;o++)n.EXP_TABLE[o]=n.EXP_TABLE[o-4]^n.EXP_TABLE[o-5]^n.EXP_TABLE[o-6]^n.EXP_TABLE[o-8];for(var o=0;255>o;o++)n.LOG_TABLE[n.EXP_TABLE[o]]=o;c.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var e=0;e<a.getLength();e++)b[d+e]^=n.gexp(n.glog(this.get(d))+n.glog(a.get(e)));return new c(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var b=n.glog(this.get(0))-n.glog(a.get(0)),d=new Array(this.getLength()),e=0;e<this.getLength();e++)d[e]=this.get(e);for(var e=0;e<a.getLength();e++)d[e]^=n.gexp(n.glog(a.get(e))+b);return new c(d,0).mod(a)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(a,b){var c=d.getRsBlockTable(a,b);if(void 0==c)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var e=c.length/3,f=[],g=0;e>g;g++)for(var h=c[3*g+0],i=c[3*g+1],j=c[3*g+2],k=0;h>k;k++)f.push(new d(i,j));return f},d.getRsBlockTable=function(a,b){switch(b){case k.L:return d.RS_BLOCK_TABLE[4*(a-1)+0];case k.M:return d.RS_BLOCK_TABLE[4*(a-1)+1];case k.Q:return d.RS_BLOCK_TABLE[4*(a-1)+2];case k.H:return d.RS_BLOCK_TABLE[4*(a-1)+3];default:return}},e.prototype={get:function(a){var b=Math.floor(a/8);return 1==(this.buffer[b]>>>7-a%8&1)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer [b]|=128>>>this.length%8),this.length++}};var p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],q=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function b(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var c=this._htOption,d=this._el,e=a.getModuleCount();Math.floor(c.width/e),Math.floor(c.height/e);this.clear();var f=b("svg",{viewBox:"0 0 "+String(e)+" "+String(e),width:"100%",height:"100%",fill:c.colorLight});f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),d.appendChild(f),f.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"})),f.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(var g=0;e>g;g++)for(var h=0;e>h;h++)if(a.isDark(g,h)){var i=b("use",{x:String(h),y:String(g)});i.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),f.appendChild(i)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),r="svg"===document.documentElement.tagName.toLowerCase(),s=r?q:f()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function b(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&c._fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,void(d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var c=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,b,e,f,g,h,i,j,k){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*c;else"undefined"==typeof j&&(arguments[1]*=c,arguments[2]*=c,arguments[3]*=c,arguments[4]*=c);d.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=g(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&b.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCodep=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._htOption.useSVG&&(s=q),this._android=g(),this._el=a,this._oQRCode=null,this._htOption.text&&this.makeCode(this._htOption.text)},QRCodep.prototype.makeCode=function(a){this._oQRCode=new b(h(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,-1!=this._htOption.dpi&&-1!=this._htOption.mmPerDot&&(this._htOption.width=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot,this._htOption.height=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot),this._oDrawing=new s(this._el,this._htOption),this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCodep.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCodep.prototype.clear=function(){this._oDrawing.clear()},QRCodep.CorrectLevel=k}();var sepaQR;!function(){"use strict";var a={UTF_8:1,ISO8859_1:2,ISO8859_2:3,ISO8859_4:4,ISO8859_5:5,ISO8859_7:6,ISO8859_10:7,ISO8859_15:8};sepaQR=function(b){if(this._sOpt={serviceTag:"BCD",version:"001",charset:a.UTF_8,identificationCode:"SCT",benefBIC:"",benefName:"",benefAccNr:"",amountEuro:"",purpose:"",creditorRef:"",remittanceInf:"",information:""},b)for(var c in b)this._sOpt[c]=b[c]},sepaQR.prototype.validServiceTag=function(){return"BCD"===this._sOpt.serviceTag},sepaQR.prototype.validVersion=function(){return"001"===this._sOpt.version||"002"===this._sOpt.version},sepaQR.prototype.validCharset=function(){return this._sOpt.charset>0&&this._sOpt.charset<=8},sepaQR.prototype.validIdentificationCode=function(){return"SCT"===this._sOpt.identificationCode},sepaQR.prototype.validBenefName=function(){var a="string"==typeof this._sOpt.benefName&&this._sOpt.benefName.length>=1&&this._sOpt.benefName.length<=70;if(!a)throw new Error("benefName not valid!");return a},sepaQR.prototype.validBenefAccNr=function(){var a="string"==typeof this._sOpt.benefAccNr&&this._sOpt.benefAccNr.length>=1&&this._sOpt.benefAccNr.length<=34;if(!a)throw new Error("benefAccNr not valid!");return a},sepaQR.prototype.validAmountEuro=function(){if("string"==typeof this._sOpt.amountEuro)return 0===this._sOpt.amountEuro.length;if("number"==typeof this._sOpt.amountEuro){this._sOpt.amountEuro=Math.round(100*this._sOpt.amountEuro)/100;var a=this._sOpt.amountEuro>.01&&this._sOpt.amountEuro<=999999999.99;if(!a)throw new Error("Amount not valid!");return a}},sepaQR.prototype.validBenefBic=function(){var a="002"==this._sOpt.version||"string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11;if (!a)throw new Error("BIC is mandatory in Version 001!");if(a="string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11,!a)throw new Error("benefBIC not valid!");return a},sepaQR.prototype.validPurpose=function(){var a="string"==typeof this._sOpt.purpose&&this._sOpt.purpose.length>=0&&this._sOpt.purpose.length<=4;if(!a)throw new Error("Purpose not valid!");return a},sepaQR.prototype.validInformation=function(){var a="string"==typeof this._sOpt.information&&this._sOpt.information.length>=0&&this._sOpt.information.length<=70;if(!a)throw new Error("Information not valid!");return a},sepaQR.prototype.validCreditorRefOrRemittance=function(){var a="string"==typeof this._sOpt.creditorRef&&0===this._sOpt.creditorRef.length,b="string"==typeof this._sOpt.remittanceInf&&0===this._sOpt.remittanceInf.length,c=a&&"string"==typeof this._sOpt.remittanceInf&&this._sOpt.remittanceInf.length<=140||b&&"string "==typeof this._sOpt.creditorRef&&this._sOpt.creditorRef.length<=35;if(!c)throw new Error("creditorRef or Remittance not valid!");return c},sepaQR.prototype.validQRTextLength=function(){for(var a=this.prepareQRText(),b=0,c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b+=e>65536?4:e>2048?3:e>128?2:1}return 328>=b},sepaQR.prototype.valid=function(){var a=this.validServiceTag()&&this.validVersion()&&this.validCharset()&&this.validIdentificationCode()&&this.validBenefName()&&this.validBenefAccNr()&&this.validAmountEuro()&&this.validBenefBic()&&this.validPurpose()&&this.validInformation()&&this.validPurpose()&&this.validCreditorRefOrRemittance()&&this.validQRTextLength();return a},sepaQR.prototype.prepareQRText=function(){return(this._sOpt.serviceTag+"\n"+this._sOpt.version+"\n"+this._sOpt.charset+"\n"+this._sOpt.identificationCode+"\n"+this._sOpt.benefBIC+"\n"+this._sOpt.benefName+"\n"+this._sOpt.benefAccNr+"\nEUR"+this._sOpt.amountEuro+"\n"+this._sOpt.purpose+"\n"+this._sOpt.creditorRef+"\n"+this._sOpt.remittanceInf+"\n"+this._sOpt.information).trim()},sepaQR.prototype.toQRText=function(){return this.valid()?this.prepareQRText():""},sepaQR.prototype.makeCodeInto=function(a,b){var c={width:256,height:256,mmPerDot:.85,dpi:92,correctLevel:QRCodep.CorrectLevel.M,text:this.toQRText()};if(0!==c.text.length){if(b)for(var d in b)c[d]=b[d];return this.qrcode=new QRCodep(a,c),this.drawExplanatoryLink(document.getElementById(a).getElementsByTagName("canvas")[0],document.createElement("canvas")),this.qrcode}},sepaQR.prototype.drawExplanatoryLink=function(a,b){var c=3,d=12,e=8,f=6,g=a;b.width=g.width,b.height=g.height,b.getContext("2d").drawImage(g,0,0),g.width=b.width+2*(e+c+f),g.height=b.height+2*(e+c+f),CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e,f){return 2*e>c&&(e=c/2),2*e>d&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.lineTo(a+c-f,b+d),this.moveTo(a+c-110,b+d),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this};var h=g.getContext("2d");h.fillStyle="white",h.rect(0,0,g.width,g.height),h.fill(),h.drawImage(b,e+c+f,e+c+f),h.lineWidth=c,h.roundRect(f+c/2,f+c/2,g.width-c-2*f,g.height-c-2*f,d,3*e).stroke(),h.fillStyle="black",h.font=4.5*c+"px Arial",h.fillText("sepaQR.eu",g.width-110,g.height-f/2)},sepaQR.Charset=a}();</script> <script>var QRCodep;!function(){function a(a){this.mode=j.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=0,c=this.data.length;c>b;b++){var d=[],e=this.data.charCodeAt(b);e>65536?(d[0]=240|(1835008&e)>>>18,d[1]=128|(258048&e)>>>12,d[2]=128|(4032&e)>>>6,d[3]=128|63&e):e>2048?(d[0]=224|(61440&e)>>>12,d[1]=128|(4032&e)>>>6,d[2]=128|63&e):e>128?(d[0]=192|(1984&e)>>>6,d[1]=128|63&e):d[0]=e,this.parsedData.push(d)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function c(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function d(a,b){this.totalCount=a,this.dataCount=b}function e(){this.buffer=[],this.length=0}function f(){return"undefined"!=typeof CanvasRenderingContext2D}function g(){var a=!1,b=navigator.userAgent;if(/android/i.test(b)){a=!0;var c=b.toString().match(/android ([0-9]\.[0-9])/i);c&&c[1]&&(a=parseFloat(c[1]))}return a}function h(a,b){for(var c=1,d=i(a),e=0,f=p.length;f>=e;e++){var g=0;switch(b){case k.L:g=p[e][0];break;case k.M:g=p[e][1];break;case k.Q:g=p[e][2];break;case k.H:g=p[e][3]}if(g>=d)break;c++}if(c>p.length)throw new Error("Too long data");return c}function i(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=m.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=a%2==0);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=b%2==0)},setupPositionAdjustPattern:function(){for(var a=m.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var g=-2;2>=g;g++)-2==f||2==f||-2==g||2==g||0==f&&0==g?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){for(var b=m.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=m.getBCHTypeInfo(c),e=0;15>e;e++){var f=!a&&1==(d>>e&1);6>e?this.modules[e][8]=f:8>e?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;15>e;e++){var f=!a&&1==(d>>e&1);8>e?this.modules[8][this.moduleCount-e-1]=f:9>e?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,g=this.moduleCount-1;g>0;g-=2)for(6==g&&g--;;){for(var h=0;2>h;h++)if(null==this.modules[d][g-h]){var i=!1;f<a.length&&(i=1==(a[f]>>>e&1));var j=m.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,-1==e&&(f++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,f){for(var g=d.getRSBlocks(a,c),h=new e,i=0;i<f.length;i++){var j=f[i];h.put(j.mode,4),h.put(j.getLength(),m.getLengthInBits(j.mode,a)),j.write(h)}for(var k=0,i=0;i<g.length;i++)k+=g[i].dataCount;if(h.getLengthInBits()>8*k)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+8*k+")");for(h.getLengthInBits()+4<=8*k&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;;){if(h.getLengthInBits()>=8*k)break;if(h.put(b.PAD0,8),h.getLengthInBits()>=8*k)break;h.put(b.PAD1,8)}return b.createBytes(h,g)},b.createBytes=function(a,b){for(var d=0,e=0,f=0,g=new Array(b.length),h=new Array(b.length),i=0;i<b.length;i++){var j=b[i].dataCount,k=b[i].totalCount-j;e=Math.max(e,j),f=Math.max(f,k),g[i]=new Array(j);for(var l=0;l<g[i].length;l++)g[i][l]=255&a.buffer[l+d];d+=j;var n=m.getErrorCorrectPolynomial(k),o=new c(g[i],n.getLength()-1),p=o.mod(n);h[i]=new Array(n.getLength()-1);for(var l=0;l<h[i].length;l++){var q=l+p.getLength()-h[i].length;h[i][l]=q>=0?p.get(q):0}}for(var r=0,l=0;l<b.length;l++)r+=b [l].totalCount;for(var s=new Array(r),t=0,l=0;e>l;l++)for(var i=0;i<b.length;i++)l<g [i].length&&(s[t++]=g[i][l]);for(var l=0;f>l;l++)for(var i=0;i<b.length;i++)l<h[i].length&&(s[t++]=h[i][l]);return s};for(var j={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var b=a<<10;m.getBCHDigit(b)-m.getBCHDigit(m.G15 )>=0;)b^=m.G15<<m.getBCHDigit(b)-m.getBCHDigit(m.G15);return(a<<10|b)^m.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;m.getBCHDigit(b)-m.getBCHDigit(m.G18)>=0;)b^=m.G18<<m.getBCHDigit(b)-m.getBCHDigit(m.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return m.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case l.PATTERN000:return(b+c)%2==0;case l.PATTERN001:return b%2==0;case l.PATTERN010:return c%3==0;case l.PATTERN011:return(b+c)%3==0;case l.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case l.PATTERN101:return b*c%2+b*c%3==0;case l.PATTERN110:return(b*c%2+b*c%3)%2==0;case l.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new c([1],0),d=0;a>d;d++)b=b.multiply(new c([1,n.gexp(d)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case j.MODE_NUMBER:return 10;case j.MODE_ALPHA_NUM:return 9;case j.MODE_8BIT_BYTE:return 8;case j.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case j.MODE_NUMBER:return 12;case j.MODE_ALPHA_NUM:return 11;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case j.MODE_NUMBER:return 14;case j.MODE_ALPHA_NUM:return 13;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||0==h&&0==i||g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,0!=j&&4!=j||(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},n={glog:function(a){if(1>a)throw new Error("glog("+a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;8>o;o++)n.EXP_TABLE[o]=1<<o;for(var o=8;256>o;o++)n.EXP_TABLE[o]=n.EXP_TABLE[o-4]^n.EXP_TABLE[o-5]^n.EXP_TABLE[o-6]^n.EXP_TABLE[o-8];for(var o=0;255>o;o++)n.LOG_TABLE[n.EXP_TABLE[o]]=o;c.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var e=0;e<a.getLength();e++)b[d+e]^=n.gexp(n.glog(this.get(d))+n.glog(a.get(e)));return new c(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var b=n.glog(this.get(0))-n.glog(a.get(0)),d=new Array(this.getLength()),e=0;e<this.getLength();e++)d[e]=this.get(e);for(var e=0;e<a.getLength();e++)d[e]^=n.gexp(n.glog(a.get(e))+b);return new c(d,0).mod(a)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(a,b){var c=d.getRsBlockTable(a,b);if(void 0==c)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var e=c.length/3,f=[],g=0;e>g;g++)for(var h=c[3*g+0],i=c[3*g+1],j=c[3*g+2],k=0;h>k;k++)f.push(new d(i,j));return f},d.getRsBlockTable=function(a,b){switch(b){case k.L:return d.RS_BLOCK_TABLE[4*(a-1)+0];case k.M:return d.RS_BLOCK_TABLE[4*(a-1)+1];case k.Q:return d.RS_BLOCK_TABLE[4*(a-1)+2];case k.H:return d.RS_BLOCK_TABLE[4*(a-1)+3];default:return}},e.prototype={get:function(a){var b=Math.floor(a/8);return 1==(this.buffer[b]>>>7-a%8&1)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer [b]|=128>>>this.length%8),this.length++}};var p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],q=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function b(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var c=this._htOption,d=this._el,e=a.getModuleCount();Math.floor(c.width/e),Math.floor(c.height/e);this.clear();var f=b("svg",{viewBox:"0 0 "+String(e)+" "+String(e),width:"100%",height:"100%",fill:c.colorLight});f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),d.appendChild(f),f.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"})),f.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(var g=0;e>g;g++)for(var h=0;e>h;h++)if(a.isDark(g,h)){var i=b("use",{x:String(h),y:String(g)});i.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),f.appendChild(i)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),r="svg"===document.documentElement.tagName.toLowerCase(),s=r?q:f()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function b(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&c._fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,void(d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var c=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,b,e,f,g,h,i,j,k){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*c;else"undefined"==typeof j&&(arguments[1]*=c,arguments[2]*=c,arguments[3]*=c,arguments[4]*=c);d.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=g(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&b.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCodep=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._htOption.useSVG&&(s=q),this._android=g(),this._el=a,this._oQRCode=null,this._htOption.text&&this.makeCode(this._htOption.text)},QRCodep.prototype.makeCode=function(a){this._oQRCode=new b(h(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,-1!=this._htOption.dpi&&-1!=this._htOption.mmPerDot&&(this._htOption.width=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot,this._htOption.height=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot),this._oDrawing=new s(this._el,this._htOption),this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCodep.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCodep.prototype.clear=function(){this._oDrawing.clear()},QRCodep.CorrectLevel=k}();var sepaQR;!function(){"use strict";var a={UTF_8:1,ISO8859_1:2,ISO8859_2:3,ISO8859_4:4,ISO8859_5:5,ISO8859_7:6,ISO8859_10:7,ISO8859_15:8};sepaQR=function(b){if(this._sOpt={serviceTag:"BCD",version:"001",charset:a.UTF_8,identificationCode:"SCT",benefBIC:"",benefName:"",benefAccNr:"",amountEuro:"",purpose:"",creditorRef:"",remittanceInf:"",information:""},b)for(var c in b)this._sOpt[c]=b[c]},sepaQR.prototype.validServiceTag=function(){return"BCD"===this._sOpt.serviceTag},sepaQR.prototype.validVersion=function(){return"001"===this._sOpt.version||"002"===this._sOpt.version},sepaQR.prototype.validCharset=function(){return this._sOpt.charset>0&&this._sOpt.charset<=8},sepaQR.prototype.validIdentificationCode=function(){return"SCT"===this._sOpt.identificationCode},sepaQR.prototype.validBenefName=function(){var a="string"==typeof this._sOpt.benefName&&this._sOpt.benefName.length>=1&&this._sOpt.benefName.length<=70;if(!a)throw new Error("benefName not valid!");return a},sepaQR.prototype.validBenefAccNr=function(){var a="string"==typeof this._sOpt.benefAccNr&&this._sOpt.benefAccNr.length>=1&&this._sOpt.benefAccNr.length<=34;if(!a)throw new Error("benefAccNr not valid!");return a},sepaQR.prototype.validAmountEuro=function(){if("string"==typeof this._sOpt.amountEuro)return 0===this._sOpt.amountEuro.length;if("number"==typeof this._sOpt.amountEuro){this._sOpt.amountEuro=Math.round(100*this._sOpt.amountEuro)/100;var a=this._sOpt.amountEuro>.01&&this._sOpt.amountEuro<=999999999.99;if(!a)throw new Error("Amount not valid!");return a}},sepaQR.prototype.validBenefBic=function(){var a="002"==this._sOpt.version||"string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11;if (!a)throw new Error("BIC is mandatory in Version 001!");if(a="string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11,!a)throw new Error("benefBIC not valid!");return a},sepaQR.prototype.validPurpose=function(){var a="string"==typeof this._sOpt.purpose&&this._sOpt.purpose.length>=0&&this._sOpt.purpose.length<=4;if(!a)throw new Error("Purpose not valid!");return a},sepaQR.prototype.validInformation=function(){var a="string"==typeof this._sOpt.information&&this._sOpt.information.length>=0&&this._sOpt.information.length<=70;if(!a)throw new Error("Information not valid!");return a},sepaQR.prototype.validCreditorRefOrRemittance=function(){var a="string"==typeof this._sOpt.creditorRef&&0===this._sOpt.creditorRef.length,b="string"==typeof this._sOpt.remittanceInf&&0===this._sOpt.remittanceInf.length,c=a&&"string"==typeof this._sOpt.remittanceInf&&this._sOpt.remittanceInf.length<=140||b&&"string"==typeof this._sOpt.creditorRef&&this._sOpt.creditorRef.length<=35;if(!c)throw new Error("creditorRef or Remittance not valid!");return c},sepaQR.prototype.validQRTextLength=function(){for(var a=this.prepareQRText(),b=0,c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b+=e>65536?4:e>2048?3:e>128?2:1}return 328>=b},sepaQR.prototype.valid=function(){var a=this.validServiceTag()&&this.validVersion()&&this.validCharset()&&this.validIdentificationCode()&&this.validBenefName()&&this.validBenefAccNr()&&this.validAmountEuro()&&this.validBenefBic()&&this.validPurpose()&&this.validInformation()&&this.validPurpose()&&this.validCreditorRefOrRemittance()&&this.validQRTextLength();return a},sepaQR.prototype.prepareQRText=function(){return(this._sOpt.serviceTag+"\n"+this._sOpt.version+"\n"+this._sOpt.charset+"\n"+this._sOpt.identificationCode+"\n"+this._sOpt.benefBIC+"\n"+this._sOpt.benefName+"\n"+this._sOpt.benefAccNr+"\nEUR"+this._sOpt.amountEuro+"\n"+this._sOpt.purpose+"\n"+this._sOpt.creditorRef+"\n"+this._sOpt.remittanceInf+"\n"+this._sOpt.information).trim()},sepaQR.prototype.toQRText=function(){return this.valid()?this.prepareQRText():""},sepaQR.prototype.makeCodeInto=function(a,b){var c={width:256,height:256,mmPerDot:.85,dpi:92,correctLevel:QRCodep.CorrectLevel.M,text:this.toQRText()};if(0!==c.text.length){if(b)for(var d in b)c[d]=b[d];return this.qrcode=new QRCodep(a,c),this.drawExplanatoryLink(document.getElementById(a).getElementsByTagName("canvas")[0],document.createElement("canvas")),this.qrcode}},sepaQR.prototype.drawExplanatoryLink=function(a,b){var c=3,d=12,e=8,f=6,g=a;b.width=g.width,b.height=g.height,b.getContext("2d").drawImage(g,0,0),g.width=b.width+2*(e+c+f),g.height=b.height+2*(e+c+f),CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e,f){return 2*e>c&&(e=c/2),2*e>d&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.lineTo(a+c-f,b+d),this.moveTo(a+c-110,b+d),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this};var h=g.getContext("2d");h.fillStyle="white",h.rect(0,0,g.width,g.height),h.fill(),h.drawImage(b,e+c+f,e+c+f),h.lineWidth=c,h.roundRect(f+c/2,f+c/2,g.width-c-2*f,g.height-c-2*f,d,3*e).stroke(),h.fillStyle="black",h.font=4.5*c+"px Arial",h.fillText("sepaQR.eu",g.width-110,g.height-f/2)},sepaQR.Charset=a}();</script>
<script>var QRCodep;!function(){function a(a){this.mode=j.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=0,c=this.data.length;c>b;b++){var d=[],e=this.data.charCodeAt(b);e>65536?(d[0]=240|(1835008&e)>>>18,d[1]=128|(258048&e)>>>12,d[2]=128|(4032&e)>>>6,d[3]=128|63&e):e>2048?(d[0]=224|(61440&e)>>>12,d[1]=128|(4032&e)>>>6,d[2]=128|63&e):e>128?(d[0]=192|(1984&e)>>>6,d[1]=128|63&e):d[0]=e,this.parsedData.push(d)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function c(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function d(a,b){this.totalCount=a,this.dataCount=b}function e(){this.buffer=[],this.length=0}function f(){return"undefined"!=typeof CanvasRenderingContext2D}function g(){var a=!1,b=navigator.userAgent;if(/android/i.test(b)){a=!0;var c=b.toString().match(/android ([0-9]\.[0-9])/i);c&&c[1]&&(a=parseFloat(c[1]))}return a}function h(a,b){for(var c=1,d=i(a),e=0,f=p.length;f>=e;e++){var g=0;switch(b){case k.L:g=p[e][0];break;case k.M:g=p[e][1];break;case k.Q:g=p[e][2];break;case k.H:g=p[e][3]}if(g>=d)break;c++}if(c>p.length)throw new Error("Too long data");return c}function i(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=m.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=a%2==0);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=b%2==0)},setupPositionAdjustPattern:function(){for(var a=m.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var g=-2;2>=g;g++)-2==f||2==f||-2==g||2==g||0==f&&0==g?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){for(var b=m.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=m.getBCHTypeInfo(c),e=0;15>e;e++){var f=!a&&1==(d>>e&1);6>e?this.modules[e][8]=f:8>e?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;15>e;e++){var f=!a&&1==(d>>e&1);8>e?this.modules[8][this.moduleCount-e-1]=f:9>e?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,g=this.moduleCount-1;g>0;g-=2)for(6==g&&g--;;){for(var h=0;2>h;h++)if(null==this.modules[d][g-h]){var i=!1;f<a.length&&(i=1==(a[f]>>>e&1));var j=m.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,-1==e&&(f++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,f){for(var g=d.getRSBlocks(a,c),h=new e,i=0;i<f.length;i++){var j=f[i];h.put(j.mode,4),h.put(j.getLength(),m.getLengthInBits(j.mode,a)),j.write(h)}for(var k=0,i=0;i<g.length;i++)k+=g[i].dataCount;if(h.getLengthInBits()>8*k)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+8*k+")");for(h.getLengthInBits()+4<=8*k&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;;){if(h.getLengthInBits()>=8*k)break;if(h.put(b.PAD0,8),h.getLengthInBits()>=8*k)break;h.put(b.PAD1,8)}return b.createBytes(h,g)},b.createBytes=function(a,b){for(var d=0,e=0,f=0,g=new Array(b.length),h=new Array(b.length),i=0;i<b.length;i++){var j=b[i].dataCount,k=b[i].totalCount-j;e=Math.max(e,j),f=Math.max(f,k),g[i]=new Array(j);for(var l=0;l<g[i].length;l++)g[i][l]=255&a.buffer[l+d];d+=j;var n=m.getErrorCorrectPolynomial(k),o=new c(g[i],n.getLength()-1),p=o.mod(n);h[i]=new Array(n.getLength()-1);for(var l=0;l<h[i].length;l++){var q=l+p.getLength()-h[i].length;h[i][l]=q>=0?p.get(q):0}}for(var r=0,l=0;l<b.length;l++)r+=b[l].totalCount;for(var s=new Array(r),t=0,l=0;e>l;l++)for(var i=0;i<b.length;i++)l<g[i].length&&(s[t++]=g[i][l]);for(var l=0;f>l;l++)for(var i=0;i<b.length;i++)l<h[i].length&&(s[t++]=h[i][l]);return s};for(var j={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var b=a<<10;m.getBCHDigit(b)-m.getBCHDigit(m.G15)>=0;)b^=m.G15<<m.getBCHDigit(b)-m.getBCHDigit(m.G15);return(a<<10|b)^m.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;m.getBCHDigit(b)-m.getBCHDigit(m.G18)>=0;)b^=m.G18<<m.getBCHDigit(b)-m.getBCHDigit(m.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return m.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case l.PATTERN000:return(b+c)%2==0;case l.PATTERN001:return b%2==0;case l.PATTERN010:return c%3==0;case l.PATTERN011:return(b+c)%3==0;case l.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case l.PATTERN101:return b*c%2+b*c%3==0;case l.PATTERN110:return(b*c%2+b*c%3)%2==0;case l.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new c([1],0),d=0;a>d;d++)b=b.multiply(new c([1,n.gexp(d)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case j.MODE_NUMBER:return 10;case j.MODE_ALPHA_NUM:return 9;case j.MODE_8BIT_BYTE:return 8;case j.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case j.MODE_NUMBER:return 12;case j.MODE_ALPHA_NUM:return 11;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case j.MODE_NUMBER:return 14;case j.MODE_ALPHA_NUM:return 13;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||0==h&&0==i||g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,0!=j&&4!=j||(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},n={glog:function(a){if(1>a)throw new Error("glog("+a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;8>o;o++)n.EXP_TABLE[o]=1<<o;for(var o=8;256>o;o++)n.EXP_TABLE[o]=n.EXP_TABLE[o-4]^n.EXP_TABLE[o-5]^n.EXP_TABLE[o-6]^n.EXP_TABLE[o-8];for(var o=0;255>o;o++)n.LOG_TABLE[n.EXP_TABLE[o]]=o;c.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var e=0;e<a.getLength();e++)b[d+e]^=n.gexp(n.glog(this.get(d))+n.glog(a.get(e)));return new c(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var b=n.glog(this.get(0))-n.glog(a.get(0)),d=new Array(this.getLength()),e=0;e<this.getLength();e++)d[e]=this.get(e);for(var e=0;e<a.getLength();e++)d[e]^=n.gexp(n.glog(a.get(e))+b);return new c(d,0).mod(a)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(a,b){var c=d.getRsBlockTable(a,b);if(void 0==c)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var e=c.length/3,f=[],g=0;e>g;g++)for(var h=c[3*g+0],i=c[3*g+1],j=c[3*g+2],k=0;h>k;k++)f.push(new d(i,j));return f},d.getRsBlockTable=function(a,b){switch(b){case k.L:return d.RS_BLOCK_TABLE[4*(a-1)+0];case k.M:return d.RS_BLOCK_TABLE[4*(a-1)+1];case k.Q:return d.RS_BLOCK_TABLE[4*(a-1)+2];case k.H:return d.RS_BLOCK_TABLE[4*(a-1)+3];default:return}},e.prototype={get:function(a){var b=Math.floor(a/8);return 1==(this.buffer[b]>>>7-a%8&1)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],q=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function b(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var c=this._htOption,d=this._el,e=a.getModuleCount();Math.floor(c.width/e),Math.floor(c.height/e);this.clear();var f=b("svg",{viewBox:"0 0 "+String(e)+" "+String(e),width:"100%",height:"100%",fill:c.colorLight});f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),d.appendChild(f),f.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"})),f.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(var g=0;e>g;g++)for(var h=0;e>h;h++)if(a.isDark(g,h)){var i=b("use",{x:String(h),y:String(g)});i.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),f.appendChild(i)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),r="svg"===document.documentElement.tagName.toLowerCase(),s=r?q:f()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function b(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&c._fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,void(d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var c=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,b,e,f,g,h,i,j,k){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*c;else"undefined"==typeof j&&(arguments[1]*=c,arguments[2]*=c,arguments[3]*=c,arguments[4]*=c);d.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=g(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&b.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCodep=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._htOption.useSVG&&(s=q),this._android=g(),this._el=a,this._oQRCode=null,this._htOption.text&&this.makeCode(this._htOption.text)},QRCodep.prototype.makeCode=function(a){this._oQRCode=new b(h(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,-1!=this._htOption.dpi&&-1!=this._htOption.mmPerDot&&(this._htOption.width=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot,this._htOption.height=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot),this._oDrawing=new s(this._el,this._htOption),this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCodep.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCodep.prototype.clear=function(){this._oDrawing.clear()},QRCodep.CorrectLevel=k}();var sepaQR;!function(){"use strict";var a={UTF_8:1,ISO8859_1:2,ISO8859_2:3,ISO8859_4:4,ISO8859_5:5,ISO8859_7:6,ISO8859_10:7,ISO8859_15:8};sepaQR=function(b){if(this._sOpt={serviceTag:"BCD",version:"001",charset:a.UTF_8,identificationCode:"SCT",benefBIC:"",benefName:"",benefAccNr:"",amountEuro:"",purpose:"",creditorRef:"",remittanceInf:"",information:""},b)for(var c in b)this._sOpt[c]=b[c]},sepaQR.prototype.validServiceTag=function(){return"BCD"===this._sOpt.serviceTag},sepaQR.prototype.validVersion=function(){return"001"===this._sOpt.version||"002"===this._sOpt.version},sepaQR.prototype.validCharset=function(){return this._sOpt.charset>0&&this._sOpt.charset<=8},sepaQR.prototype.validIdentificationCode=function(){return"SCT"===this._sOpt.identificationCode},sepaQR.prototype.validBenefName=function(){var a="string"==typeof this._sOpt.benefName&&this._sOpt.benefName.length>=1&&this._sOpt.benefName.length<=70;if(!a)throw new Error("benefName not valid!");return a},sepaQR.prototype.validBenefAccNr=function(){var a="string"==typeof this._sOpt.benefAccNr&&this._sOpt.benefAccNr.length>=1&&this._sOpt.benefAccNr.length<=34;if(!a)throw new Error("benefAccNr not valid!");return a},sepaQR.prototype.validAmountEuro=function(){if("string"==typeof this._sOpt.amountEuro)return 0===this._sOpt.amountEuro.length;if("number"==typeof this._sOpt.amountEuro){this._sOpt.amountEuro=Math.round(100*this._sOpt.amountEuro)/100;var a=this._sOpt.amountEuro>.01&&this._sOpt.amountEuro<=999999999.99;if(!a)throw new Error("Amount not valid!");return a}},sepaQR.prototype.validBenefBic=function(){var a="002"==this._sOpt.version||"string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11;if(!a)throw new Error("BIC is mandatory in Version 001!");if(a="string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11,!a)throw new Error("benefBIC not valid!");return a},sepaQR.prototype.validPurpose=function(){var a="string"==typeof this._sOpt.purpose&&this._sOpt.purpose.length>=0&&this._sOpt.purpose.length<=4;if(!a)throw new Error("Purpose not valid!");return a},sepaQR.prototype.validInformation=function(){var a="string"==typeof this._sOpt.information&&this._sOpt.information.length>=0&&this._sOpt.information.length<=70;if(!a)throw new Error("Information not valid!");return a},sepaQR.prototype.validCreditorRefOrRemittance=function(){var a="string"==typeof this._sOpt.creditorRef&&0===this._sOpt.creditorRef.length,b="string"==typeof this._sOpt.remittanceInf&&0===this._sOpt.remittanceInf.length,c=a&&"string"==typeof this._sOpt.remittanceInf&&this._sOpt.remittanceInf.length<=140||b&&"string"==typeof this._sOpt.creditorRef&&this._sOpt.creditorRef.length<=35;if(!c)throw new Error("creditorRef or Remittance not valid!");return c},sepaQR.prototype.validQRTextLength=function(){for(var a=this.prepareQRText(),b=0,c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b+=e>65536?4:e>2048?3:e>128?2:1}return 328>=b},sepaQR.prototype.valid=function(){var a=this.validServiceTag()&&this.validVersion()&&this.validCharset()&&this.validIdentificationCode()&&this.validBenefName()&&this.validBenefAccNr()&&this.validAmountEuro()&&this.validBenefBic()&&this.validPurpose()&&this.validInformation()&&this.validPurpose()&&this.validCreditorRefOrRemittance()&&this.validQRTextLength();return a},sepaQR.prototype.prepareQRText=function(){return(this._sOpt.serviceTag+"\n"+this._sOpt.version+"\n"+this._sOpt.charset+"\n"+this._sOpt.identificationCode+"\n"+this._sOpt.benefBIC+"\n"+this._sOpt.benefName+"\n"+this._sOpt.benefAccNr+"\nEUR"+this._sOpt.amountEuro+"\n"+this._sOpt.purpose+"\n"+this._sOpt.creditorRef+"\n"+this._sOpt.remittanceInf+"\n"+this._sOpt.information).trim()},sepaQR.prototype.toQRText=function(){return this.valid()?this.prepareQRText():""},sepaQR.prototype.makeCodeInto=function(a,b){var c={width:256,height:256,mmPerDot:.85,dpi:92,correctLevel:QRCodep.CorrectLevel.M,text:this.toQRText()};if(0!==c.text.length){if(b)for(var d in b)c[d]=b[d];return this.qrcode=new QRCodep(a,c),this.drawExplanatoryLink(document.getElementById(a).getElementsByTagName("canvas")[0],document.createElement("canvas")),this.qrcode}},sepaQR.prototype.drawExplanatoryLink=function(a,b){var c=3,d=12,e=8,f=6,g=a;b.width=g.width,b.height=g.height,b.getContext("2d").drawImage(g,0,0),g.width=b.width+2*(e+c+f),g.height=b.height+2*(e+c+f),CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e,f){return 2*e>c&&(e=c/2),2*e>d&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.lineTo(a+c-f,b+d),this.moveTo(a+c-110,b+d),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this};var h=g.getContext("2d");h.fillStyle="white",h.rect(0,0,g.width,g.height),h.fill(),h.drawImage(b,e+c+f,e+c+f),h.lineWidth=c,h.roundRect(f+c/2,f+c/2,g.width-c-2*f,g.height-c-2*f,d,3*e).stroke(),h.fillStyle="black",h.font=4.5*c+"px Arial",h.fillText("sepaQR.eu",g.width-110,g.height-f/2)},sepaQR.Charset=a}();</script>
<script>var QRCodep;!function(){function a(a){this.mode=j.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=0,c=this.data.length;c>b;b++){var d=[],e=this.data.charCodeAt(b);e>65536?(d[0]=240|(1835008&e)>>>18,d[1]=128|(258048&e)>>>12,d[2]=128|(4032&e)>>>6,d[3]=128|63&e):e>2048?(d[0]=224|(61440&e)>>>12,d[1]=128|(4032&e)>>>6,d[2]=128|63&e):e>128?(d[0]=192|(1984&e)>>>6,d[1]=128|63&e):d[0]=e,this.parsedData.push(d)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function c(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=new Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}function d(a,b){this.totalCount=a,this.dataCount=b}function e(){this.buffer=[],this.length=0}function f(){return"undefined"!=typeof CanvasRenderingContext2D}function g(){var a=!1,b=navigator.userAgent;if(/android/i.test(b)){a=!0;var c=b.toString().match(/android ([0-9]\.[0-9])/i);c&&c[1]&&(a=parseFloat(c[1]))}return a}function h(a,b){for(var c=1,d=i(a),e=0,f=p.length;f>=e;e++){var g=0;switch(b){case k.L:g=p[e][0];break;case k.M:g=p[e][1];break;case k.Q:g=p[e][2];break;case k.H:g=p[e][3]}if(g>=d)break;c++}if(c>p.length)throw new Error("Too long data");return c}function i(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(a){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=new Array(this.moduleCount);for(var e=0;e<this.moduleCount;e++)this.modules[d][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,c),this.typeNumber>=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?this.modules[a+c][b+d]=!0:this.modules[a+c][b+d]=!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=m.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f<this.modules.length;f++)for(var g=f*e,h=0;h<this.modules[f].length;h++){var i=h*e,j=this.modules[f][h];j&&(d.beginFill(0,100),d.moveTo(i,g),d.lineTo(i+e,g),d.lineTo(i+e,g+e),d.lineTo(i,g+e),d.endFill())}return d},setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=a%2==0);for(var b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=b%2==0)},setupPositionAdjustPattern:function(){for(var a=m.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var g=-2;2>=g;g++)-2==f||2==f||-2==g||2==g||0==f&&0==g?this.modules[d+f][e+g]=!0:this.modules[d+f][e+g]=!1}},setupTypeNumber:function(a){for(var b=m.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=m.getBCHTypeInfo(c),e=0;15>e;e++){var f=!a&&1==(d>>e&1);6>e?this.modules[e][8]=f:8>e?this.modules[e+1][8]=f:this.modules[this.moduleCount-15+e][8]=f}for(var e=0;15>e;e++){var f=!a&&1==(d>>e&1);8>e?this.modules[8][this.moduleCount-e-1]=f:9>e?this.modules[8][15-e-1+1]=f:this.modules[8][15-e-1]=f}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,g=this.moduleCount-1;g>0;g-=2)for(6==g&&g--;;){for(var h=0;2>h;h++)if(null==this.modules[d][g-h]){var i=!1;f<a.length&&(i=1==(a[f]>>>e&1));var j=m.getMask(b,d,g-h);j&&(i=!i),this.modules[d][g-h]=i,e--,-1==e&&(f++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,f){for(var g=d.getRSBlocks(a,c),h=new e,i=0;i<f.length;i++){var j=f[i];h.put(j.mode,4),h.put(j.getLength(),m.getLengthInBits(j.mode,a)),j.write(h)}for(var k=0,i=0;i<g.length;i++)k+=g[i].dataCount;if(h.getLengthInBits()>8*k)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+8*k+")");for(h.getLengthInBits()+4<=8*k&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;;){if(h.getLengthInBits()>=8*k)break;if(h.put(b.PAD0,8),h.getLengthInBits()>=8*k)break;h.put(b.PAD1,8)}return b.createBytes(h,g)},b.createBytes=function(a,b){for(var d=0,e=0,f=0,g=new Array(b.length),h=new Array(b.length),i=0;i<b.length;i++){var j=b[i].dataCount,k=b[i].totalCount-j;e=Math.max(e,j),f=Math.max(f,k),g[i]=new Array(j);for(var l=0;l<g[i].length;l++)g[i][l]=255&a.buffer[l+d];d+=j;var n=m.getErrorCorrectPolynomial(k),o=new c(g[i],n.getLength()-1),p=o.mod(n);h[i]=new Array(n.getLength()-1);for(var l=0;l<h[i].length;l++){var q=l+p.getLength()-h[i].length;h[i][l]=q>=0?p.get(q):0}}for(var r=0,l=0;l<b.length;l++)r+=b[l].totalCount;for(var s=new Array(r),t=0,l=0;e>l;l++)for(var i=0;i<b.length;i++)l<g[i].length&&(s[t++]=g[i][l]);for(var l=0;f>l;l++)for(var i=0;i<b.length;i++)l<h[i].length&&(s[t++]=h[i][l]);return s};for(var j={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},l={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var b=a<<10;m.getBCHDigit(b)-m.getBCHDigit(m.G15)>=0;)b^=m.G15<<m.getBCHDigit(b)-m.getBCHDigit(m.G15);return(a<<10|b)^m.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;m.getBCHDigit(b)-m.getBCHDigit(m.G18)>=0;)b^=m.G18<<m.getBCHDigit(b)-m.getBCHDigit(m.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return m.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case l.PATTERN000:return(b+c)%2==0;case l.PATTERN001:return b%2==0;case l.PATTERN010:return c%3==0;case l.PATTERN011:return(b+c)%3==0;case l.PATTERN100:return(Math.floor(b/2)+Math.floor(c/3))%2==0;case l.PATTERN101:return b*c%2+b*c%3==0;case l.PATTERN110:return(b*c%2+b*c%3)%2==0;case l.PATTERN111:return(b*c%3+(b+c)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new c([1],0),d=0;a>d;d++)b=b.multiply(new c([1,n.gexp(d)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case j.MODE_NUMBER:return 10;case j.MODE_ALPHA_NUM:return 9;case j.MODE_8BIT_BYTE:return 8;case j.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case j.MODE_NUMBER:return 12;case j.MODE_ALPHA_NUM:return 11;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case j.MODE_NUMBER:return 14;case j.MODE_ALPHA_NUM:return 13;case j.MODE_8BIT_BYTE:return 16;case j.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||0==h&&0==i||g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,0!=j&&4!=j||(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},n={glog:function(a){if(1>a)throw new Error("glog("+a+")");return n.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return n.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;8>o;o++)n.EXP_TABLE[o]=1<<o;for(var o=8;256>o;o++)n.EXP_TABLE[o]=n.EXP_TABLE[o-4]^n.EXP_TABLE[o-5]^n.EXP_TABLE[o-6]^n.EXP_TABLE[o-8];for(var o=0;255>o;o++)n.LOG_TABLE[n.EXP_TABLE[o]]=o;c.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var e=0;e<a.getLength();e++)b[d+e]^=n.gexp(n.glog(this.get(d))+n.glog(a.get(e)));return new c(b,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var b=n.glog(this.get(0))-n.glog(a.get(0)),d=new Array(this.getLength()),e=0;e<this.getLength();e++)d[e]=this.get(e);for(var e=0;e<a.getLength();e++)d[e]^=n.gexp(n.glog(a.get(e))+b);return new c(d,0).mod(a)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(a,b){var c=d.getRsBlockTable(a,b);if(void 0==c)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var e=c.length/3,f=[],g=0;e>g;g++)for(var h=c[3*g+0],i=c[3*g+1],j=c[3*g+2],k=0;h>k;k++)f.push(new d(i,j));return f},d.getRsBlockTable=function(a,b){switch(b){case k.L:return d.RS_BLOCK_TABLE[4*(a-1)+0];case k.M:return d.RS_BLOCK_TABLE[4*(a-1)+1];case k.Q:return d.RS_BLOCK_TABLE[4*(a-1)+2];case k.H:return d.RS_BLOCK_TABLE[4*(a-1)+3];default:return}},e.prototype={get:function(a){var b=Math.floor(a/8);return 1==(this.buffer[b]>>>7-a%8&1)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],q=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function b(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var c=this._htOption,d=this._el,e=a.getModuleCount();Math.floor(c.width/e),Math.floor(c.height/e);this.clear();var f=b("svg",{viewBox:"0 0 "+String(e)+" "+String(e),width:"100%",height:"100%",fill:c.colorLight});f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),d.appendChild(f),f.appendChild(b("rect",{fill:c.colorLight,width:"100%",height:"100%"})),f.appendChild(b("rect",{fill:c.colorDark,width:"1",height:"1",id:"template"}));for(var g=0;e>g;g++)for(var h=0;e>h;h++)if(a.isDark(g,h)){var i=b("use",{x:String(h),y:String(g)});i.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),f.appendChild(i)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),r="svg"===document.documentElement.tagName.toLowerCase(),s=r?q:f()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function b(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&c._fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,void(d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var c=1/window.devicePixelRatio,d=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,b,e,f,g,h,i,j,k){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*c;else"undefined"==typeof j&&(arguments[1]*=c,arguments[2]*=c,arguments[3]*=c,arguments[4]*=c);d.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=g(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&b.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCodep=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._htOption.useSVG&&(s=q),this._android=g(),this._el=a,this._oQRCode=null,this._htOption.text&&this.makeCode(this._htOption.text)},QRCodep.prototype.makeCode=function(a){this._oQRCode=new b(h(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,-1!=this._htOption.dpi&&-1!=this._htOption.mmPerDot&&(this._htOption.width=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot,this._htOption.height=this._oQRCode.moduleCount*this._htOption.dpi/25.4*this._htOption.mmPerDot),this._oDrawing=new s(this._el,this._htOption),this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCodep.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCodep.prototype.clear=function(){this._oDrawing.clear()},QRCodep.CorrectLevel=k}();var sepaQR;!function(){"use strict";var a={UTF_8:1,ISO8859_1:2,ISO8859_2:3,ISO8859_4:4,ISO8859_5:5,ISO8859_7:6,ISO8859_10:7,ISO8859_15:8};sepaQR=function(b){if(this._sOpt={serviceTag:"BCD",version:"001",charset:a.UTF_8,identificationCode:"SCT",benefBIC:"",benefName:"",benefAccNr:"",amountEuro:"",purpose:"",creditorRef:"",remittanceInf:"",information:""},b)for(var c in b)this._sOpt[c]=b[c]},sepaQR.prototype.validServiceTag=function(){return"BCD"===this._sOpt.serviceTag},sepaQR.prototype.validVersion=function(){return"001"===this._sOpt.version||"002"===this._sOpt.version},sepaQR.prototype.validCharset=function(){return this._sOpt.charset>0&&this._sOpt.charset<=8},sepaQR.prototype.validIdentificationCode=function(){return"SCT"===this._sOpt.identificationCode},sepaQR.prototype.validBenefName=function(){var a="string"==typeof this._sOpt.benefName&&this._sOpt.benefName.length>=1&&this._sOpt.benefName.length<=70;if(!a)throw new Error("benefName not valid!");return a},sepaQR.prototype.validBenefAccNr=function(){var a="string"==typeof this._sOpt.benefAccNr&&this._sOpt.benefAccNr.length>=1&&this._sOpt.benefAccNr.length<=34;if(!a)throw new Error("benefAccNr not valid!");return a},sepaQR.prototype.validAmountEuro=function(){if("string"==typeof this._sOpt.amountEuro)return 0===this._sOpt.amountEuro.length;if("number"==typeof this._sOpt.amountEuro){this._sOpt.amountEuro=Math.round(100*this._sOpt.amountEuro)/100;var a=this._sOpt.amountEuro>.01&&this._sOpt.amountEuro<=999999999.99;if(!a)throw new Error("Amount not valid!");return a}},sepaQR.prototype.validBenefBic=function(){var a="002"==this._sOpt.version||"string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11;if(!a)throw new Error("BIC is mandatory in Version 001!");if(a="string"==typeof this._sOpt.benefBIC&&this._sOpt.benefBIC.length>=0&&this._sOpt.benefBIC.length<=11,!a)throw new Error("benefBIC not valid!");return a},sepaQR.prototype.validPurpose=function(){var a="string"==typeof this._sOpt.purpose&&this._sOpt.purpose.length>=0&&this._sOpt.purpose.length<=4;if(!a)throw new Error("Purpose not valid!");return a},sepaQR.prototype.validInformation=function(){var a="string"==typeof this._sOpt.information&&this._sOpt.information.length>=0&&this._sOpt.information.length<=70;if(!a)throw new Error("Information not valid!");return a},sepaQR.prototype.validCreditorRefOrRemittance=function(){var a="string"==typeof this._sOpt.creditorRef&&0===this._sOpt.creditorRef.length,b="string"==typeof this._sOpt.remittanceInf&&0===this._sOpt.remittanceInf.length,c=a&&"string"==typeof this._sOpt.remittanceInf&&this._sOpt.remittanceInf.length<=140||b&&"string"==typeof this._sOpt.creditorRef&&this._sOpt.creditorRef.length<=35;if(!c)throw new Error("creditorRef or Remittance not valid!");return c},sepaQR.prototype.validQRTextLength=function(){for(var a=this.prepareQRText(),b=0,c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b+=e>65536?4:e>2048?3:e>128?2:1}return 328>=b},sepaQR.prototype.valid=function(){var a=this.validServiceTag()&&this.validVersion()&&this.validCharset()&&this.validIdentificationCode()&&this.validBenefName()&&this.validBenefAccNr()&&this.validAmountEuro()&&this.validBenefBic()&&this.validPurpose()&&this.validInformation()&&this.validPurpose()&&this.validCreditorRefOrRemittance()&&this.validQRTextLength();return a},sepaQR.prototype.prepareQRText=function(){return(this._sOpt.serviceTag+"\n"+this._sOpt.version+"\n"+this._sOpt.charset+"\n"+this._sOpt.identificationCode+"\n"+this._sOpt.benefBIC+"\n"+this._sOpt.benefName+"\n"+this._sOpt.benefAccNr+"\nEUR"+this._sOpt.amountEuro+"\n"+this._sOpt.purpose+"\n"+this._sOpt.creditorRef+"\n"+this._sOpt.remittanceInf+"\n"+this._sOpt.information).trim()},sepaQR.prototype.toQRText=function(){return this.valid()?this.prepareQRText():""},sepaQR.prototype.makeCodeInto=function(a,b){var c={width:256,height:256,mmPerDot:.85,dpi:92,correctLevel:QRCodep.CorrectLevel.M,text:this.toQRText()};if(0!==c.text.length){if(b)for(var d in b)c[d]=b[d];return this.qrcode=new QRCodep(a,c),this.drawExplanatoryLink(document.getElementById(a).getElementsByTagName("canvas")[0],document.createElement("canvas")),this.qrcode}},sepaQR.prototype.drawExplanatoryLink=function(a,b){var c=3,d=12,e=8,f=6,g=a;b.width=g.width,b.height=g.height,b.getContext("2d").drawImage(g,0,0),g.width=b.width+2*(e+c+f),g.height=b.height+2*(e+c+f),CanvasRenderingContext2D.prototype.roundRect=function(a,b,c,d,e,f){return 2*e>c&&(e=c/2),2*e>d&&(e=d/2),this.beginPath(),this.moveTo(a+e,b),this.arcTo(a+c,b,a+c,b+d,e),this.arcTo(a+c,b+d,a,b+d,e),this.lineTo(a+c-f,b+d),this.moveTo(a+c-110,b+d),this.arcTo(a,b+d,a,b,e),this.arcTo(a,b,a+c,b,e),this};var h=g.getContext("2d");h.fillStyle="white",h.rect(0,0,g.width,g.height),h.fill(),h.drawImage(b,e+c+f,e+c+f),h.lineWidth=c,h.roundRect(f+c/2,f+c/2,g.width-c-2*f,g.height-c-2*f,d,3*e).stroke(),h.fillStyle="black",h.font=4.5*c+"px Arial",h.fillText("sepaQR.eu",g.width-110,g.height-f/2)},sepaQR.Charset=a}();</script>

View File

@ -1,3 +1,7 @@
<svg class="flex-shrink-0 w-4 h-4 inline-block" fill="currentColor" viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <svg class="flex-shrink-0 w-4 h-4 inline-block"
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path> fill="currentColor"
viewbox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd">
</path>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 396 B

View File

@ -1,103 +1,148 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
{% if flash %} <h1 class="h1">Ruderassistent</h1>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <div class="grid gap-3">
{% endif %} <div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
<h1 class="h1">Ruderassistent</h1> role="alert">
<h2 class="h2">Allgemein</h2>
<div class="text-sm p-3">
<div class="grid gap-3"> <ul class="list-disc ms-2">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert"> <li class="py-1">
<h2 class="h2">Allgemein</h2> <a href="https://wiki.rudernlinz.at/ruderassistent#faq"
<div class="text-sm p-3"> target="_blank"
<ul class="list-disc ms-2"> class="link-primary">FAQ (extern)</a>
<li class="py-1"><a href="https://rudernlinz.at/termin" target="_blank" class="link-primary">FAQ (extern)</a></li> </li>
</ul> </ul>
</div>
</div>
</div> </div>
</div> {% if loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Ergo</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1">
<a href="/ergo" class="link-primary">Ergo</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "Donau Linz" in loggedin_user.roles and "Unterstützend" not in loggedin_user.roles and "Förderndes Mitglied" not in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Aktives Vereinsmitglied</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1">
<a href="/planned" class="link-primary">Geplante Ausfahrten</a>
</li>
<li class="py-1">
<a href="/log" class="link-primary">Ausfahrt eintragen</a>
</li>
<li class="py-1">
<a href="/log/show" class="link-primary">Logbuch</a>
</li>
<li class="py-1">
<a href="/stat" class="link-primary">Statistik</a>
</li>
<li class="py-1">
<a href="/stat/boats" class="link-primary">Bootsauswertung</a>
</li>
<li class="py-1">
<a href="/boatdamage" class="link-primary">Bootsschaden</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "scheckbuch" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Scheckbuch</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1">
<a href="/planned" class="link-primary">Geplante Ausfahrten</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "schnupper-betreuer" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Schnupper-Betreuer</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1">
<a href="/admin/schnupper" class="link-primary">Schnuppern</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "Vorstand" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Vorstand</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1">
<a href="/admin/user/fees" class="link-primary">Übersicht User Gebühren</a>
</li>
<li class="py-1">
<a href="/admin/user/scheckbuch" class="link-primary">Scheckbuch</a>
</li>
<li class="py-1">
<a href="/admin/user" class="link-primary">User</a>
</li>
<li class="py-1">
<a href="/board/boathouse" class="link-primary">Bootshaus</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "admin" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Admin</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1">
<a href="/admin/boat" class="link-primary">Boote</a>
</li>
<li class="py-1">
<a href="/admin/user" class="link-primary">User</a>
</li>
<li class="py-1">
<a href="/admin/mail" class="link-primary">Mail (beautifully layouted)</a>
</li>
<li class="py-1">
<a href="/admin/rss" class="link-primary">Logs</a>
</li>
<li class="py-1">
<a href="/admin/list" class="link-primary">Fingerabdruck-Liste überprüfen</a>
</li>
</ul>
</div>
</div>
</div>
{% endif %}
</div> </div>
{% endblock content %}
{% if loggedin_user.weight and loggedin_user.sex and loggedin_user.dob %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert">
<h2 class="h2">Ergo</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1"><a href="/ergo" class="link-primary">Ergo</a></li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "Donau Linz" in loggedin_user.roles and "Unterstützend" not in loggedin_user.roles and "Förderndes Mitglied" not in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert">
<h2 class="h2">Aktives Vereinsmitglied</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1"><a href="/planned" class="link-primary">Geplante Ausfahrten</a></li>
<li class="py-1"><a href="/log" class="link-primary">Ausfahrt eintragen</a></li>
<li class="py-1"><a href="/log/show" class="link-primary">Logbuch</a></li>
<li class="py-1"><a href="/stat" class="link-primary">Statistik</a></li>
<li class="py-1"><a href="/stat/boats" class="link-primary">Bootsauswertung</a></li>
<li class="py-1"><a href="/boatdamage" class="link-primary">Bootsschaden</a></li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "scheckbuch" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert">
<h2 class="h2">Scheckbuch</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1"><a href="/planned" class="link-primary">Geplante Ausfahrten</a></li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "Vorstand" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert">
<h2 class="h2">Vorstand</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1"><a href="/admin/user/fees" class="link-primary">Übersicht User Gebühren</a></li>
<li class="py-1"><a href="/admin/user" class="link-primary">User</a></li>
</ul>
</div>
</div>
</div>
{% endif %}
{% if "admin" in loggedin_user.roles %}
<div class="grid gap-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert">
<h2 class="h2">Admin</h2>
<div class="text-sm p-3">
<ul class="list-disc ms-2">
<li class="py-1"><a href="/admin/boat" class="link-primary">Boote</a></li>
<li class="py-1"><a href="/admin/user" class="link-primary">User</a></li>
<li class="py-1"><a href="/admin/mail" class="link-primary">Mail (beautifully layouted)</a></li>
<li class="py-1"><a href="/admin/rss" class="link-primary">Logs</a></li>
</ul>
</div>
</div>
</div>
{% endif %}
</div>
{% endblock content%}

View File

@ -1,48 +1,36 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %} {% import "includes/forms/log" as log %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="w-full">
<div class="w-full"> <h1 class="h1">Logbuch</h1>
<h1 class="h1">Logbuch</h1> {% if flash and not loggedin_user %}
<div class="pt-3 max-w-lg m-auto">
{% if flash %} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
<div class="pt-3 max-w-lg m-auto"> </div>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
</div>
{% endif %}
<div class="w-full grid md:grid-cols-5 gap-3 mt-5">
<div class="bg-white dark:bg-primary-900 rounded-md hidden md:block shadow">
<h2 class="h2">Boote</h2>
<div>
{{ log::show_boats(only_ones=false) }}
</div>
</div>
<div class="md:col-span-3 bg-white dark:bg-primary-900 rounded-md shadow">
<h2 class="h2">Neue Ausfahrt</h2>
<div class="p-3">
{{ log::new(only_ones=false, shipmaster=-1) }}
</div>
</div>
<div class="bg-white dark:bg-primary-900 rounded-md shadow">
<h2 class="h2">Am Wasser</h2>
<div>
{% if on_water | length > 0 %}
{% for log in on_water %}
{{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones=false) }}
{% endfor %}
{% else %}
<p class="p-3 text-center text-black dark:text-white">Kein Boot am Wasser</p>
{% endif %} {% endif %}
</div> <div class="w-full grid md:grid-cols-5 gap-3 mt-5">
<div class="bg-white dark:bg-primary-900 rounded-md hidden md:block shadow">
<h2 class="h2">Boote</h2>
<div>{{ log::show_boats(only_ones=false) }}</div>
</div>
<div class="md:col-span-3 bg-white dark:bg-primary-900 rounded-md shadow">
<h2 class="h2">Neue Ausfahrt</h2>
<div class="p-3">{{ log::new(only_ones=false, shipmaster=-1) }}</div>
</div>
<div class="bg-white dark:bg-primary-900 rounded-md shadow">
<h2 class="h2">Am Wasser</h2>
<div>
{% if on_water | length > 0 %}
{% for log in on_water %}
{{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones=false) }}
{% endfor %}
{% else %}
<p class="p-3 text-center text-black dark:text-white">Kein Boot am Wasser</p>
{% endif %}
</div>
</div>
</div>
</div> </div>
</div> <script src="/public/logbook.js"></script>
</div> {% endblock content %}
<script src="/public/logbook.js"></script>
{% endblock content%}

View File

@ -1,24 +1,57 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %} {% import "includes/forms/log" as log %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full">
<div class="max-w-screen-lg w-full"> <h1 class="h1">
<h1 class="h1">Logbuch</h1> Logbuch
{% if loggedin_user and "admin" in loggedin_user.roles %}
<div class="mt-3"> <select id="yearSelect"
<div class="search-wrapper"> onchange="changeYear()"
<label for="name" class="sr-only">Suche</label> style="background: transparent;
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Bootsname oder Ruderer..."> background-image: none;
</div> text-decoration: underline"></select>
{% endif %}
<div id="filter-result-js" class="search-result"></div> </h1>
{% for log in logs %} <div class="mt-3">
{{ log::show_old(log=log, state="completed", only_ones=false, index=loop.index) }} <div class="search-wrapper">
{% endfor %} <label for="name" class="sr-only">Suche</label>
<input type="search"
name="name"
id="filter-js"
class="search-bar"
placeholder="Suchen nach Bootsname oder Ruderer...">
</div>
<div id="filter-result-js" class="search-result"></div>
{% for log in logs %}{{ log::show_old(log=log, state="completed", only_ones=false, index=loop.index) }}{% endfor %}
</div>
</div> </div>
</div> <script>
function getYearFromURL() {
var queryParams = new URLSearchParams(window.location.search);
return queryParams.get('year');
}
{% endblock content%} function populateYears() {
var select = document.getElementById('yearSelect');
var currentYear = new Date().getFullYear();
var selectedYear = getYearFromURL() || currentYear;
for (var year = 2019; year <= currentYear; year++) {
var option = document.createElement('option');
option.value = option.textContent = year;
if (year == selectedYear) {
option.selected = true;
}
select.appendChild(option);
}
}
function changeYear() {
var selectedYear = document.getElementById('yearSelect').value;
window.location.href = '?year=' + selectedYear;
}
// Call this function when the page loads
populateYears();
</script>
{% endblock content %}

View File

@ -1,49 +1,33 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %} {% import "includes/forms/log" as log %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="w-full"> <div class="w-full">
<h1 class="h1">Logbuch</h1> <h1 class="h1">Logbuch</h1>
<div class="w-full grid md:grid-cols-5 gap-3 mt-5">
{% if flash %} <div class="bg-white dark:bg-primary-900 rounded-md hidden md:block shadow">
<div class="w-full"> <h2 class="h2">Boote</h2>
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <div>{{ log::show_boats(only_ones=false) }}</div>
</div> </div>
{% endif %} <div class="md:col-span-3 bg-white dark:bg-primary-900 rounded-md shadow">
<h2 class="h2">Neue Ausfahrt</h2>
<div class="w-full grid md:grid-cols-5 gap-3 mt-5"> <div class="p-3">{{ log::new(shipmaster=loggedin_user.id) }}</div>
<div class="bg-white dark:bg-primary-900 rounded-md hidden md:block shadow"> </div>
<h2 class="h2">Boote</h2> <div class="bg-white dark:bg-primary-900 rounded-md shadow">
<h2 class="h2">Am Wasser</h2>
<div> {% if on_water | length > 0 %}
{{ log::show_boats(only_ones=false) }} {% for log in on_water %}
</div> {% if log.shipmaster == loggedin_user.id %}
</div> {{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones="cox" not in loggedin_user.roles) }}
<div class="md:col-span-3 bg-white dark:bg-primary-900 rounded-md shadow"> {% else %}
<h2 class="h2">Neue Ausfahrt</h2> {{ log::show(log=log, state="on_water", only_ones=true) }}
<div class="p-3"> {% endif %}
{{ log::new(shipmaster=loggedin_user.id) }} {% endfor %}
</div> {% else %}
</div> <p class="p-3 text-center text-black dark:text-white">Kein Boot am Wasser</p>
<div class="bg-white dark:bg-primary-900 rounded-md shadow"> {% endif %}
<h2 class="h2">Am Wasser</h2> </div>
</div>
{% if on_water | length > 0 %} </div>
{% for log in on_water %} <script src="/public/logbook.js"></script>
{% if log.shipmaster == loggedin_user.id %} {% endblock content %}
{{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones="cox" not in loggedin_user.roles) }}
{% else %}
{{ log::show(log=log, state="on_water", only_ones=true) }}
{% endif %}
{% endfor %}
{% else %}
<p class="p-3 text-center text-black dark:text-white">Kein Boot am Wasser</p>
{% endif %}
</div>
</div>
</div>
<script src="/public/logbook.js"></script>
{% endblock content%}

View File

@ -1,24 +1,37 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% import "includes/forms/log" as log %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-xl w-full grid sm:grid-cols-2 lg:grid-cols-3 gap-4"> <div class="max-w-screen-xl w-full grid sm:grid-cols-2 lg:grid-cols-3 gap-4">
{% if flash %} {% if "scheckbuch" in loggedin_user.roles %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} <div class="grid gap-3 sm:col-span-2 lg:col-span-3">
{% endif %} <div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Scheckbuch</h2>
<div class="text-sm p-3">
{% if "paid" not in loggedin_user.roles %} <h3>Du hast bisher {{ last_trips | length }} deiner 5 Scheckbuch-Ausfahrten gemacht:</h3>
<div class="grid gap-3 sm:col-span-2 lg:col-span-3"> <ol>
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5" role="alert"> {% for last_trip in last_trips %}
<h2 class="h2">Vereinsgebühren</h2> <li>{{ log::show_old(log=last_trip, state="completed", only_ones=false, index=loop.index) }}</li>
<div class="text-sm p-3"> {% endfor %}
{% include "includes/qrcode" %} </ol>
<div id="qrcode" style="float: left; padding-top: 10 pt; padding-right: 10pt; padding-bottom: 10pt;"></div> </div>
<script type="text/javascript"> </div>
</div>
{% endif %}
{% if "paid" not in loggedin_user.roles and "Donau Linz" in loggedin_user.roles %}
<div class="grid gap-3 sm:col-span-2 lg:col-span-3">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Vereinsgebühren</h2>
<div class="text-sm p-3">
{% include "includes/qrcode" %}
<div id="qrcode"
style="float: left;
padding-top: 10 pt;
padding-right: 10pt;
padding-bottom: 10pt"></div>
<script type="text/javascript">
var sepaqr = new sepaQR({ var sepaqr = new sepaQR({
benefName: 'ASKÖ Ruderverein Donau Linz', benefName: 'ASKÖ Ruderverein Donau Linz',
benefBIC: 'BKAUATWWXXX', benefBIC: 'BKAUATWWXXX',
@ -28,316 +41,342 @@
}); });
var code = sepaqr.makeCodeInto("qrcode"); var code = sepaqr.makeCodeInto("qrcode");
</script>
</script>
<b>Dein Vereinsbeitrag ({{ fee.name }}): {{ fee.sum_in_cents / 100 }}€ {% if fee.parts | length == 1 %} ({{ fee.parts[0].0 }}) {% endif %}</b><br /> <b>Dein Vereinsbeitrag ({{ fee.name }}): {{ fee.sum_in_cents / 100 }}€
{% if fee.parts | length > 1 %} {% if fee.parts | length == 1 %}({{ fee.parts[0].0 }}){% endif %}
<small> </b>
Setzt sich zusammen aus: <br />
<ul style="list-style: circle; padding-left: 1em;"> {% if fee.parts | length > 1 %}
{% for p in fee.parts %} <small>
<li>{{ p.0 }} ({{ p.1 / 100 }}€) {% if not loop.last %} + {% endif %}</li> Setzt sich zusammen aus:
{% endfor %} <ul style="list-style: circle; padding-left: 1em;">
</ul> {% for p in fee.parts %}
</small> <li>
{% endif %} {{ p.0 }} ({{ p.1 / 100 }}€)
{% if not loop.last %}+{% endif %}
Bitte auf folgendes Konto überweisen: IBAN AT13 1200 0804 1300 1200. Alternativ kannst du auch mit deiner Bankapp den QR Code scannen, damit sollten alle Daten vorausgefüllt sein.<br /> </li>
{% endfor %}
Falls die Berechnung nicht stimmt (korrekte Preise findest du <a href="https://rudernlinz.at/unser-verein/gebuhren/" target="_blank" rel="noopener noreferrer">hier</a>) melde dich bitte bei it@rudernlinz.at. @Studenten: Bitte die aktuelle Studienbestätigung an it@rudernlinz.at schicken.<br /> </ul>
</small>
<small>Wir aktualisieren den Ruderassistent unregelmäßig mit unserem Bankkonto. Falls du schon bezahlt hast, kannst du diese Nachricht getrost ignorieren :^)</small> {% endif %}
Bitte auf folgendes Konto überweisen: IBAN AT13 1200 0804 1300 1200. Alternativ kannst du auch mit deiner Bankapp den QR Code scannen, damit sollten alle Daten vorausgefüllt sein.
<br />
Falls die Berechnung nicht stimmt (korrekte Preise findest du <a href="https://rudernlinz.at/unser-verein/gebuhren/"
target="_blank"
</div> rel="noopener noreferrer">hier</a>) melde dich bitte bei it@rudernlinz.at. @Studenten: Bitte die aktuelle Studienbestätigung an it@rudernlinz.at schicken.
</div> <br />
</div> <small>Wir aktualisieren den Ruderassistent unregelmäßig mit unserem Bankkonto. Falls du schon bezahlt hast, kannst du diese Nachricht getrost ignorieren :^)</small>
{% endif %} </div>
</div>
<h1 class="h1 sm:col-span-2 lg:col-span-3">Ausfahrten</h1> </div>
{% endif %}
{% include "includes/buttons" %} <h1 class="h1 sm:col-span-2 lg:col-span-3">Ausfahrten</h1>
{% include "includes/buttons" %}
{% for day in days %} {% for day in days %}
{% set amount_trips = day.planned_events | length + day.trips | length %} {% set amount_trips = day.planned_events | length + day.trips | length %}
{% set_global day_cox_needed = false %} {% set_global day_cox_needed = false %}
{% if day.planned_events | length > 0 %} {% if day.planned_events | length > 0 %}
{% for planned_event in day.planned_events %} {% for planned_event in day.planned_events %}
{% if planned_event.cox_needed %} {% if planned_event.cox_needed %}
{% set_global day_cox_needed = true %} {% set_global day_cox_needed = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<div class="bg-white dark:bg-primary-900 rounded-md flex justify-between flex-col shadow reset-js"
<div class="bg-white dark:bg-primary-900 rounded-md flex justify-between flex-col shadow reset-js" style="min-height: 10rem;" data-trips="{{ amount_trips }}" data-month="{{ day.day| date(format='%m') }}" data-coxneeded="{{ day_cox_needed }}"> style="min-height: 10rem"
<div> data-trips="{{ amount_trips }}"
<h2 class="font-bold uppercase tracking-wide text-center rounded-t-md {% if day.is_pinned %} text-white bg-primary-950 {% else %} text-primary-950 dark:text-white bg-gray-200 dark:bg-primary-950 bg-opacity-80 {% endif %} text-lg px-3 py-3 ">{{ day.day| date(format="%d.%m.%Y") }} data-month="{{ day.day| date(format='%m') }}"
<small class="inline-block ml-1 text-xs {% if day.is_pinned %} text-gray-200 {% else %} text-gray-500 dark:text-gray-100 {% endif %}">{{ day.day | date(format="%A", locale="de_AT") }}</small> data-coxneeded="{{ day_cox_needed }}">
</h2> <div>
<h2 class="font-bold uppercase tracking-wide text-center rounded-t-md {% if day.is_pinned %} text-white bg-primary-950 {% else %} text-primary-950 dark:text-white bg-gray-200 dark:bg-primary-950 bg-opacity-80 {% endif %} text-lg px-3 py-3 ">
{% if day.planned_events | length > 0 or day.trips | length > 0 %} {{ day.day| date(format="%d.%m.%Y") }}
<div <small class="inline-block ml-1 text-xs {% if day.is_pinned %} text-gray-200 {% else %} text-gray-500 dark:text-gray-100 {% endif %}">{{ day.day | date(format="%A", locale="de_AT") }}</small>
class="grid grid-cols-1 gap-3 mb-3"> </h2>
{% if day.planned_events | length > 0 or day.trips | length > 0 %}
{# --- START Events --- #} <div class="grid grid-cols-1 gap-3 mb-3">
{% if day.planned_events | length > 0 %} {# --- START Events --- #}
{% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %} {% if day.planned_events | length > 0 %}
{% set amount_cur_cox = planned_event.cox | length %} {% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %}
{% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %} {% set amount_cur_cox = planned_event.cox | length %}
<div class="pt-2 px-3 border-t border-gray-200" style="order: {{ planned_event.planned_starting_time | replace(from=":", to="") }}"> {% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %}
<div class="flex justify-between items-center"> <div class="pt-2 px-3 border-t border-gray-200"
<div class="mr-1"> style="order: {{ planned_event.planned_starting_time | replace(from=":", to="") }}">
<strong class="text-primary-900 dark:text-white"> <div class="flex justify-between items-center">
{{ planned_event.planned_starting_time }} <div class="mr-1">
Uhr <strong class="text-primary-900 dark:text-white">
</strong> {{ planned_event.planned_starting_time }}
<small class="text-gray-600 dark:text-gray-100">({{ planned_event.name }}{% if planned_event.trip_type %} - {{ planned_event.trip_type.icon | safe }} {{ planned_event.trip_type.name }}{% endif %})</small><br/> Uhr
</strong>
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{{ planned_event.planned_starting_time }} Uhr</strong> ({{ planned_event.name }}){% if planned_event.trip_type %}<small class='block'>{{ planned_event.trip_type.desc }}</small>{% endif %}{% if planned_event.notes %}<small class='block'>{{ planned_event.notes }}</small>{% endif %}" data-body="#event{{ planned_event.trip_details_id }}" class="inline-block link-primary mr-3"> <small class="text-gray-600 dark:text-gray-100">({{ planned_event.name }}
Details {% if planned_event.trip_type %}
</a> - {{ planned_event.trip_type.icon | safe }} {{ planned_event.trip_type.name }}
</div> {% endif %}
<div )</small>
class="text-right grid gap-2"> <br />
{# --- START Row Buttons --- #} <a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{{ planned_event.planned_starting_time }} Uhr</strong> ({{ planned_event.name }})
{% set_global cur_user_participates = false %} {% if planned_event.trip_type %}<small class='block'>{{ planned_event.trip_type.desc }}</small>{% endif %}
{% for rower in planned_event.rower%} {% if planned_event.notes %}<small class='block'>{{ planned_event.notes }}</small>{% endif %}
{% if rower.name == loggedin_user.name %} " data-body="#event{{ planned_event.trip_details_id }}" class="inline-block link-primary mr-3">
{% set_global cur_user_participates = true %} Details
{% endif %} </a>
{% endfor %} </div>
{% if cur_user_participates %} <div class="text-right grid gap-2">
<a href="/planned/remove/{{ planned_event.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a> {# --- START Row Buttons --- #}
{% endif %} {% set_global cur_user_participates = false %}
{% if planned_event.max_people > planned_event.rower | length %} {% for rower in planned_event.rower %}
{% if cur_user_participates == false %} {% if rower.name == loggedin_user.name %}
<a href="/planned/join/{{ planned_event.trip_details_id }}" class="btn btn-primary btn-fw" {% if planned_event.trip_type %} onclick="return confirm('{{ planned_event.trip_type.question }}');" {% endif %}>Mitrudern</a> {% set_global cur_user_participates = true %}
{% endif %} {% endif %}
{% endif %} {% endfor %}
{# --- END Row Buttons --- #} {% if cur_user_participates %}
<a href="/planned/remove/{{ planned_event.trip_details_id }}"
{# --- START Cox Buttons --- #} class="btn btn-attention btn-fw">Abmelden</a>
{% if "cox" in loggedin_user.roles %} {% endif %}
{% set_global cur_user_participates = false %} {% if planned_event.max_people > planned_event.rower | length %}
{% for cox in planned_event.cox %} {% if cur_user_participates == false %}
{% if cox.name == loggedin_user.name %} <a href="/planned/join/{{ planned_event.trip_details_id }}"
{% set_global cur_user_participates = true %} class="btn btn-primary btn-fw"
{% endif %} {% if planned_event.trip_type %}onclick="return confirm('{{ planned_event.trip_type.question }}');"{% endif %}>Mitrudern</a>
{% endfor %} {% endif %}
{% if cur_user_participates %} {% endif %}
<a href="/cox/remove/{{ planned_event.id }}" class="block btn btn-attention btn-fw"> {# --- END Row Buttons --- #}
{% include "includes/cox-icon" %} {# --- START Cox Buttons --- #}
Abmelden {% if "cox" in loggedin_user.roles %}
</a> {% set_global cur_user_participates = false %}
{% else %} {% for cox in planned_event.cox %}
<a href="/cox/join/{{ planned_event.id }}" class="block btn {% if amount_cox_missing > 0 %} btn-dark {% else %} btn-gray {% endif %} btn-fw" {% if planned_event.trip_type %} onclick="return confirm('{{ planned_event.trip_type.question }}');" {% endif %}> {% if cox.name == loggedin_user.name %}
{% include "includes/cox-icon" %} {% set_global cur_user_participates = true %}
Steuern {% endif %}
</a> {% endfor %}
{% endif %} {% if cur_user_participates %}
{% endif %} <a href="/cox/remove/{{ planned_event.id }}"
{# --- END Cox Buttons --- #} class="block btn btn-attention btn-fw">
</div> {% include "includes/cox-icon" %}
</div> Abmelden
</a>
{# --- START Sidebar Content --- #} {% else %}
<div class="hidden"> <a href="/cox/join/{{ planned_event.id }}"
<div class="block btn {% if amount_cox_missing > 0 %} btn-dark {% else %} btn-gray {% endif %} btn-fw"
id="event{{ planned_event.trip_details_id }}"> {% if planned_event.trip_type %}onclick="return confirm('{{ planned_event.trip_type.question }}');"{% endif %}>
{# --- START List Coxes --- #} {% include "includes/cox-icon" %}
{% if planned_event.planned_amount_cox > 0 %} Steuern
{% if amount_cox_missing > 0 %} </a>
{{ macros::box(participants=planned_event.cox, empty_seats=planned_event.planned_amount_cox - amount_cur_cox, header='Noch benötigte Steuerleute:', text='Keine Steuerleute angemeldet') }} {% endif %}
{% else %} {% endif %}
{{ macros::box(participants=planned_event.cox, empty_seats="", header='Genügend Steuerleute haben sich angemeldet :-)', text='Keine Steuerleute angemeldet') }} {# --- END Cox Buttons --- #}
{% endif %} </div>
{% endif %} </div>
{# --- END List Coxes --- #} {# --- START Sidebar Content --- #}
<div class="hidden">
{# --- START List Rowers --- #} <div id="event{{ planned_event.trip_details_id }}">
{% if planned_event.max_people > 0 %} {# --- START List Coxes --- #}
{% set amount_cur_rower = planned_event.rower | length %} {% if planned_event.planned_amount_cox > 0 %}
{{ macros::box(participants=planned_event.rower, empty_seats=planned_event.max_people - amount_cur_rower, bg='primary-100', color='black', trip_details_id=planned_event.trip_details_id, allow_removing="planned_event" in loggedin_user.roles) }} {% if amount_cox_missing > 0 %}
{% endif %} {{ macros::box(participants=planned_event.cox, empty_seats=planned_event.planned_amount_cox - amount_cur_cox, header='Noch benötigte Steuerleute:', text='Keine Steuerleute angemeldet') }}
{# --- END List Rowers --- #} {% else %}
{{ macros::box(participants=planned_event.cox, empty_seats="", header='Genügend Steuerleute haben sich angemeldet :-)', text='Keine Steuerleute angemeldet') }}
{% if "planned_event" in loggedin_user.roles %} {% endif %}
<form action="/planned/join/{{ planned_event.trip_details_id }}" method="get" /> {% endif %}
{{ macros::input(label='Gast', class="input rounded-t", name='user_note', type='text', required=true) }} {# --- END List Coxes --- #}
<input value="Gast hinzufügen" class="btn btn-primary w-full rounded-t-none-important" type="submit"/> {# --- START List Rowers --- #}
</form> {% if planned_event.max_people > 0 %}
{% endif %} {% set amount_cur_rower = planned_event.rower | length %}
{{ macros::box(participants=planned_event.rower, empty_seats=planned_event.max_people - amount_cur_rower, bg='primary-100', color='black', trip_details_id=planned_event.trip_details_id, allow_removing="planned_event" in loggedin_user.roles) }}
{% endif %}
{% if planned_event.allow_guests %} {# --- END List Rowers --- #}
<div class="text-primary-900 bg-primary-50 text-center p-1 mb-4">Gäste willkommen!</div> {% if "planned_event" in loggedin_user.roles %}
{% endif %} <form action="/planned/join/{{ planned_event.trip_details_id }}"
method="get" />
{% if "planned_event" in loggedin_user.roles %} {{ macros::input(label='Gast', class="input rounded-t", name='user_note', type='text', required=true) }}
<input value="Gast hinzufügen"
{# --- START Edit Form --- #} class="btn btn-primary w-full rounded-t-none-important"
<div class="bg-gray-100 dark:bg-primary-900 p-3 mt-4 rounded-md"> type="submit" />
<h3 class="text-primary-950 dark:text-white font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3> </form>
<form action="/admin/planned-event" method="post" class="grid gap-3"> {% endif %}
<input type="hidden" name="_method" value="put"/> {% if planned_event.allow_guests %}
<input type="hidden" name="id" value="{{ planned_event.id }}"/> <div class="text-primary-900 bg-primary-50 text-center p-1 mb-4">Gäste willkommen!</div>
{{ macros::input(label='Titel', name='name', type='input', value=planned_event.name) }} {% endif %}
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }} {% if "planned_event" in loggedin_user.roles %}
{{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }} {# --- START Edit Form --- #}
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=planned_event.id,checked=planned_event.always_show) }} <div class="bg-gray-100 dark:bg-primary-900 p-3 mt-4 rounded-md">
{{ macros::checkbox(label='Gesperrt', name='is_locked', id=planned_event.id,checked=planned_event.is_locked) }} <h3 class="text-primary-950 dark:text-white font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }} <form action="/admin/planned-event" method="post" class="grid gap-3">
<input type="hidden" name="_method" value="put" />
<input value="Speichern" class="btn btn-primary" type="submit"/> <input type="hidden" name="id" value="{{ planned_event.id }}" />
</form> {{ macros::input(label='Titel', name='name', type='input', value=planned_event.name) }}
</div> {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }}
{# --- END Edit Form --- #} {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }}
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=planned_event.id,checked=planned_event.always_show) }}
{# --- START Delete Btn --- #} {{ macros::checkbox(label='Gesperrt', name='is_locked', id=planned_event.id,checked=planned_event.is_locked) }}
<div class="text-right"> {{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }}
<a href="/admin/planned-event/{{ planned_event.id }}/delete" class="inline-block btn btn-alert"> <input value="Speichern" class="btn btn-primary" type="submit" />
{% include "includes/delete-icon" %} </form>
Termin löschen </div>
</a> {# --- END Edit Form --- #}
</div> {# --- START Delete Btn --- #}
{% endif %} <div class="text-right">
{# --- END Delete Btn --- #} <a href="/admin/planned-event/{{ planned_event.id }}/delete"
</div> class="inline-block btn btn-alert">
</div> {% include "includes/delete-icon" %}
{# --- END Sidebar Content --- #} Termin löschen
</div> </a>
{% endfor %} </div>
{% endif %} {% endif %}
{# --- END Events --- #} {# --- END Delete Btn --- #}
</div>
{# --- START Trips --- #} </div>
{% if day.trips | length > 0 %} {# --- END Sidebar Content --- #}
{% for trip in day.trips | sort(attribute="planned_starting_time") %} </div>
<div class="pt-2 px-3 reset-js border-t border-gray-200" style="order: {{ trip.planned_starting_time | replace(from=":", to="") }}" data-coxneeded="false"> {% endfor %}
<div class="flex justify-between items-center"> {% endif %}
<div class="mr-1"> {# --- END Events --- #}
{% if trip.max_people == 0 %} {# --- START Trips --- #}
<strong class="text-[#f43f5e]">&#9888; {% if day.trips | length > 0 %}
{{ trip.planned_starting_time }} {% for trip in day.trips | sort(attribute="planned_starting_time") %}
Uhr</strong> <div class="pt-2 px-3 reset-js border-t border-gray-200"
<small class="text-[#f43f5e]">(Absage style="order: {{ trip.planned_starting_time | replace(from=":", to="") }}"
{{ trip.cox_name }} data-coxneeded="false">
{% if trip.trip_type %} <div class="flex justify-between items-center">
- <div class="mr-1">
{{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }} {% if trip.max_people == 0 %}
{% endif %})</small> <strong class="text-[#f43f5e]">&#9888;
{% else %} {{ trip.planned_starting_time }}
<strong class="text-primary-900 dark:text-white">{{ trip.planned_starting_time }} Uhr</strong>
Uhr</strong> <small class="text-[#f43f5e]">(Absage
<small class="text-gray-600 dark:text-gray-100">({{ trip.cox_name }}{% if trip.trip_type %} - {{ trip.trip_type.icon | safe }} {{ trip.trip_type.name }}{% endif %})</small> {{ trip.cox_name -}}
{% endif %} {% if trip.trip_type %}
<br/> -
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{% if trip.max_people == 0 %}&#9888; {% endif %}{{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }}){% if trip.trip_type %}<small class='block'>{{ trip.trip_type.desc }}</small>{% endif %}{% if trip.notes %}<small class='block'>{{ trip.notes }}</small>{% endif %}" data-body="#trip{{ trip.trip_details_id }}" class="inline-block link-primary mr-3"> {{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }}
Details {% endif -%}
</a> )</small>
</div> {% else %}
<strong class="text-primary-900 dark:text-white">{{ trip.planned_starting_time }}
<div> Uhr</strong>
{% set_global cur_user_participates = false %} <small class="text-gray-600 dark:text-gray-100">({{ trip.cox_name -}}
{% for rower in trip.rower %} {% if trip.trip_type %}
{% if rower.name == loggedin_user.name %} - {{ trip.trip_type.icon | safe }} {{ trip.trip_type.name }}
{% set_global cur_user_participates = true %} {% endif -%}
{% endif %} )</small>
{% endfor %} {% endif %}
{% if cur_user_participates %} <br />
<a href="/planned/remove/{{ trip.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a> <a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>
{% endif %} {% if trip.max_people == 0 %}&#9888;{% endif %}
{% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false%} {{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }})
<a href="/planned/join/{{ trip.trip_details_id }}" class="btn btn-primary btn-fw" {% if trip.trip_type %} onclick="return confirm('{{ trip.trip_type.question }}');" {% endif %}>Mitrudern</a> {% if trip.trip_type %}<small class='block'>{{ trip.trip_type.desc }}</small>{% endif %}
{% endif %} {% if trip.notes %}<small class='block'>{{ trip.notes }}</small>{% endif %}
</div> " data-body="#trip{{ trip.trip_details_id }}" class="inline-block link-primary mr-3">
</div> Details
{# --- START Sidebar Content --- #} </a>
<div class="hidden"> </div>
<div id="trip{{ trip.trip_details_id }}"> <div>
{% if trip.max_people == 0 %} {% set_global cur_user_participates = false %}
{# --- border-[#f43f5e] bg-[#f43f5e] --- #} {% for rower in trip.rower %}
{{ macros::box(participants=trip.rower,bg='[#f43f5e]',header='Absage') }} {% if rower.name == loggedin_user.name %}
{% else %} {% set_global cur_user_participates = true %}
{% set amount_cur_rower = trip.rower | length %} {% endif %}
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black', trip_details_id=trip.trip_details_id, allow_removing=loggedin_user.id == trip.cox_id) }} {% endfor %}
{% if trip.cox_id == loggedin_user.id %} {% if cur_user_participates %}
<form action="/planned/join/{{ trip.trip_details_id }}" method="get" /> <a href="/planned/remove/{{ trip.trip_details_id }}"
{{ macros::input(label='Gast', class="input rounded-t", name='user_note', type='text', required=true) }} class="btn btn-attention btn-fw">Abmelden</a>
<input value="Gast hinzufügen" class="btn btn-primary w-full rounded-t-none-important" type="submit"/> {% endif %}
</form> {% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false %}
{% endif %} <a href="/planned/join/{{ trip.trip_details_id }}"
{% endif %} class="btn btn-primary btn-fw"
{% if trip.trip_type %}onclick="return confirm('{{ trip.trip_type.question }}');"{% endif %}>Mitrudern</a>
{# --- START Edit Form --- #} {% endif %}
{% if trip.cox_id == loggedin_user.id %} </div>
<div class="bg-gray-100 dark:bg-primary-900 p-3 mt-4 rounded-md"> </div>
<h3 class="text-primary-950 dark:text-white font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3> {# --- START Sidebar Content --- #}
<form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3"> <div class="hidden">
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }} <div id="trip{{ trip.trip_details_id }}">
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }} {% if trip.max_people == 0 %}
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=trip.id,checked=trip.always_show) }} {# --- border-[#f43f5e] bg-[#f43f5e] --- #}
{{ macros::checkbox(label='Gesperrt', name='is_locked', id=trip.id,checked=trip.is_locked) }} {{ macros::box(participants=trip.rower,bg='[#f43f5e]',header='Absage') }}
{{ macros::select(label='Typ', name='trip_type', data=trip_types, default='Reguläre Ausfahrt', selected_id=trip.trip_type_id) }} {% else %}
{% set amount_cur_rower = trip.rower | length %}
<input value="Speichern" class="btn btn-primary" type="submit"/> {{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black', trip_details_id=trip.trip_details_id, allow_removing=loggedin_user.id == trip.cox_id) }}
</form> {% if trip.cox_id == loggedin_user.id %}
</div> <form action="/planned/join/{{ trip.trip_details_id }}" method="get" />
{% if trip.rower | length == 0 %} {{ macros::input(label='Gast', class="input rounded-t", name='user_note', type='text', required=true) }}
<div class="text-right mt-6"> <input value="Gast hinzufügen"
<a href="/cox/remove/trip/{{ trip.id }}" class="inline-block btn btn-alert"> class="btn btn-primary w-full rounded-t-none-important"
{% include "includes/delete-icon" %} type="submit" />
Termin löschen </form>
</a> {% endif %}
</div> {% endif %}
{% endif %} {# --- START Edit Form --- #}
{% endif %} {% if trip.cox_id == loggedin_user.id %}
{# --- END Edit Form --- #} <div class="bg-gray-100 dark:bg-primary-900 p-3 mt-4 rounded-md">
</div> <h3 class="text-primary-950 dark:text-white font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
</div> <form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3">
{# --- END Sidebar Content --- #} {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }}
</div> {{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }}
{% endfor %} {{ macros::checkbox(label='Immer anzeigen', name='always_show', id=trip.id,checked=trip.always_show) }}
{% endif %} {{ macros::checkbox(label='Gesperrt', name='is_locked', id=trip.id,checked=trip.is_locked) }}
{# --- END Trips --- #} {{ macros::select(label='Typ', name='trip_type', data=trip_types, default='Reguläre Ausfahrt', selected_id=trip.trip_type_id) }}
</div> <input value="Speichern" class="btn btn-primary" type="submit" />
{% endif %} </form>
</div> </div>
{% if trip.rower | length == 0 %}
{# --- START Add Buttons --- #} <div class="text-right mt-6">
{% if "planned_event" in loggedin_user.roles or "cox" in loggedin_user.roles %} <a href="/cox/remove/trip/{{ trip.id }}"
<div class="grid {% if "planned_event" in loggedin_user.roles %} grid-cols-2 {% endif %} text-center"> class="inline-block btn btn-alert">
{% if "planned_event" in loggedin_user.roles %} {% include "includes/delete-icon" %}
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#addEventForm" class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 dark:bg-primary-950 text-white py-2 rounded-bl-md text-sm font-semibold"> Termin löschen
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> </a>
{% include "includes/plus-icon" %} </div>
</span> {% endif %}
Event {% endif %}
</a> {# --- END Edit Form --- #}
{% endif %} </div>
</div>
{% if "cox" in loggedin_user.roles %} {# --- END Sidebar Content --- #}
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Ausfahrt</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#sidebarForm" class="relative inline-block w-full py-2 text-primary-900 hover:text-primary-950 dark:bg-primary-600 dark:text-white dark:hover:bg-primary-500 dark:hover:text-white focus:text-primary-950 text-sm font-semibold bg-gray-100 hover:bg-gray-200 focus:bg-gray-200 {% if "planned_event" in loggedin_user.roles %} rounded-br-md {% else %} rounded-b-md {% endif %}"> </div>
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> {% endfor %}
{% include "includes/plus-icon" %} {% endif %}
</span> {# --- END Trips --- #}
Ausfahrt </div>
</a> {% endif %}
{% endif %} </div>
</div> {# --- START Add Buttons --- #}
{% endif %} {% if "planned_event" in loggedin_user.roles or "cox" in loggedin_user.roles %}
{# --- END Add Buttons --- #} <div class="grid {% if "planned_event" in loggedin_user.roles %}grid-cols-2{% endif %} text-center">
</div> {% if "planned_event" in loggedin_user.roles %}
{% endfor %} <a href="#"
</div> data-sidebar="true"
data-trigger="sidebar"
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
data-day="{{ day.day }}"
data-body="#addEventForm"
class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 dark:bg-primary-950 text-white py-2 rounded-bl-md text-sm font-semibold">
<span class="absolute inset-y-0 left-0 flex items-center pl-3">{% include "includes/plus-icon" %}</span>
Event
</a>
{% endif %}
{% if "cox" in loggedin_user.roles %}
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Ausfahrt</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#sidebarForm" class="relative inline-block w-full py-2 text-primary-900 hover:text-primary-950 dark:bg-primary-600 dark:text-white dark:hover:bg-primary-500 dark:hover:text-white focus:text-primary-950 text-sm font-semibold bg-gray-100 hover:bg-gray-200 focus:bg-gray-200
{% if "planned_event" in loggedin_user.roles %}
rounded-br-md
{% else %}
rounded-b-md
{% endif %}
">
<span class="absolute inset-y-0 left-0 flex items-center pl-3">{% include "includes/plus-icon" %}</span>
Ausfahrt
</a>
{% endif %}
</div>
{% endif %}
{# --- END Add Buttons --- #}
</div>
{% endfor %}
</div>
</div> </div>
{% if "cox" in loggedin_user.roles %} {% if "cox" in loggedin_user.roles %}
{% include "forms/trip" %} {% include "forms/trip" %}
{% endif %} {% endif %}
{% if "planned_event" in loggedin_user.roles %} {% if "planned_event" in loggedin_user.roles %}
{% include "forms/event" %} {% include "forms/event" %}
{% endif %}{% endblock content %} {% endif %}
{% endblock content %}

View File

@ -1,40 +1,40 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Bootsauswertung</h1> <h1 class="h1">Bootsauswertung</h1>
<div class="search-wrapper"> <div class="search-wrapper">
<label for="name" class="sr-only">Suche</label> <label for="name" class="sr-only">Suche</label>
<input type="search" name="name" id="filter-js" class="search-bar" placeholder="Suchen nach Bootsnamen..."> <input type="search"
</div> name="name"
id="filter-js"
<div id="filter-result-js" class="search-result"></div> class="search-bar"
placeholder="Suchen nach Bootsnamen...">
<div class="border-r border-l border-gray-200 dark:border-primary-600"> </div>
{% set_global km = 0 %} <div id="filter-result-js" class="search-result"></div>
{% set_global index = 1 %} <div class="border-r border-l border-gray-200 dark:border-primary-600">
{% for s in stat %} {% set_global km = 0 %}
<div class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %} border-b {% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1" data-filterable="true" data-filter="{{ s.name }}"> {% set_global index = 1 %}
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"> {% for s in stat %}
{% if km != s.rowed_km %} <div class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %}border-b{% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
{{loop.index}} data-filterable="true"
{% set_global index = loop.index %} data-filter="{{ s.name }}">
{% else %} <span class="text-sm text-gray-600 dark:text-gray-100 w-10">
{{ index }} {% if km != s.rowed_km %}
{% endif %} {{ loop.index }}
</span> {% set_global index = loop.index %}
<span class="grow">{{s.name}}</span> {% else %}
<span>{{s.rowed_km}} {{ index }}
km</span> {% endif %}
</span>
{% set_global km = s.rowed_km %} <span class="grow">{{ s.name }}</span>
</div> <span>{{ s.rowed_km }}
{% endfor %} km</span>
</div> {% set_global km = s.rowed_km %}
<div id="container" class="w-full"></div> </div>
</div> {% endfor %}
</div>
<script src="/public/logbook.js"></script> <div id="container" class="w-full"></div>
{% endblock content%} </div>
<script src="/public/logbook.js"></script>
{% endblock content %}

View File

@ -1,77 +1,57 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full">
<h1 class="h1">
<div class="max-w-screen-lg w-full"> Statistik
<h1 class="h1"> <select id="yearSelect"
Statistik onchange="changeYear()"
<select style="background: transparent;
id="yearSelect" background-image: none;
onchange="changeYear()" text-decoration: underline"></select>
style=" </h1>
background: transparent; <div class="search-wrapper">
background-image: none; <label for="name" class="sr-only">Suche</label>
text-decoration: underline; <input type="search"
" name="name"
></select> id="filter-js"
</h1> class="search-bar"
<div class="search-wrapper"> placeholder="Suchen nach Namen..." />
<label for="name" class="sr-only">Suche</label> </div>
<input <div id="filter-result-js" class="search-result"></div>
type="search" <div class="border-r border-l border-gray-200 dark:border-primary-600">
name="name" {% set_global km = 0 %} {% set_global index = 1 %}
id="filter-js" {% for s in stat %}
class="search-bar" <div class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %}border-b{% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
placeholder="Suchen nach Namen..." data-filterable="true"
/> data-filter="{{ s.name }}">
</div> <span class="text-sm text-gray-600 dark:text-gray-100 w-10">
{% if km != s.rowed_km %}
<div id="filter-result-js" class="search-result"></div> {{ loop.index }}
{% set_global index = loop.index %}
<div class="border-r border-l border-gray-200 dark:border-primary-600"> {% else %}
{% set_global km = 0 %} {% set_global index = 1 %} {% for s in stat %} {{ index }}
<div {% endif %}
class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %} border-b {% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1" </span>
data-filterable="true" <span class="grow">{{ s.name }}</span>
data-filter="{{ s.name }}" <span>{{ s.rowed_km }} km</span>
> {% set_global km = s.rowed_km %}
<span class="text-sm text-gray-600 dark:text-gray-100 w-10"> </div>
{% if km != s.rowed_km %} {% endfor %}
{{ loop.index }} <div class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %}border-b{% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
{% set_global index = loop.index %} {% else %} data-filterable="true"
{{ index }} data-filter="{{ guest_km.name }}">
{% endif %} <span class="text-sm text-gray-600 dark:text-gray-100 w-10"></span>
</span> <span class="grow">{{ guest_km.name }}</span>
<span class="grow">{{ s.name }}</span> <span>{{ guest_km.rowed_km }} km</span>
<span>{{ s.rowed_km }} km</span> </div>
</div>
{% set_global km = s.rowed_km %} <div id="container" class="w-full"></div>
</div> </div>
{% endfor %} <script>
<div
class="border-t border-gray-200 dark:border-primary-600 {% if loop.last %} border-b {% endif %} bg-white dark:bg-primary-900 text-black dark:text-white flex justify-between items-center px-3 py-1"
data-filterable="true"
data-filter="{{ guest_km.name }}"
>
<span class="text-sm text-gray-600 dark:text-gray-100 w-10">
</span>
<span class="grow">{{ guest_km.name }}</span>
<span>{{ guest_km.rowed_km }} km</span>
</div>
</div>
<div id="container" class="w-full"></div>
</div>
<script>
{% if personal %} {% if personal %}
const data = [ const data = [
{%- for p in personal %} {%- for p in personal %}{ date: '{{p.date}}', km: {{p.km}} },{%- endfor %}
{ date: '{{p.date}}', km: {{p.km}} },
{%- endfor %}
] ]
sessionStorage.setItem('userStats', JSON.stringify(data)); sessionStorage.setItem('userStats', JSON.stringify(data));
{% endif %} {% endif %}
@ -102,7 +82,6 @@ function changeYear() {
// Call this function when the page loads // Call this function when the page loads
populateYears(); populateYears();
</script> </script>
<script src="/public/logbook.js"></script>
<script src="/public/logbook.js"></script> {% endblock content %}
{% endblock content%}