Compare commits

..

3 Commits

Author SHA1 Message Date
1da9412904 Merge pull request '[BUGFIX] mobile version calendar integration start page' (#738) from fix-calender into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m9s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 8m45s
Reviewed-on: #738
2024-09-11 11:43:33 +02:00
8666b014f2 also show own trips
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
2024-09-11 11:42:59 +02:00
Marie Birner
af8637d2b7 [BUGFIX] mobile version calendar integration start page
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m5s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2024-09-11 11:21:14 +02:00
3 changed files with 13 additions and 6 deletions

View File

@ -19,7 +19,7 @@ pub(crate) async fn get_personal_cal(db: &SqlitePool, user: &User) -> String {
let trips = Trip::all_with_user(db, user).await; let trips = Trip::all_with_user(db, user).await;
for trip in trips { for trip in trips {
calendar.add_event(trip.get_vevent(db).await); calendar.add_event(trip.get_vevent(user).await);
} }
let mut buf = Vec::new(); let mut buf = Vec::new();
write!(&mut buf, "{}", calendar).unwrap(); write!(&mut buf, "{}", calendar).unwrap();

View File

@ -125,7 +125,7 @@ WHERE trip_details.id=?
.ok() .ok()
} }
pub(crate) async fn get_vevent(self, db: &SqlitePool) -> ics::Event { pub(crate) async fn get_vevent(self, user: &User) -> ics::Event {
let mut vevent = ics::Event::new(format!("{}@rudernlinz.at", self.id), "19900101T180000"); let mut vevent = ics::Event::new(format!("{}@rudernlinz.at", self.id), "19900101T180000");
vevent.push(DtStart::new(format!( vevent.push(DtStart::new(format!(
"{}T{}00", "{}T{}00",
@ -143,7 +143,11 @@ WHERE trip_details.id=?
name.push_str("! :-( "); name.push_str("! :-( ");
} }
name.push_str(&format!("Ruderausfahrt mit {} ", self.cox_name)); if self.cox_id == user.id {
name.push_str("Ruderausfahrt (selber ausgeschrieben)");
} else {
name.push_str(&format!("Ruderausfahrt mit {} ", self.cox_name));
}
vevent.push(Summary::new(name)); vevent.push(Summary::new(name));
vevent vevent
@ -168,6 +172,9 @@ INNER JOIN user ON trip.cox_id = user.id
let mut ret = Vec::new(); let mut ret = Vec::new();
let trips = Self::all(db).await; let trips = Self::all(db).await;
for trip in trips { for trip in trips {
if user.id == trip.cox_id {
ret.push(trip.clone());
}
if let Some(trip_details_id) = trip.trip_details_id { if let Some(trip_details_id) = trip.trip_details_id {
if UserTrip::find_by_userid_and_trip_detail_id(db, user.id, trip_details_id) if UserTrip::find_by_userid_and_trip_detail_id(db, user.id, trip_details_id)
.await .await

View File

@ -224,16 +224,16 @@
</p> </p>
<ol class="list-decimal ml-5 my-3"> <ol class="list-decimal ml-5 my-3">
<li> <li>
<strong>Alle Events und Ausfahrten</strong>, zu denen du dich angemeldet hast: <a class="underline" <strong>Alle Events und Ausfahrten</strong>, zu denen du dich angemeldet hast: <a class="underline break-all"
href="https://app.rudernlinz.at/cal/personal/{{ loggedin_user.id }}/{{ loggedin_user.user_token }}">https://app.rudernlinz.at/cal/personal/{{ loggedin_user.id }}/{{ loggedin_user.user_token }}</a> href="https://app.rudernlinz.at/cal/personal/{{ loggedin_user.id }}/{{ loggedin_user.user_token }}">https://app.rudernlinz.at/cal/personal/{{ loggedin_user.id }}/{{ loggedin_user.user_token }}</a>
<br /> <br />
<small>Dieser Link enthält einen zufällig generierten Teil, damit nur du (und jene, denen du diesen Link weitergibst) Zugang zu diesen Daten hast.</small> <small>Dieser Link enthält einen zufällig generierten Teil, damit nur du (und jene, denen du diesen Link weitergibst) Zugang zu diesen Daten hast.</small>
</li> </li>
<li> <li>
<strong>Allgemeiner Kalender</strong>, zB save-the-dates (Wanderfahrten, ...): <a href="https://rudernlinz.at/cal" class="underline">https://rudernlinz.at/cal</a> <strong>Allgemeiner Kalender</strong>, zB save-the-dates (Wanderfahrten, ...): <a href="https://rudernlinz.at/cal" class="break-all underline">https://rudernlinz.at/cal</a>
</li> </li>
<li> <li>
<strong>Alle Events</strong>: <a class="underline" href="https://app.rudernlinz.at/cal">https://app.rudernlinz.at/cal</a> <strong>Alle Events</strong>: <a class="break-all underline" href="https://app.rudernlinz.at/cal">https://app.rudernlinz.at/cal</a>
<br /> <br />
<small>Beachte, dass dieser Kalender keine Ausfahrten enthält, die von einzelnen Steuerpersonen augeschrieben werden. Dieser Kalender wird zB auf <a href="https://rudernlinz.at/termine" class="underline">https://rudernlinz.at/termine</a> verwendet und wir möchten keine persönlichen Daten (Namen etc.) leaken.</small> <small>Beachte, dass dieser Kalender keine Ausfahrten enthält, die von einzelnen Steuerpersonen augeschrieben werden. Dieser Kalender wird zB auf <a href="https://rudernlinz.at/termine" class="underline">https://rudernlinz.at/termine</a> verwendet und wir möchten keine persönlichen Daten (Namen etc.) leaken.</small>
</li> </li>