remove unnecessarily complex localization for the sake of simplicity
Some checks failed
CI/CD Pipeline / test (push) Failing after 4m40s
CI/CD Pipeline / deploy (push) Has been skipped

This commit is contained in:
Philipp Hofer 2025-04-24 15:36:54 +02:00
parent d2f49aff1a
commit 5ef862c040
4 changed files with 40 additions and 123 deletions

View File

@ -26,6 +26,8 @@ station_info: "Schön, dass du uns als Stationsbetreuer hilfst."
info_crewless_station: "Wenn das eine unbemannte Station ist, wähle hier 0 Personen aus. Dann werden dieser Station keine Startteams zugeteilt und es wird kein PDF generiert." info_crewless_station: "Wenn das eine unbemannte Station ist, wähle hier 0 Personen aus. Dann werden dieser Station keine Startteams zugeteilt und es wird kein PDF generiert."
time: "Uhrzeit" time: "Uhrzeit"
google_maps_navigation: "Google Maps Navigation..." google_maps_navigation: "Google Maps Navigation..."
highscore: "Highscore"
# #
# ###### # ######
@ -35,7 +37,8 @@ google_maps_navigation: "Google Maps Navigation..."
# # # # # ## # # ##### # # # # # # # ### # # # # # ## # # ##### # # # # # # # ###
# # # # ## ## # # # # # # # ## # # # # # # ## ## # # # # # # # ## # #
# ###### ###### # # ###### # # # #### # # #### # ###### ###### # # ###### # # # #### # # ####
# #
ratings: "Bewertungen" ratings: "Bewertungen"
rate_crewless_stations: "Unbemannte Stationen bewerten" rate_crewless_stations: "Unbemannte Stationen bewerten"
invalid_rating_code: "Falscher Quick-Login-Link. Bitte nochmal scannen oder neu eingeben." invalid_rating_code: "Falscher Quick-Login-Link. Bitte nochmal scannen oder neu eingeben."
@ -56,10 +59,7 @@ points: "Punkte"
confirm_rating_change: "Du hast die Gruppe bereits bewertet. Bist du sicher, dass du deine Bewertung nochmal ändern möchtest?" confirm_rating_change: "Du hast die Gruppe bereits bewertet. Bist du sicher, dass du deine Bewertung nochmal ändern möchtest?"
no_teams_rated_yet: "Du hast bisher noch keine Teams bewertet." no_teams_rated_yet: "Du hast bisher noch keine Teams bewertet."
succ_change: "Erfolgreich geändert" succ_change: "Erfolgreich geändert"
cant_add_nonexisting_team_to_waiting: "Konnte das Team der Warteschlange nicht hinzufügen, weil ein Team mit ID %{id} nicht existiert"
cant_add_team_to_waiting_not_in_your_route: "Konnte das Team %{team} der Warteschlange nicht hinzufügen, weil das Team nicht zu deiner Station kommen soll." cant_add_team_to_waiting_not_in_your_route: "Konnte das Team %{team} der Warteschlange nicht hinzufügen, weil das Team nicht zu deiner Station kommen soll."
cant_add_nonexisting_team_to_active: "Das Team kann nicht starten, weil ein Team mit ID %{id} nicht existiert"
cant_add_nonexisting_team_to_finished: "Das Team kann nicht beenden, weil ein Team mit ID %{id} nicht existiert"
team_added_to_waiting: "Team %{team} wurde der Warteschlange hinzugefügt." team_added_to_waiting: "Team %{team} wurde der Warteschlange hinzugefügt."
team_added_to_active: "Team %{team} performt aktuell bei deiner Station." team_added_to_active: "Team %{team} performt aktuell bei deiner Station."
team_added_to_finished: "Team %{team} erfolgreich beendet." team_added_to_finished: "Team %{team} erfolgreich beendet."
@ -67,22 +67,15 @@ team_removed_from_waiting: "Team %{team} wurde von der Warteschlange entfernt."
team_removed_from_active: "Team %{team} performt doch nicht bei dir." team_removed_from_active: "Team %{team} performt doch nicht bei dir."
team_removed_from_finished: "Team %{team} arbeitet wieder an deiner Station." team_removed_from_finished: "Team %{team} arbeitet wieder an deiner Station."
rating_updated: "Bewertung für Team %{team} wurde aktualisiert." rating_updated: "Bewertung für Team %{team} wurde aktualisiert."
cant_remove_nonexisting_team_from_waiting: "Konnte das Team nicht von der Warteschlange entfernen, weil ein Team mit ID %{id} nicht existiert"
cant_remove_nonexisting_team_from_active: "Konnte das Team nicht von deiner Station entfernen, weil ein Team mit ID %{id} nicht existiert"
cant_remove_nonexisting_team_from_finished: "Konnte das Team nicht von deinen Bewertungen entfernen, weil ein Team mit ID %{id} nicht existiert"
cant_remove_team_from_waiting_not_there: "Konnte das Team %{team} nicht von der Warteschlange entfernen, weil es nicht in der Warteschlange ist." cant_remove_team_from_waiting_not_there: "Konnte das Team %{team} nicht von der Warteschlange entfernen, weil es nicht in der Warteschlange ist."
team_cant_start_not_in_waiting: "Team %{team} kann nicht starten, weil es nicht in der Warteschlange ist." team_cant_start_not_in_waiting: "Team %{team} kann nicht starten, weil es nicht in der Warteschlange ist."
team_cant_finish_not_in_active: "Team %{team} kann nicht beenden, weil es nicht arbeitet." team_cant_finish_not_in_active: "Team %{team} kann nicht beenden, weil es nicht arbeitet."
team_removal_active_not_possible_not_there: "Team %{team} kann nicht von der Startliste gelöscht werden, weil es dort gar nicht ist." team_removal_active_not_possible_not_there: "Team %{team} kann nicht von der Startliste gelöscht werden, weil es dort gar nicht ist."
team_removal_left_not_possible_not_there: "Team %{team} kann nicht von der Bewertungsliste gelöscht werden, weil es dort gar nicht ist." team_removal_left_not_possible_not_there: "Team %{team} kann nicht von der Bewertungsliste gelöscht werden, weil es dort gar nicht ist."
cant_update_nonexisting_team: "Konnte die Teambewertung nicht aktualisieren, weil ein Team mit ID %{id} nicht existiert"
can_only_update_ratings_for_teams_which_were_at_your_station: "Es können nur Teams bewertet werden, die zumindest schon bei der Station sind." can_only_update_ratings_for_teams_which_were_at_your_station: "Es können nur Teams bewertet werden, die zumindest schon bei der Station sind."
teams_at_your_station: "Teams bei dir" teams_at_your_station: "Teams bei dir"
to_rate: "Noch zu bewerten" to_rate: "Noch zu bewerten"
history: "Was bisher geschah" history: "Was bisher geschah"
state_active: "Aktiv" state_active: "Aktiv"
state_active_icon: "🎬" state_active_icon: "🎬"
state_waiting: "Wartend" state_waiting: "Wartend"
@ -91,14 +84,11 @@ state_to_rate: "Zu bewerten"
state_to_rate_icon: "☐" state_to_rate_icon: "☐"
state_rated: "Schon bewertet" state_rated: "Schon bewertet"
state_rated_icon: "✅" state_rated_icon: "✅"
since_time: "seit %{time}" since_time: "seit %{time}"
left_at: "um %{time} gegangen" left_at: "um %{time} gegangen"
arrived_at_started_at_left_at: "um %{arrived} eingetroffen, um %{active} gestarted und um %{left} gegangen" arrived_at_started_at_left_at: "um %{arrived} eingetroffen, um %{active} gestarted und um %{left} gegangen"
team_finished: "Team fertig" team_finished: "Team fertig"
team_starting: "Team startet" team_starting: "Team startet"
notes: "Notizen" notes: "Notizen"
save_notes: "Notizen speichern" save_notes: "Notizen speichern"
confirm_station_cancel_team_active: "Bist du sicher, dass das Team %{team} noch nicht bei dir arbeitet? Das Team wird zurück auf die Warte-Position gesetzt" confirm_station_cancel_team_active: "Bist du sicher, dass das Team %{team} noch nicht bei dir arbeitet? Das Team wird zurück auf die Warte-Position gesetzt"
@ -106,7 +96,6 @@ confirm_station_cancel_team_waiting: "Bist du sicher, dass das Team %{team} noch
confirm_station_cancel_team_finished: "Bist du sicher, dass das Team noch nicht bei dir fertig ist? Das Team wird zurück auf die Arbeits-Position gesetzt." confirm_station_cancel_team_finished: "Bist du sicher, dass das Team noch nicht bei dir fertig ist? Das Team wird zurück auf die Arbeits-Position gesetzt."
# #
# ##### # #####
# # # ##### ## ##### # #### # # # # # ##### ## ##### # #### # #
@ -150,9 +139,6 @@ station_name: "Stationsname"
station_create_succ: "Station %{name} erfolgreich erstellt" station_create_succ: "Station %{name} erfolgreich erstellt"
station_create_err_duplicate_name: "Station %{name} konnte _NICHT_ erstellt werden, da es bereits eine Station mit diesem Namen gibt (%{err})!" station_create_err_duplicate_name: "Station %{name} konnte _NICHT_ erstellt werden, da es bereits eine Station mit diesem Namen gibt (%{err})!"
station_delete_succ: "Station %{name} erfolgreich gelöscht" station_delete_succ: "Station %{name} erfolgreich gelöscht"
station_open_err_nonexisting: "Station mit ID %{id} konnte nicht geöffnet werden, da sie nicht existiert"
station_edit_err_nonexisting: "Station mit ID %{id} konnte nicht bearbeitet werden, da sie nicht existiert"
station_delete_err_nonexisting: "Station mit ID %{id} konnte nicht gelöscht werden, da sie nicht existiert"
station_delete_err_already_used: "Station %{name} konnte nicht gelöscht werden, da sie bereits verwendet wird (%{err})" station_delete_err_already_used: "Station %{name} konnte nicht gelöscht werden, da sie bereits verwendet wird (%{err})"
station_has_not_rated_team_yet: "Station hat Team noch nicht bewertet" # should be short -> tooltip station_has_not_rated_team_yet: "Station hat Team noch nicht bewertet" # should be short -> tooltip
station_move_up: "%{name} nach vor reihen" # should be short -> tooltip station_move_up: "%{name} nach vor reihen" # should be short -> tooltip
@ -175,9 +161,9 @@ first_station_expl: "Die erste Station wird beim Anlegen eines Team automatisch
new_team_name: "Team %{old} heißt ab sofort %{new}" new_team_name: "Team %{old} heißt ab sofort %{new}"
notes_edited: "Notizen für das Team %{team} erfolgreich geändert" notes_edited: "Notizen für das Team %{team} erfolgreich geändert"
amount_teammembers_edited: "Anzahl an Mitglieder für das Team %{team} erfolgreich geändert" amount_teammembers_edited: "Anzahl an Mitglieder für das Team %{team} erfolgreich geändert"
no_team_to_take_home: "Du musst keine Teams mit heim nehmen" no_team_to_take_home: "Du musst keine Teams mit zurück nehmen"
take_home_the_following_team: "Bitte nimm das folgende Team mit heim:" take_home_the_following_team: "Bitte nimm das folgende Team mit zurück:"
take_home_the_following_teams: "Bitte nimm folgende Teams mit heim:" take_home_the_following_teams: "Bitte nimm folgende Teams mit zurück:"
# #
@ -189,6 +175,7 @@ take_home_the_following_teams: "Bitte nimm folgende Teams mit heim:"
# # # # # # # # # # # # # #
# # ###### # # # # # # ###### # # # #
# #
team: "Team" team: "Team"
teams: "Teams" teams: "Teams"
teams_expl_without_first_word: "sind eine Menge an Personen, die verschiedene <a href='/admin/station'>Stationen</a> ablaufen. Welche Stationen, entscheidet sich je nachdem, welcher <a href='/admin/route'>Route</a> sie zugewiesen sind." teams_expl_without_first_word: "sind eine Menge an Personen, die verschiedene <a href='/admin/station'>Stationen</a> ablaufen. Welche Stationen, entscheidet sich je nachdem, welcher <a href='/admin/route'>Route</a> sie zugewiesen sind."
@ -207,38 +194,25 @@ team_not_created_duplicate_name: "Team %{team} konnte nicht erstellt werden, da
team_not_created_no_station_in_route: "Team %{team} konnte nicht erstellt werden, da in der angegebenen Route %{route} keine Station vorkommt und daher die Startstation nicht festgelegt werden kann." team_not_created_no_station_in_route: "Team %{team} konnte nicht erstellt werden, da in der angegebenen Route %{route} keine Station vorkommt und daher die Startstation nicht festgelegt werden kann."
team_not_deleted_already_in_use: "Team %{team} kann nicht gelöscht werden, da es bereits verwendet wird. (%{err})" team_not_deleted_already_in_use: "Team %{team} kann nicht gelöscht werden, da es bereits verwendet wird. (%{err})"
amount_teammembers: "Anzahl Teammitglieder" amount_teammembers: "Anzahl Teammitglieder"
not_sure_about_amount_team: "Ich weiß noch nicht wv. Personen dieses Team beherbergt." not_sure_about_amount_team: "Ich weiß noch nicht wv. Personen dieses Team beherbergt :-)"
select_station: "Station auswählen" select_station: "Station auswählen"
already_has_1_start_team: "schon 1 Startteam" already_has_1_start_team: "schon 1 Startteam"
already_has_n_start_team: "schon %{amount} Startteams" already_has_n_start_team: "schon %{amount} Startteams"
last_station: "Letzte Station" last_station: "Letzte Station"
route_edited: "Team %{team} läuft ab sofort die Route %{route}. Auch die erste Station hat sich dadurch auf %{first_station} verändert" route_edited: "Team %{team} läuft ab sofort die Route %{route}. Auch die erste Station hat sich dadurch auf %{first_station} verändert!"
team_not_edited_route_has_no_stations: "Team %{team} kann nicht zur Route %{route} zugeteilt werden, da diese Route noch keine Station hat und daher die Startstation nicht festgelegt werden kann." team_not_edited_route_has_no_stations: "Team %{team} kann nicht zur Route %{route} zugeteilt werden, da diese Route noch keine Station hat und daher die Startstation nicht festgelegt werden kann."
first_station_not_edited_not_on_route: "Konnte Station %{station} nicht als erste Station dem Team %{team} zuteilen, weil dieses Team bei Route %{route} mitläuft und die Station nicht auf dieser Route liegt." first_station_not_edited_not_on_route: "Konnte Station %{station} nicht als erste Station dem Team %{team} zuteilen, weil dieses Team bei Route %{route} mitläuft und die Station nicht auf dieser Route liegt."
last_station_not_edited_not_on_route: "Konnte Station %{station} nicht als letzte Station dem Team %{team} zuteilen, weil dieses Team bei Route %{route} mitläuft und die Station nicht auf dieser Route liegt." last_station_not_edited_not_on_route: "Konnte Station %{station} nicht als letzte Station dem Team %{team} zuteilen, weil dieses Team bei Route %{route} mitläuft und die Station nicht auf dieser Route liegt."
changed_first_station: "Erste Station des Teams %{team} ist ab sofort Station %{station}" changed_first_station: "Erste Station des Teams %{team} ist ab sofort die Station %{station}"
changed_last_station: "Letzte Station des Teams %{team} ist ab sofort Station %{station}" changed_last_station: "Letzte Station des Teams %{team} ist ab sofort die Station %{station}"
last_contact_team: "Letzter Stationskontakt der Teams" last_contact_team: "Letzter Stationskontakt der Teams"
not_yet_seen: "Noch nicht gesehen" not_yet_seen: "Noch nicht gesehen"
no_teams: "Es gibt noch keine Teams." no_teams: "Es gibt noch keine Teams."
route_needed_before_creating_teams: "Bevor du ein Team erstellen kannst, musst du zumindest eine Route erstellen, die das Team gehen kann" route_needed_before_creating_teams: "Bevor du ein Team erstellen kannst, musst du zumindest eine Route erstellen, die das Team gehen kann."
have_i_lost_groups: "Hab ich eine Gruppe verloren? 😳" have_i_lost_groups: "Hab ich eine Gruppe verloren? 😳"
confirm_delete_team: "Bist du sicher, dass das Team gelöscht werden soll? Das kann _NICHT_ mehr rückgängig gemacht werden." confirm_delete_team: "Bist du sicher, dass das Team gelöscht werden soll? Das kann _NICHT_ mehr rückgängig gemacht werden."
#
# # #
# # # # #### # # #### #### #### ##### ######
# # # # # # # # # # # # # # # #
# ####### # # ###### #### # # # # # #####
# # # # # ### # # # # # # ##### #
# # # # # # # # # # # # # # # # #
# # # # #### # # #### #### #### # # ######
#
highscore: "Highscore"
# #
# # # #
# # # ##### # # # # # # # # ##### # # # # #
@ -259,7 +233,7 @@ pw_set: "Passwort erfolgreich gesetzt"
cant_delete_last_admin: "Du kannst den letzten Admin nicht löschen" cant_delete_last_admin: "Du kannst den letzten Admin nicht löschen"
user_created: "User %{name} erfolgreich erstellt" user_created: "User %{name} erfolgreich erstellt"
user_deleted: "User %{name} erfolgreich gelöscht" user_deleted: "User %{name} erfolgreich gelöscht"
user_delete_error_already_in_use: "User %{name} kann nicht gelöscht werden, da er/sie bereits verwendet wird. (%{err})" user_delete_error_already_in_use: "User %{name} kann nicht gelöscht werden, da der User bereits verwendet wird. (%{err})"
user_create_error: "User %{name} konnte nicht erstellt werden: %{err}" user_create_error: "User %{name} konnte nicht erstellt werden: %{err}"
nonexisting_user: "User mit ID %{id} existiert nicht." nonexisting_user: "User mit ID %{id} existiert nicht."
edit_username: "Username bearbeiten" edit_username: "Username bearbeiten"
@ -295,7 +269,6 @@ no_routes: "Es gibt noch keine Routen."
route_create_succ: "Route %{name} erfolgreich erstellt" route_create_succ: "Route %{name} erfolgreich erstellt"
route_create_err_duplicate_name: "Route %{name} konnte _NICHT_ erstellt werden, da es bereits eine Route mit diesem Namen gibt (%{err})!" route_create_err_duplicate_name: "Route %{name} konnte _NICHT_ erstellt werden, da es bereits eine Route mit diesem Namen gibt (%{err})!"
route_delete_succ: "Route %{name} erfolgreich gelöscht" route_delete_succ: "Route %{name} erfolgreich gelöscht"
route_delete_err_nonexisting: "Route mit ID %{id} konnte nicht gelöscht werden, da sie nicht existiert"
route_delete_err_already_used: "Route %{name} konnte nicht gelöscht werden, da sie bereits verwendet wird (%{err})" route_delete_err_already_used: "Route %{name} konnte nicht gelöscht werden, da sie bereits verwendet wird (%{err})"
cant_assign_station_to_route_because_no_stations_exist: "Bevor du einer Route Stationen zuweisen kannst, musst du die Stationen erstellen" cant_assign_station_to_route_because_no_stations_exist: "Bevor du einer Route Stationen zuweisen kannst, musst du die Stationen erstellen"
route_has_no_stations_yet: "Diese Route hat noch keine Stationen zugewiesen." route_has_no_stations_yet: "Diese Route hat noch keine Stationen zugewiesen."
@ -303,15 +276,10 @@ confirm_remove_station_from_route: "Bist du sicher, dass die Station von der Rou
select_station_to_add_to_route: "Hinzuzufügende Station auswählen" select_station_to_add_to_route: "Hinzuzufügende Station auswählen"
teams_with_this_route: "Teams mit dieser Route" teams_with_this_route: "Teams mit dieser Route"
no_team_with_this_route: "Noch kein Team ist dieser Route zugeteilt" no_team_with_this_route: "Noch kein Team ist dieser Route zugeteilt"
route_update_err_nonexisting: "Route mit ID %{id} konnte nicht bearbeitet werden, da sie nicht existiert"
route_new_name: "Route %{old} heißt ab sofort %{new}." route_new_name: "Route %{old} heißt ab sofort %{new}."
route_cant_add_nonexisting_station: "Station mit ID %{id} konnte nicht der Route %{route} hinzugefügt werden, da die Station nicht existiert"
station_added_to_route: "Station %{station} wurde erfolgreich der Route %{route} hinzugefügt" station_added_to_route: "Station %{station} wurde erfolgreich der Route %{route} hinzugefügt"
station_can_only_be_added_once_to_route: "Station %{station} kann nur 1x der Route %{route} hinzugefügt werden (%{err})" station_can_only_be_added_once_to_route: "Station %{station} kann nur 1x der Route %{route} hinzugefügt werden (%{err})"
cant_remove_station_from_nonexisting_route: "Konnte keine Station von der Route mit ID %{id} entfernen, da diese Route nicht existiert."
cant_remove_nonexisting_station_from_route: "Konnte Station mit der ID %{id} nicht von der Route %{route} entfernen, da die Station nicht existiert."
station_deleted_from_route: "Station %{station} wurde von der Route %{route} gelöscht" station_deleted_from_route: "Station %{station} wurde von der Route %{route} gelöscht"
cant_remove_station_from_route_if_not_included: "Station %{station} kann nicht von der Route %{route} gelöscht werden, da diese nicht auf der Route liegt." cant_remove_station_from_route_if_not_included: "Station %{station} kann nicht von der Route %{route} gelöscht werden, da diese nicht auf der Route liegt."
cant_move_nonexisting_station: "Konnte Station mit der ID %{id} nicht in der Route %{route} verschieben, da die Station nicht existiert."
station_succ_moved_in_route: "Station %{station} wurde in der Route %{route} erfolgreich vorgereiht" station_succ_moved_in_route: "Station %{station} wurde in der Route %{route} erfolgreich vorgereiht"
cant_move_station_in_route_if_not_included: "Station %{station} kann in der Route %{route} nicht vorgereiht werden, da diese nicht auf der Route liegt." cant_move_station_in_route_if_not_included: "Station %{station} kann in der Route %{route} nicht vorgereiht werden, da diese nicht auf der Route liegt."

