Compare commits
No commits in common. "ec4068e499838170b087863784761d3ae559e168" and "df1a06531f84e2b2a463686d1b972a608a8c312a" have entirely different histories.
ec4068e499
...
df1a06531f
@ -360,23 +360,21 @@ WHERE trip_details.id=?
|
||||
event.day.replace('-', ""),
|
||||
event.planned_starting_time.replace(':', "")
|
||||
)));
|
||||
let tripdetails = event.trip_details(db).await;
|
||||
let mut name = String::new();
|
||||
if event.is_cancelled() {
|
||||
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("ABGESAGT! :-( ");
|
||||
}
|
||||
name.push_str(&format!("{} ", event.name));
|
||||
|
||||
let tripdetails = event.trip_details(db).await;
|
||||
if let Some(triptype) = tripdetails.triptype(db).await {
|
||||
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));
|
||||
calendar.add_event(vevent);
|
||||
}
|
||||
@ -436,6 +434,6 @@ mod test {
|
||||
let pool = testdb!();
|
||||
|
||||
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 \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 (trip_details for a planned event) \r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", actual);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user