1
0
Fork 0
forked from alemi/upub

feat(web): better tags, fix reply filtering

This commit is contained in:
əlemi 2024-06-07 05:47:51 +02:00
parent be46c5ed7c
commit afa5bd45d0
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 22 additions and 16 deletions

View file

@ -120,9 +120,12 @@
div.border { div.border {
border: 1px dashed var(--accent); border: 1px dashed var(--accent);
} }
div.border-solid { span.border-button {
border: 1px solid var(--background-dim); border: 1px solid var(--background-dim);
} }
span.border-button:hover {
background-color: var(--background-dim);
}
div.inline { div.inline {
display: inline; display: inline;
} }

View file

@ -134,14 +134,14 @@ pub fn Object(object: crate::Object) -> impl IntoView {
let audience_badge = object.audience().id().str() let audience_badge = object.audience().id().str()
.map(|x| view! { .map(|x| view! {
<div class="inline border-solid"> <a class="clean dim" href={x.clone()} target="_blank" rel="nofollow noreferrer">
<code class="color">~</code> <span class="border-button">
<small> <code class="color">&</code>
<a class="clean dim" href={x.clone()} target="_blank" rel="nofollow noreferrer"> <small>
{Uri::pretty(&x)} {Uri::pretty(&x)}
</a> </small>
</small> </span>
</div> </a>
}); });
let post_inner = view! { let post_inner = view! {

View file

@ -60,14 +60,17 @@ impl FiltersConfig {
}; };
let mut reply_filter = true; let mut reply_filter = true;
if if let Ok(obj_id) = item.object().id() {
item.in_reply_to().id().is_ok() || if let Some(obj) = crate::CACHE.get(obj_id) {
item.object().get().map(|x| if obj.in_reply_to().id().is_ok() {
x.in_reply_to().id().is_ok() reply_filter = self.replies;
).unwrap_or(false) }
{ }
}
if item.in_reply_to().id().is_ok() {
reply_filter = self.replies; reply_filter = self.replies;
}; }
type_filter && reply_filter type_filter && reply_filter
} }