Merge branch 'staging' into 'main'

Staging

See merge request PhilippHofer/rot!71
This commit is contained in:
PhilippHofer 2023-11-02 18:47:34 +00:00
commit 650e96cccd
3 changed files with 9 additions and 59 deletions

View File

@ -139,7 +139,10 @@ async fn new_thirty(
Log::create( Log::create(
db, db,
format!("{created_by:?} created thirty-ergo entry: {data:?}"), format!(
"{} created thirty-ergo entry: {data:?}",
created_by.user.name
),
) )
.await; .await;
@ -176,7 +179,10 @@ async fn new_dozen(
Log::create( Log::create(
db, db,
format!("{created_by:?} created dozen-ergo entry: {data:?}"), format!(
"{} created dozen-ergo entry: {data:?}",
created_by.user.name
),
) )
.await; .await;

View File

@ -1,56 +0,0 @@
ALTER TABLE logbook ADD COLUMN "steering_person" INTEGER NOT NULL DEFAULT 0 REFERENCES user(id);
UPDATE logbook SET steering_person = shipmaster;
CREATE TABLE "logbook_temp" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"boat_id" INTEGER NOT NULL REFERENCES boat(id),
"shipmaster" INTEGER NOT NULL REFERENCES user(id),
"steering_person" INTEGER NOT NULL DEFAULT 1 REFERENCES user(id),
"shipmaster_only_steering" boolean not null,
"departure" datetime not null,
"arrival" datetime,
"destination" text,
"distance_in_km" integer,
"comments" text,
"logtype" INTEGER REFERENCES logbook_type(id)
);
INSERT INTO logbook_temp(id, boat_id, shipmaster, shipmaster_only_steering, departure, arrival, destination, distance_in_km, comments, logtype) SELECT id, boat_id, shipmaster, shipmaster_only_steering, COALESCE(departure, '2000-01-01 00:00:00'), arrival, destination, distance_in_km, comments, logtype FROM logbook;
DROP TABLE logbook;
ALTER TABLE logbook_temp RENAME TO logbook;
INSERT INTO rower(rower_id, logbook_id) SELECT shipmaster, id FROM logbook;
-- tmp ergo challenge stuff
ALTER TABLE user ADD COLUMN dob text;
ALTER TABLE user ADD COLUMN weight text;
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';

View File

@ -76,7 +76,7 @@
{% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %} {% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %}
{#{% if not amount_seats or amount_seats > 1 %}#} {#{% if not amount_seats or amount_seats > 1 %}#}
<div class="{{ class }}"> <div class="{{ class }}">
<label for="{{id}}" class="text-sm text-gray-600 ">Ruderer</label> <label for="{{id}}" class="text-sm text-gray-600 ">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}}> <select style="width: 100%;" multiple name="rowers[]" id="{{id}}" class="w-full" data-seats="{{amount_seats}}" data-init={{init}}>
{% for user in users %} {% for user in users %}
{% set_global sel = false %} {% set_global sel = false %}