From 05738cccf78271a2c627549335bc54ff12ae7e15 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 6 Jul 2024 05:17:30 +0200 Subject: [PATCH] feat(web): better audience tag (well sorta) --- web/src/objects/item.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/web/src/objects/item.rs b/web/src/objects/item.rs index 3fc75df..5a743fb 100644 --- a/web/src/objects/item.rs +++ b/web/src/objects/item.rs @@ -37,15 +37,19 @@ pub fn Object( let content = mdhtml::safe_html(object.content().unwrap_or_default()); let audience_badge = object.audience().id().str() - .map(|x| view! { - - - & - - {Uri::pretty(&x, 30)} - - - + .map(|x| { + // TODO this isn't guaranteed to work every time... + let name = x.split('/').last().unwrap_or_default().to_string(); + view! { + + + & + + {name} + + + + } }); let tag_badges = object.tag()