nicer msgs
This commit is contained in:
@@ -105,9 +105,7 @@ async fn game(
|
|||||||
if backend.client_found_camera(&client, &camera).await {
|
if backend.client_found_camera(&client, &camera).await {
|
||||||
messages.info(format!("found-cam|{}", camera.name));
|
messages.info(format!("found-cam|{}", camera.name));
|
||||||
} else {
|
} else {
|
||||||
messages.info(format!(
|
messages.info("err|Try to find a new camera!|You have already collected this camera.|");
|
||||||
"err|Try to find a new camera!|You have already collected this camera.|"
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Redirect::to("/game"))
|
Ok(Redirect::to("/game"))
|
||||||
@@ -135,8 +133,8 @@ async fn set_name(
|
|||||||
|
|
||||||
match backend.set_client_name(&client, &form.name).await {
|
match backend.set_client_name(&client, &form.name).await {
|
||||||
Ok(()) => messages.info("set-name-succ"),
|
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::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.|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.|Received characters: {actual}")),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Redirect back to the game page
|
// Redirect back to the game page
|
||||||
|
@@ -77,7 +77,7 @@ impl Page {
|
|||||||
}
|
}
|
||||||
li {
|
li {
|
||||||
a href="/game" {
|
a href="/game" {
|
||||||
span role="img" aria-label="camera" { (t!("icon_home")) }
|
span role="img" aria-label="camera" { (t!("icon_camera")) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
li {
|
li {
|
||||||
@@ -105,7 +105,7 @@ impl Page {
|
|||||||
@if self.new_name {
|
@if self.new_name {
|
||||||
article class="name w-full" {
|
article class="name w-full" {
|
||||||
header { "New name!" }
|
header { "New name!" }
|
||||||
"Welcome"
|
"Does it feel much different?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@if let Some(err) = &self.err {
|
@if let Some(err) = &self.err {
|
||||||
|
Reference in New Issue
Block a user