diff --git a/peach-web/src/templates/peers_list.rs b/peach-web/src/templates/peers_list.rs index 315385d..c9fea13 100644 --- a/peach-web/src/templates/peers_list.rs +++ b/peach-web/src/templates/peers_list.rs @@ -17,23 +17,21 @@ fn peers_template(peers: Vec>) -> Markup { ), None => ( // set a fall-back value for name in case the data is unavailable - "name unavailable".to_string(), + "Name unavailable".to_string(), "Profile image".to_string() ) }; - @let profile_link = format!("/scuttlebutt/profile?public_key={}", peer["id"]); + @let url_safe_peer_id = peer["id"].replace('/', "%2F"); li { - a class="list-item link" href=(profile_link) { + a class="list-item link" href={ "/scuttlebutt/profile/" (url_safe_peer_id) } { @if peer.get("blob_path").is_some() && peer["blob_exists"] == "true" { - @let blob_path = format!("/blob/{}", peer["blob_path"]); - img id="peerImage" class="icon list-icon" src=(blob_path) alt=(name_alt); + img id="peerImage" class="icon list-icon" src={ "/blob/" (peer["blob_path"]) } alt=(name_alt); } @else { // use a placeholder image if we don't have the blob img id="peerImage" class="icon icon-active list-icon" src="/icons/user.svg" alt="Placeholder profile image"; } - p id="peerName" class="font-normal list-text" { (name) }; - @let name_title = format!("{}'s public key", name); - label class="label-small label-ellipsis list-label font-gray" for="peerName" title=(name_title) { + p id="peerName" class="font-normal list-text " { (name) }; + label class="label-small label-ellipsis list-label font-gray" for="peerName" title={ (name) "'s public key" } { (peer["id"]) } }