web: add mark read button on search result page

This commit is contained in:
Bill Thiede 2024-02-16 19:23:35 -08:00
parent 7ebe517a34
commit 4957b485a0
2 changed files with 20 additions and 0 deletions

View File

@ -76,6 +76,16 @@
white-space: nowrap; white-space: nowrap;
} }
.index .subject:hover .mark-read-button {
display: inline-flex;
}
.index .subject .mark-read-button {
display: none;
font-size: .6rem;
float: right;
}
.index .date { .index .date {
width: 10em; width: 10em;
white-space: nowrap; white-space: nowrap;

View File

@ -137,6 +137,16 @@ fn view_search_results(
At::Href => urls::thread(&tid) At::Href => urls::thread(&tid)
}, },
&r.subject, &r.subject,
button![
C!["mark-read-button", "button", "is-dark", "is-small"],
"Read",
ev(Ev::Click, move |e| {
info!("click happens");
e.stop_propagation();
e.prevent_default();
Msg::SetUnread(format!("thread:{tid}"), false)
}),
]
] ]
], ],
td![C!["date"], datetime] td![C!["date"], datetime]