feat(web): better audience tag (well sorta)

This commit is contained in:
əlemi 2024-07-06 05:17:30 +02:00
parent 9714b002e7
commit 05738cccf7
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -37,15 +37,19 @@ pub fn Object(
let content = mdhtml::safe_html(object.content().unwrap_or_default()); let content = mdhtml::safe_html(object.content().unwrap_or_default());
let audience_badge = object.audience().id().str() let audience_badge = object.audience().id().str()
.map(|x| view! { .map(|x| {
<a class="clean dim" href={Uri::web(U::Actor, &x)}> // TODO this isn't guaranteed to work every time...
<span class="border-button ml-s" title={x.clone()}> let name = x.split('/').last().unwrap_or_default().to_string();
<code class="color mr-s">&</code> view! {
<small class="mr-s"> <a class="clean dim" href={Uri::web(U::Actor, &x)}>
{Uri::pretty(&x, 30)} <span class="border-button ml-s" title={x}>
</small> <code class="color mr-s">&</code>
</span> <small class="mr-s">
</a> {name}
</small>
</span>
</a>
}
}); });
let tag_badges = object.tag() let tag_badges = object.tag()