1
0
Fork 0
forked from alemi/upub

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