View File

@ -87,7 +87,7 @@ async fn delete(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(route) = Route::find_by_id(&db, id).await else { let Some(route) = Route::find_by_id(&db, id).await else {
er!(session, t!("route_delete_err_nonexisting", id = id)); er!(session, t!("nonexisting_route", id = id));
return Redirect::to("/admin/route"); return Redirect::to("/admin/route");
}; };
@ -108,7 +108,7 @@ async fn view(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> Result<Markup, impl IntoResponse> { ) -> Result<Markup, impl IntoResponse> {
let Some(route) = Route::find_by_id(&db, id).await else { let Some(route) = Route::find_by_id(&db, id).await else {
er!(session, t!("route_delete_err_nonexisting", id = id)); er!(session, t!("nonexisting_route", id = id));
return Err(Redirect::to("/admin/route")); return Err(Redirect::to("/admin/route"));
}; };
@ -218,8 +218,7 @@ async fn update_name(
Form(form): Form<UpdateNameForm>, Form(form): Form<UpdateNameForm>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(route) = Route::find_by_id(&db, id).await else { let Some(route) = Route::find_by_id(&db, id).await else {
er!(session, t!("route_update_err_nonexisting", id = id)); er!(session, t!("nonexisting_route", id = id));
return Redirect::to("/admin/route"); return Redirect::to("/admin/route");
}; };
@ -244,20 +243,11 @@ async fn add_station(
Form(form): Form<AddStationForm>, Form(form): Form<AddStationForm>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(route) = Route::find_by_id(&db, id).await else { let Some(route) = Route::find_by_id(&db, id).await else {
er!(session, t!("route_update_err_nonexisting", id = id)); er!(session, t!("nonexisting_route", id = id));
return Redirect::to("/admin/route"); return Redirect::to("/admin/route");
}; };
let Some(station) = Station::find_by_id(&db, form.station).await else { let Some(station) = Station::find_by_id(&db, form.station).await else {
er!( er!(session, t!("nonexisting_station", id = form.station));
session,
t!(
"route_cant_add_nonexisting_station",
id = form.station,
route = route.name
)
);
return Redirect::to(&format!("/admin/route/{id}")); return Redirect::to(&format!("/admin/route/{id}"));
}; };
@ -290,23 +280,11 @@ async fn delete_station(
axum::extract::Path((route_id, station_id)): axum::extract::Path<(i64, i64)>, axum::extract::Path((route_id, station_id)): axum::extract::Path<(i64, i64)>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(route) = Route::find_by_id(&db, route_id).await else { let Some(route) = Route::find_by_id(&db, route_id).await else {
er!( er!(session, t!("nonexisting_route", id = id));
session,
t!("cant_remove_station_from_nonexisting_route", id = route_id)
);
return Redirect::to("/admin/route"); return Redirect::to("/admin/route");
}; };
let Some(station) = Station::find_by_id(&db, station_id).await else { let Some(station) = Station::find_by_id(&db, station_id).await else {
er!( er!(session, t!("nonexisting_station", id = station.id));
session,
t!(
"cant_remove_nonexisting_station_from_route",
id = station_id,
route = route.name
)
);
return Redirect::to(&format!("/admin/route/{route_id}")); return Redirect::to(&format!("/admin/route/{route_id}"));
}; };
@ -339,20 +317,11 @@ async fn move_station_higher(
axum::extract::Path((route_id, station_id)): axum::extract::Path<(i64, i64)>, axum::extract::Path((route_id, station_id)): axum::extract::Path<(i64, i64)>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(route) = Route::find_by_id(&db, route_id).await else { let Some(route) = Route::find_by_id(&db, route_id).await else {
er!(session, t!("route_update_err_nonexisting", id = route_id)); er!(session, t!("nonexisting_route", id = id));
return Redirect::to("/admin/route"); return Redirect::to("/admin/route");
}; };
let Some(station) = Station::find_by_id(&db, station_id).await else { let Some(station) = Station::find_by_id(&db, station_id).await else {
er!( er!(session, t!("nonexisting_station", id = station.id));
session,
t!(
"cant_move_nonexisting_station",
id = station_id,
route = route.name
)
);
return Redirect::to(&format!("/admin/route/{route_id}")); return Redirect::to(&format!("/admin/route/{route_id}"));
}; };

View File

@ -48,8 +48,7 @@ async fn delete(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_delete_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -74,8 +73,7 @@ async fn view(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> Result<Markup, impl IntoResponse> { ) -> Result<Markup, impl IntoResponse> {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_open_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Err(Redirect::to("/admin/station")); return Err(Redirect::to("/admin/station"));
}; };
@ -335,7 +333,7 @@ async fn update_name(
Form(form): Form<UpdateNameForm>, Form(form): Form<UpdateNameForm>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -360,7 +358,7 @@ async fn update_notes(
Form(form): Form<UpdateNotesForm>, Form(form): Form<UpdateNotesForm>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -382,7 +380,7 @@ async fn update_amount_people(
Form(form): Form<UpdateAmountPeopleForm>, Form(form): Form<UpdateAmountPeopleForm>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -402,7 +400,7 @@ async fn update_amount_people_reset(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -422,7 +420,7 @@ async fn quick(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> Result<Markup, impl IntoResponse> { ) -> Result<Markup, impl IntoResponse> {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Err(Redirect::to("/admin/station")); return Err(Redirect::to("/admin/station"));
}; };
@ -490,7 +488,7 @@ async fn quick_post(
Form(form): Form<QuickUpdate>, Form(form): Form<QuickUpdate>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -561,7 +559,7 @@ async fn update_location(
Form(form): Form<UpdateLocationForm>, Form(form): Form<UpdateLocationForm>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };
@ -578,7 +576,7 @@ async fn update_location_clear(
axum::extract::Path(id): axum::extract::Path<i64>, axum::extract::Path(id): axum::extract::Path<i64>,
) -> impl IntoResponse { ) -> impl IntoResponse {
let Some(station) = Station::find_by_id(&db, id).await else { let Some(station) = Station::find_by_id(&db, id).await else {
er!(session, t!("station_edit_err_nonexisting", id = id)); er!(session, t!("nonexisting_station", id = id));
return Redirect::to("/admin/station"); return Redirect::to("/admin/station");
}; };

View File

@ -381,10 +381,7 @@ async fn new_waiting(
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
let Some(team) = Team::find_by_id(&db, form.team_id).await else { let Some(team) = Team::find_by_id(&db, form.team_id).await else {
er!( er!(session, t!("nonexisting_team", id = form.team_id));
session,
t!("cant_add_nonexisting_team_to_waiting", id = form.team_id)
);
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
@ -407,10 +404,7 @@ async fn remove_waiting(
}; };
let Some(team) = Team::find_by_id(&db, team_id).await else { let Some(team) = Team::find_by_id(&db, team_id).await else {
er!( er!(session, t!("nonexisting_team", id = form.team_id));
session,
t!("cant_remove_nonexisting_team_from_waiting", id = team_id)
);
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
@ -433,10 +427,7 @@ async fn team_starting(
}; };
let Some(team) = Team::find_by_id(&db, team_id).await else { let Some(team) = Team::find_by_id(&db, team_id).await else {
er!( er!(session, t!("nonexisting_team", id = form.team_id));
session,
t!("cant_add_nonexisting_team_to_active", id = team_id)
);
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
@ -459,10 +450,7 @@ async fn remove_doing(
}; };
let Some(team) = Team::find_by_id(&db, team_id).await else { let Some(team) = Team::find_by_id(&db, team_id).await else {
er!( er!(session, t!("nonexisting_team", id = id));
session,
t!("cant_remove_nonexisting_team_from_active", id = team_id)
);
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
@ -485,10 +473,7 @@ async fn team_finished(
}; };
let Some(team) = Team::find_by_id(&db, team_id).await else { let Some(team) = Team::find_by_id(&db, team_id).await else {
er!( er!(session, t!("nonexisting_team", id = id));
session,
t!("cant_add_nonexisting_team_to_finished", id = team_id)
);
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
@ -511,10 +496,7 @@ async fn remove_left(
}; };
let Some(team) = Team::find_by_id(&db, team_id).await else { let Some(team) = Team::find_by_id(&db, team_id).await else {
er!( er!(session, t!("nonexisting_team", id = id));
session,
t!("cant_remove_nonexisting_team_from_finished", id = team_id)
);
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
@ -542,7 +524,7 @@ async fn team_update(
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };
let Some(team) = Team::find_by_id(&db, team_id).await else { let Some(team) = Team::find_by_id(&db, team_id).await else {
er!(session, t!("cant_update_nonexisting_team", id = team_id)); er!(session, t!("nonexisting_team", id = id));
return Redirect::to("/s/{id}/{code}"); return Redirect::to("/s/{id}/{code}");
}; };