fix redirect #157
@ -64,31 +64,31 @@ async fn join(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
Flash::success(Redirect::to("/"), "Erfolgreich angemeldet!")
|
Flash::success(Redirect::to("/planned"), "Erfolgreich angemeldet!")
|
||||||
}
|
}
|
||||||
Err(UserTripError::EventAlreadyFull) => {
|
Err(UserTripError::EventAlreadyFull) => {
|
||||||
Flash::error(Redirect::to("/"), "Event bereits ausgebucht!")
|
Flash::error(Redirect::to("/planned"), "Event bereits ausgebucht!")
|
||||||
}
|
}
|
||||||
Err(UserTripError::AlreadyRegistered) => {
|
Err(UserTripError::AlreadyRegistered) => {
|
||||||
Flash::error(Redirect::to("/"), "Du nimmst bereits teil!")
|
Flash::error(Redirect::to("/planned"), "Du nimmst bereits teil!")
|
||||||
}
|
}
|
||||||
Err(UserTripError::AlreadyRegisteredAsCox) => {
|
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(
|
Err(UserTripError::CantRegisterAtOwnEvent) => Flash::error(
|
||||||
Redirect::to("/"),
|
Redirect::to("/planned"),
|
||||||
"Du kannst bei einer selbst ausgeschriebenen Fahrt nicht mitrudern ;)",
|
"Du kannst bei einer selbst ausgeschriebenen Fahrt nicht mitrudern ;)",
|
||||||
),
|
),
|
||||||
Err(UserTripError::GuestNotAllowedForThisEvent) => Flash::error(
|
Err(UserTripError::GuestNotAllowedForThisEvent) => Flash::error(
|
||||||
Redirect::to("/"),
|
Redirect::to("/planned"),
|
||||||
"Bei dieser Ausfahrt können leider keine Gäste mitfahren.",
|
"Bei dieser Ausfahrt können leider keine Gäste mitfahren.",
|
||||||
),
|
),
|
||||||
Err(UserTripError::NotAllowedToAddGuest) => Flash::error(
|
Err(UserTripError::NotAllowedToAddGuest) => Flash::error(
|
||||||
Redirect::to("/"),
|
Redirect::to("/planned"),
|
||||||
"Du darfst keine Gäste hinzufügen.",
|
"Du darfst keine Gäste hinzufügen.",
|
||||||
),
|
),
|
||||||
Err(UserTripError::DetailsLocked) => Flash::error(
|
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.",
|
"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 user: User = user.into();
|
||||||
|
|
||||||
let Some(trip_details) = TripDetails::find_by_id(db, trip_details_id).await else {
|
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 {
|
match UserTrip::delete(db, &user, &trip_details, Some(name)).await {
|
||||||
@ -118,7 +118,7 @@ async fn remove_guest(
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
Flash::success(Redirect::to("/"), "Erfolgreich abgemeldet!")
|
Flash::success(Redirect::to("/planned"), "Erfolgreich abgemeldet!")
|
||||||
}
|
}
|
||||||
Err(UserTripDeleteError::DetailsLocked) => {
|
Err(UserTripDeleteError::DetailsLocked) => {
|
||||||
Log::create(
|
Log::create(
|
||||||
@ -130,13 +130,13 @@ async fn remove_guest(
|
|||||||
)
|
)
|
||||||
.await;
|
.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) => {
|
Err(UserTripDeleteError::GuestNotParticipating) => {
|
||||||
Flash::error(Redirect::to("/"), "Gast nicht angemeldet.")
|
Flash::error(Redirect::to("/planned"), "Gast nicht angemeldet.")
|
||||||
}
|
}
|
||||||
Err(UserTripDeleteError::NotAllowedToDeleteGuest) => Flash::error(
|
Err(UserTripDeleteError::NotAllowedToDeleteGuest) => Flash::error(
|
||||||
Redirect::to("/"),
|
Redirect::to("/planned"),
|
||||||
"Keine Berechtigung um den Gast zu entfernen.",
|
"Keine Berechtigung um den Gast zu entfernen.",
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ async fn remove(
|
|||||||
let user: User = user.into();
|
let user: User = user.into();
|
||||||
|
|
||||||
let Some(trip_details) = TripDetails::find_by_id(db, trip_details_id).await else {
|
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 {
|
match UserTrip::delete(db, &user, &trip_details, None).await {
|
||||||
@ -165,7 +165,7 @@ async fn remove(
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
Flash::success(Redirect::to("/"), "Erfolgreich abgemeldet!")
|
Flash::success(Redirect::to("/planned"), "Erfolgreich abgemeldet!")
|
||||||
}
|
}
|
||||||
Err(UserTripDeleteError::DetailsLocked) => {
|
Err(UserTripDeleteError::DetailsLocked) => {
|
||||||
Log::create(
|
Log::create(
|
||||||
@ -177,7 +177,7 @@ async fn remove(
|
|||||||
)
|
)
|
||||||
.await;
|
.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(_) => {
|
Err(_) => {
|
||||||
panic!("Not possible to be here");
|
panic!("Not possible to be here");
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
{# --- END List Rowers --- #}
|
{# --- END List Rowers --- #}
|
||||||
|
|
||||||
{% if "admin" in loggedin_user.roles %}
|
{% 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) }}
|
{{ 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"/>
|
<input value="Gast hinzufügen" class="btn btn-primary w-full rounded-t-none-important" type="submit"/>
|
||||||
</form>
|
</form>
|
||||||
@ -198,10 +198,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if cur_user_participates %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false%}
|
{% 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 %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -215,7 +215,7 @@
|
|||||||
{% set amount_cur_rower = trip.rower | length %}
|
{% 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) }}
|
{{ 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 %}
|
{% 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) }}
|
{{ 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"/>
|
<input value="Gast hinzufügen" class="btn btn-primary w-full rounded-t-none-important" type="submit"/>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user