nicer msgs

This commit is contained in:
2025-08-03 12:24:16 +02:00
parent b90590d3b5
commit b2369c6073
2 changed files with 5 additions and 7 deletions

View File

@@ -105,9 +105,7 @@ async fn game(
if backend.client_found_camera(&client, &camera).await {
messages.info(format!("found-cam|{}", camera.name));
} else {
messages.info(format!(
"err|Try to find a new camera!|You have already collected this camera.|"
));
messages.info("err|Try to find a new camera!|You have already collected this camera.|");
}
Ok(Redirect::to("/game"))
@@ -135,8 +133,8 @@ async fn set_name(
match backend.set_client_name(&client, &form.name).await {
Ok(()) => messages.info("set-name-succ"),
Err(NameUpdateError::TooShort(expected, actual)) => messages.info(format!("err|That's too little!|We need more information about you. Give us at least {expected} characters for you new name!|You sent us {actual} characters.")),
Err(NameUpdateError::TooLong(expected, actual)) => messages.info(format!("err|That's too much!|We only live in (20)25, so please use less than {expected} characters for your new name.|You sent us {actual} characters.")),
Err(NameUpdateError::TooShort(expected, actual)) => messages.info(format!("err|That's too little!|We need more information about you. Give us at least {expected} characters for you new name!|Received characters: {actual}")),
Err(NameUpdateError::TooLong(expected, actual)) => messages.info(format!("err|That's too much!|We only live in (20)25, so please use less than {expected} characters for your new name.|Received characters: {actual}")),
};
// Redirect back to the game page

View File

@@ -77,7 +77,7 @@ impl Page {
}
li {
a href="/game" {
span role="img" aria-label="camera" { (t!("icon_home")) }
span role="img" aria-label="camera" { (t!("icon_camera")) }
}
}
li {
@@ -105,7 +105,7 @@ impl Page {
@if self.new_name {
article class="name w-full" {
header { "New name!" }
"Welcome"
"Does it feel much different?"
}
}
@if let Some(err) = &self.err {