fix redirect
This commit is contained in:
		| @@ -64,31 +64,31 @@ async fn join( | ||||
|                 ), | ||||
|             ) | ||||
|             .await; | ||||
|             Flash::success(Redirect::to("/"), "Erfolgreich angemeldet!") | ||||
|             Flash::success(Redirect::to("/planned"), "Erfolgreich angemeldet!") | ||||
|         } | ||||
|         Err(UserTripError::EventAlreadyFull) => { | ||||
|             Flash::error(Redirect::to("/"), "Event bereits ausgebucht!") | ||||
|             Flash::error(Redirect::to("/planned"), "Event bereits ausgebucht!") | ||||
|         } | ||||
|         Err(UserTripError::AlreadyRegistered) => { | ||||
|             Flash::error(Redirect::to("/"), "Du nimmst bereits teil!") | ||||
|             Flash::error(Redirect::to("/planned"), "Du nimmst bereits teil!") | ||||
|         } | ||||
|         Err(UserTripError::AlreadyRegisteredAsCox) => { | ||||
|             Flash::error(Redirect::to("/"), "Du hilfst bereits als Steuerperson aus!") | ||||
|             Flash::error(Redirect::to("/planned"), "Du hilfst bereits als Steuerperson aus!") | ||||
|         } | ||||
|         Err(UserTripError::CantRegisterAtOwnEvent) => Flash::error( | ||||
|             Redirect::to("/"), | ||||
|             Redirect::to("/planned"), | ||||
|             "Du kannst bei einer selbst ausgeschriebenen Fahrt nicht mitrudern ;)", | ||||
|         ), | ||||
|         Err(UserTripError::GuestNotAllowedForThisEvent) => Flash::error( | ||||
|             Redirect::to("/"), | ||||
|             Redirect::to("/planned"), | ||||
|             "Bei dieser Ausfahrt können leider keine Gäste mitfahren.", | ||||
|         ), | ||||
|         Err(UserTripError::NotAllowedToAddGuest) => Flash::error( | ||||
|             Redirect::to("/"), | ||||
|             Redirect::to("/planned"), | ||||
|             "Du darfst keine Gäste hinzufügen.", | ||||
|         ), | ||||
|         Err(UserTripError::DetailsLocked) => Flash::error( | ||||
|             Redirect::to("/"), | ||||
|             Redirect::to("/planned"), | ||||
|             "Das Boot ist bereits eingeteilt. Bitte kontaktiere den Schiffsführer (Nummern siehe Signalgruppe) falls du dich doch abmelden willst.", | ||||
|         ), | ||||
|     } | ||||
| @@ -104,7 +104,7 @@ async fn remove_guest( | ||||
|     let user: User = user.into(); | ||||
|  | ||||
|     let Some(trip_details) = TripDetails::find_by_id(db, trip_details_id).await else { | ||||
|         return Flash::error(Redirect::to("/"), "TripDetailsId does not exist"); | ||||
|         return Flash::error(Redirect::to("/planned"), "TripDetailsId does not exist"); | ||||
|     }; | ||||
|  | ||||
|     match UserTrip::delete(db, &user, &trip_details, Some(name)).await { | ||||
| @@ -118,7 +118,7 @@ async fn remove_guest( | ||||
|             ) | ||||
|             .await; | ||||
|  | ||||
|             Flash::success(Redirect::to("/"), "Erfolgreich abgemeldet!") | ||||
|             Flash::success(Redirect::to("/planned"), "Erfolgreich abgemeldet!") | ||||
|         } | ||||
|         Err(UserTripDeleteError::DetailsLocked) => { | ||||
|             Log::create( | ||||
| @@ -130,13 +130,13 @@ async fn remove_guest( | ||||
|             ) | ||||
|             .await; | ||||
|  | ||||
|             Flash::error(Redirect::to("/"), "Das Boot ist bereits eingeteilt. Bitte kontaktiere den Schiffsführer (Nummern siehe Signalgruppe) falls du dich doch abmelden willst.") | ||||
|             Flash::error(Redirect::to("/planned"), "Das Boot ist bereits eingeteilt. Bitte kontaktiere den Schiffsführer (Nummern siehe Signalgruppe) falls du dich doch abmelden willst.") | ||||
|         } | ||||
|         Err(UserTripDeleteError::GuestNotParticipating) => { | ||||
|             Flash::error(Redirect::to("/"), "Gast nicht angemeldet.") | ||||
|             Flash::error(Redirect::to("/planned"), "Gast nicht angemeldet.") | ||||
|         } | ||||
|         Err(UserTripDeleteError::NotAllowedToDeleteGuest) => Flash::error( | ||||
|             Redirect::to("/"), | ||||
|             Redirect::to("/planned"), | ||||
|             "Keine Berechtigung um den Gast zu entfernen.", | ||||
|         ), | ||||
|     } | ||||
| @@ -151,7 +151,7 @@ async fn remove( | ||||
|     let user: User = user.into(); | ||||
|  | ||||
|     let Some(trip_details) = TripDetails::find_by_id(db, trip_details_id).await else { | ||||
|         return Flash::error(Redirect::to("/"), "TripDetailsId does not exist"); | ||||
|         return Flash::error(Redirect::to("/planned"), "TripDetailsId does not exist"); | ||||
|     }; | ||||
|  | ||||
|     match UserTrip::delete(db, &user, &trip_details, None).await { | ||||
| @@ -165,7 +165,7 @@ async fn remove( | ||||
|             ) | ||||
|             .await; | ||||
|  | ||||
|             Flash::success(Redirect::to("/"), "Erfolgreich abgemeldet!") | ||||
|             Flash::success(Redirect::to("/planned"), "Erfolgreich abgemeldet!") | ||||
|         } | ||||
|         Err(UserTripDeleteError::DetailsLocked) => { | ||||
|             Log::create( | ||||
| @@ -177,7 +177,7 @@ async fn remove( | ||||
|             ) | ||||
|             .await; | ||||
|  | ||||
|             Flash::error(Redirect::to("/"), "Das Boot ist bereits eingeteilt. Bitte kontaktiere den Schiffsführer (Nummern siehe Signalgruppe) falls du dich doch abmelden willst.") | ||||
|             Flash::error(Redirect::to("/planned"), "Das Boot ist bereits eingeteilt. Bitte kontaktiere den Schiffsführer (Nummern siehe Signalgruppe) falls du dich doch abmelden willst.") | ||||
|         } | ||||
|         Err(_) => { | ||||
|             panic!("Not possible to be here"); | ||||
|   | ||||
| @@ -116,7 +116,7 @@ | ||||
| 												{# --- END List Rowers --- #} | ||||
|  | ||||
| 													{% if "admin" in loggedin_user.roles %} | ||||
| 														<form action="/join/{{ planned_event.trip_details_id }}" method="get" /> | ||||
| 														<form action="/planned/join/{{ planned_event.trip_details_id }}" method="get" /> | ||||
| 															{{ macros::input(label='Gast', class="input rounded-t", name='user_note', type='text', required=true) }} | ||||
| 															<input value="Gast hinzufügen" class="btn btn-primary w-full rounded-t-none-important" type="submit"/> | ||||
| 														</form> | ||||
| @@ -198,10 +198,10 @@ | ||||
| 													{% endif %} | ||||
| 												{% endfor %} | ||||
| 												{% if cur_user_participates %} | ||||
| 													<a href="/remove/{{ trip.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a> | ||||
| 													<a href="/planned/remove/{{ trip.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a> | ||||
| 												{% endif %} | ||||
| 												{% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false%} | ||||
| 													<a href="/join/{{ trip.trip_details_id }}" class="btn btn-primary btn-fw" {% if trip.trip_type %} onclick="return confirm('{{ trip.trip_type.question  }}');" {% endif %}>Mitrudern</a> | ||||
| 													<a href="/planned/join/{{ trip.trip_details_id }}" class="btn btn-primary btn-fw" {% if trip.trip_type %} onclick="return confirm('{{ trip.trip_type.question  }}');" {% endif %}>Mitrudern</a> | ||||
| 												{% endif %} | ||||
| 											</div> | ||||
| 										</div> | ||||
| @@ -215,7 +215,7 @@ | ||||
| 													{% set amount_cur_rower = trip.rower | length %} | ||||
| 													{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black', trip_details_id=trip.trip_details_id, allow_removing=loggedin_user.id == trip.cox_id) }} | ||||
| 													{% if trip.cox_id == loggedin_user.id %} | ||||
| 														<form action="/join/{{ trip.trip_details_id }}" method="get" /> | ||||
| 														<form action="/planned/join/{{ trip.trip_details_id }}" method="get" /> | ||||
| 															{{ macros::input(label='Gast', class="input rounded-t", name='user_note', type='text', required=true) }} | ||||
| 															<input value="Gast hinzufügen" class="btn btn-primary w-full rounded-t-none-important" type="submit"/> | ||||
| 														</form> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user