Compare commits

..

4 Commits

Author SHA1 Message Date
ec4068e499 Merge pull request 'cleaner cal' (#578) from cleaner-cal into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 9m0s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 5m47s
Reviewed-on: #578
2024-06-06 17:22:14 +02:00
fca19745f8 even nicer cal entries
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
2024-06-06 17:21:55 +02:00
bb48ddb3de fix ci
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-06-06 17:17:40 +02:00
34b098fa2a cleaner cal
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-06-06 17:16:47 +02:00

View File

@ -360,21 +360,23 @@ WHERE trip_details.id=?
event.day.replace('-', ""), event.day.replace('-', ""),
event.planned_starting_time.replace(':', "") event.planned_starting_time.replace(':', "")
))); )));
let tripdetails = event.trip_details(db).await;
let mut name = String::new(); let mut name = String::new();
if event.is_cancelled() { if event.is_cancelled() {
name.push_str("ABGESAGT! :-( "); name.push_str("ABGESAGT");
if let Some(notes) = &tripdetails.notes {
if !notes.is_empty() {
name.push_str(&format!(" (Grund: {notes})"))
}
}
name.push_str("! :-( ");
} }
name.push_str(&format!("{} ", event.name)); name.push_str(&format!("{} ", event.name));
let tripdetails = event.trip_details(db).await;
if let Some(triptype) = tripdetails.triptype(db).await { if let Some(triptype) = tripdetails.triptype(db).await {
name.push_str(&format!("{} ", triptype.name)) name.push_str(&format!("{} ", triptype.name))
} }
if let Some(notes) = tripdetails.notes {
if !notes.is_empty() {
name.push_str(&format!("({notes}) "))
}
}
vevent.push(Summary::new(name)); vevent.push(Summary::new(name));
calendar.add_event(vevent); calendar.add_event(vevent);
} }
@ -434,6 +436,6 @@ mod test {
let pool = testdb!(); let pool = testdb!();
let actual = Event::get_ics_feed(&pool).await; let actual = Event::get_ics_feed(&pool).await;
assert_eq!("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:ics-rs\r\nBEGIN:VEVENT\r\nUID:1@rudernlinz.at\r\nDTSTAMP:19900101T180000\r\nDTSTART:19700101T100000\r\nSUMMARY:test-planned-event (trip_details for a planned event) \r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", actual); assert_eq!("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:ics-rs\r\nBEGIN:VEVENT\r\nUID:1@rudernlinz.at\r\nDTSTAMP:19900101T180000\r\nDTSTART:19700101T100000\r\nSUMMARY:test-planned-event \r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", actual);
} }
} }