web: make whole row of search results clickable

No longer allow searching by tag by clicking on chiclet
This commit is contained in:
Bill Thiede 2024-08-06 21:37:38 -07:00
parent 7c5ef96ff0
commit c314e3c798
2 changed files with 10 additions and 27 deletions

View File

@ -40,23 +40,11 @@ fn tags_chiclet(tags: &[String], is_mobile: bool) -> impl Iterator<Item = Node<M
let style = style! {St::BackgroundColor=>hex}; let style = style! {St::BackgroundColor=>hex};
let classes = C!["tag", IF!(is_mobile => "is-small")]; let classes = C!["tag", IF!(is_mobile => "is-small")];
let tag = tag.clone(); let tag = tag.clone();
a![ a![match tag.as_str() {
attrs! { "attachment" => span![classes, style, "📎"],
At::Href => urls::search(&format!("tag:{tag}"), 0) "replied" => span![classes, style, i![C!["fa-solid", "fa-reply"]]],
}, _ => span![classes, style, &tag],
match tag.as_str() { },]
"attachment" => span![classes, style, "📎"],
"replied" => span![classes, style, i![C!["fa-solid", "fa-reply"]]],
_ => span![classes, style, &tag],
},
ev(Ev::Click, move |_| Msg::FrontPageRequest {
query: format!("tag:{tag}"),
after: None,
before: None,
first: None,
last: None,
})
]
}) })
} }
@ -234,10 +222,10 @@ fn view_search_results(
], ],
td![ td![
C!["subject"], C!["subject"],
tags_chiclet(&tags, false),
" ",
a![ a![
C!["has-text-light", "text"], tags_chiclet(&tags, false),
" ",
C!["has-text-light", "text", "subject-link"],
attrs! { attrs! {
At::Href => urls::thread(&tid) At::Href => urls::thread(&tid)
}, },

View File

@ -235,8 +235,6 @@ input::placeholder,
width: 100%; width: 100%;
} }
.search-results .row .checkbox {}
.search-results .row .summary { .search-results .row .summary {
min-width: 0; min-width: 0;
width: 100%; width: 100%;
@ -248,16 +246,13 @@ input::placeholder,
white-space: nowrap; white-space: nowrap;
} }
.search-results td.subject {}
.search-results .subject .tag {}
.search-results .subject .text { .search-results .subject .text {
padding-left: 0.5rem; padding-left: 0.5rem;
width: 100%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
display: inline-block;
width: 100%;
} }
.search-results .row .from { .search-results .row .from {