move name'calculation' into backend

This commit is contained in:
2025-08-02 20:55:26 +02:00
parent 88b13e215c
commit 5356557f7b
3 changed files with 35 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
use crate::{page::new, random_names::get_name_by_uuid, Backend};
use crate::{page::new, Backend};
use axum::{
extract::{Path, State},
response::{IntoResponse, Redirect, Response},
@@ -41,14 +41,12 @@ async fn index(State(backend): State<Arc<Backend>>, cookies: CookieJar) -> Respo
(rank.rank)
}
@if rank.uuid == client.uuid { (PreEscaped("<mark>")) }
@if let Some(name) = rank.name { (name) } @else {
"Anonymous "
(get_name_by_uuid(&rank.uuid))}
(rank.name)
@if rank.uuid == client.uuid { (PreEscaped("</mark>")) }
}
span {
(rank.amount)
}
}
}
}
}