From 25eabefd43b00b48ccf27796586d00df403124f7 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 12:58:50 +0100 Subject: [PATCH 1/8] show own data + add gitignore folder --- .gitignore | 1 + templates/ergo.html.tera | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index d17d371..6b4b2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ db.sqlite Rocket.toml frontend/node_modules/* /static/ +/data-ergo/ diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index 2ecc90f..bb478b8 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -7,6 +7,19 @@ {% if flash %} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {% endif %} +
+ Deine Daten +

+ 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 it@rudernlinz.at). +

+

+

+
+

Neuer Eintrag

Dirty Thirty From 728d87ab05f29d4f2eb87ca9b48fbd3bf3eb7932 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 12:58:50 +0100 Subject: [PATCH 2/8] show own data + add gitignore folder --- .gitignore | 1 + templates/ergo.html.tera | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index d17d371..6b4b2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ db.sqlite Rocket.toml frontend/node_modules/* /static/ +/data-ergo/ diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index 2ecc90f..bb478b8 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -7,6 +7,19 @@ {% if flash %} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {% endif %} +
+ Deine Daten +

+ 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 it@rudernlinz.at). +

+

    +
  • Geburtsdatum: {{ loggedin_user.dob }}
  • +
  • Gewicht: {{ loggedin_user.weight}} kg
  • +
  • Geschlecht: {{ loggedin_user.sex}}
  • +
+

+
+

Neuer Eintrag

Dirty Thirty From 2bff02f43aadca1eb907b34f9fa61b70b67a5483 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 13:19:21 +0100 Subject: [PATCH 3/8] ergo: default own person --- templates/ergo.html.tera | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index bb478b8..3d172a6 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -29,7 +29,11 @@ {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} @@ -49,7 +53,11 @@ {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} From 50de29284f9acb7ea3f0838ae8f23b2303d33381 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 13:50:34 +0100 Subject: [PATCH 4/8] disable reload on ergo page; allow camera capture --- frontend/main.ts | 24 +++++++++++++----------- templates/ergo.html.tera | 4 ++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index 640f60a..625abd6 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -68,19 +68,21 @@ function selectBoatChange() { } function reloadPage() { - let pageTitle = document.title; - let attentionMessage = 'Riemen- und Dollenbruch'; + if (!window.location.href.includes("ergo")){ + let pageTitle = document.title; + let attentionMessage = 'Riemen- und Dollenbruch'; - document.addEventListener('visibilitychange', function() { - let isPageActive = !document.hidden; + document.addEventListener('visibilitychange', function() { + let isPageActive = !document.hidden; - if(!isPageActive){ - document.title = attentionMessage; - } else { - document.title = pageTitle; - location.reload(); - } - }); + if(!isPageActive){ + document.title = attentionMessage; + } else { + document.title = pageTitle; + location.reload(); + } + }); + } } function setMaxAmountRowers(name: string, rowers: number) { diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index 3d172a6..3385611 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -37,7 +37,7 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + @@ -61,7 +61,7 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + From 8cb9bb36c743fb1b47a5f018ce12c6c3a517d516 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 14:40:26 +0100 Subject: [PATCH 5/8] fix limits --- Rocket.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rocket.toml b/Rocket.toml index b16f20f..e572218 100644 --- a/Rocket.toml +++ b/Rocket.toml @@ -1,4 +1,4 @@ [default] secret_key = "/NtVGizglEoyoxBLzsRDWTy4oAG1qDw4J4O+CWJSv+fypD7W9sam8hUY4j90EZsbZk8wEradS5zBoWtWKi3k8w==" rss_key = "rss-key-for-ci" -limits = { file = "10 MiB"} +limits = { file = "10 MiB", data-form = "10 MiB"} From 4726c25d202bdf37cc5e28729398d26a012f08e3 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 15:04:08 +0100 Subject: [PATCH 6/8] migration + better ordering --- src/model/user.rs | 2 +- staging-diff.sql | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/model/user.rs b/src/model/user.rs index 90061c7..252d208 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -186,7 +186,7 @@ ORDER BY last_access DESC SELECT id, name, pw, is_cox, is_admin, is_guest, deleted, last_access, is_tech, dob, weight, sex FROM user WHERE deleted = 0 AND dob is not null and weight is not null and sex is not null -ORDER BY last_access DESC +ORDER BY name DESC " ) .fetch_all(db) diff --git a/staging-diff.sql b/staging-diff.sql index 59dcf12..fef0ce0 100644 --- a/staging-diff.sql +++ b/staging-diff.sql @@ -28,3 +28,29 @@ ALTER TABLE user ADD COLUMN sex text; ALTER TABLE user ADD COLUMN dirty_thirty text; ALTER TABLE user ADD COLUMN dirty_dozen text; +UPDATE user SET dob = '1993', weight = '70', sex = 'f' WHERE name like 'Marie Birner'; +UPDATE user SET dob = '1986', weight = '58', sex = 'f' WHERE name like 'Sandra Sollberger'; +UPDATE user SET dob = '1999', weight = '70', sex = 'm' WHERE name like 'Raphael Eichhorn'; +UPDATE user SET dob = '1979', weight = '78', sex = 'm' WHERE name like 'Daniel Eichhorn'; +UPDATE user SET dob = '1958', weight = '112', sex = 'm' WHERE name like 'Christian Gusenbauer'; +UPDATE user SET dob = '1994', weight = '60', sex = 'm' WHERE name like 'Philipp Baillon'; +UPDATE user SET dob = '1971', weight = '77', sex = 'm' WHERE name like 'Manfred Meindl'; +UPDATE user SET dob = '1984', weight = '72', sex = 'm' WHERE name like 'Thomas Hoffelner'; +UPDATE user SET dob = '1982', weight = '65', sex = 'f' WHERE name like 'Bettina Fürlinger'; +UPDATE user SET dob = '1965', weight = '85', sex = 'm' WHERE name like 'Thomas Klima'; +UPDATE user SET dob = '1997', weight = '65', sex = 'm' WHERE name like 'Philipp Hofer'; +UPDATE user SET dob = '1969', weight = '77', sex = 'f' WHERE name like 'Claudia Jagersberger'; +UPDATE user SET dob = '1999', weight = '85', sex = 'm' WHERE name like 'Martin Kugler'; +UPDATE user SET dob = '1978', weight = '72', sex = 'f' WHERE name like 'Eva-Maria Gruber'; +UPDATE user SET dob = '1993', weight = '100', sex = 'm' WHERE name like 'Niklas Sageder'; +UPDATE user SET dob = '2001', weight = '', sex = 'f' WHERE name like 'Marika Rodinger'; +UPDATE user SET dob = '2005', weight = '82', sex = 'm' WHERE name like 'Erik Rodinger'; +UPDATE user SET dob = '1967', weight = '99', sex = 'm' WHERE name like 'Michael Rodinger'; +UPDATE user SET dob = '2001', weight = '', sex = 'm' WHERE name like 'Alaa Almousa'; +UPDATE user SET dob = '1994', weight = '72', sex = 'm' WHERE name like 'Stephan Siegl'; +UPDATE user SET dob = '2007', weight = '68', sex = 'f' WHERE name like 'Caroline Schwendinger'; +UPDATE user SET dob = '2007', weight = '50', sex = 'f' WHERE name like 'Daria Danner'; +UPDATE user SET dob = '2001', weight = '58', sex = 'f' WHERE name like 'Edith Steinacker'; +UPDATE user SET dob = '2002', weight = '', sex = 'm' WHERE name like 'Max Knauseder'; +UPDATE user SET dob = '2005', weight = '', sex = 'f' WHERE name like 'Larissa Freimuth'; +UPDATE user SET dob = '1980', weight = '53', sex = 'f' WHERE name like 'Sylvia Ecker'; From 2767e2fe252ba015ba4f6a072ccd184d987fe1e6 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 15:34:21 +0100 Subject: [PATCH 7/8] better label --- templates/ergo.html.tera | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/ergo.html.tera b/templates/ergo.html.tera index 3385611..ecb4bf9 100644 --- a/templates/ergo.html.tera +++ b/templates/ergo.html.tera @@ -37,7 +37,8 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + + @@ -61,7 +62,8 @@ {% endfor %} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} - + + From 039f9fbddf6dfd6de3bb79afc2be2666d58dc8ab Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 2 Nov 2023 16:00:41 +0100 Subject: [PATCH 8/8] switch order --- src/model/user.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/user.rs b/src/model/user.rs index 252d208..d95f989 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -186,7 +186,7 @@ ORDER BY last_access DESC SELECT id, name, pw, is_cox, is_admin, is_guest, deleted, last_access, is_tech, dob, weight, sex FROM user WHERE deleted = 0 AND dob is not null and weight is not null and sex is not null -ORDER BY name DESC +ORDER BY name " ) .fetch_all(db)