web: add mark as spam buttons

This commit is contained in:
2024-04-03 21:07:56 -07:00
parent 1b196a2703
commit 8abf9398e9
6 changed files with 210 additions and 1 deletions

View File

@@ -261,6 +261,13 @@ fn search_toolbar(
span![
// TODO(wathiede): add "Mark as spam"
C!["level-item", "buttons", "has-addons"],
button![
C!["button"],
attrs!{At::Title => "Mark as spam"},
span![C!["icon", "is-small"], i![C!["far", "fa-hand"]]],
span!["Spam"],
ev(Ev::Click, |_| Msg::SelectionAddTag("Spam".to_string()))
],
button![
C!["button"],
attrs!{At::Title => "Mark as read"},
@@ -721,13 +728,23 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> No
});
let read_thread_id = thread.thread_id.clone();
let unread_thread_id = thread.thread_id.clone();
let spam_thread_id = thread.thread_id.clone();
div![
C!["thread"],
h3![C!["is-size-5"], subject],
span![C!["tags"], tags_chiclet(&tags, false)],
span![
// TODO(wathiede): add "Mark as spam"
C!["level-item", "buttons", "has-addons"],
button![
C!["button"],
attrs! {At::Title => "Spam"},
span![C!["icon", "is-small"], i![C!["far", "fa-hand"]]],
span!["Spam"],
ev(Ev::Click, move |_| Msg::AddTag(
format!("thread:{spam_thread_id}"),
"Spam".to_string()
)),
],
button![
C!["button"],
attrs! {At::Title => "Mark as read"},