diff --git a/web/src/state.rs b/web/src/state.rs index 8620fb4..3df4a0c 100644 --- a/web/src/state.rs +++ b/web/src/state.rs @@ -42,7 +42,6 @@ pub fn init(url: Url, orders: &mut impl Orders) -> Model { context: Context::None, query: "".to_string(), refreshing_state: RefreshingState::None, - ui_error: UIError::NoError, tags: None, } } @@ -450,7 +449,6 @@ pub struct Model { pub query: String, pub context: Context, pub refreshing_state: RefreshingState, - pub ui_error: UIError, pub tags: Option>, } diff --git a/web/src/view/mod.rs b/web/src/view/mod.rs index 70a8a80..b9da5a1 100644 --- a/web/src/view/mod.rs +++ b/web/src/view/mod.rs @@ -255,35 +255,41 @@ fn search_toolbar( .unwrap_or(0); nav![ C!["level"], - div![ - C!["level-left"], - IF!(show_bulk_edit => - span![ - // TODO(wathiede): add "Mark as spam" - C!["level-item", "buttons", "has-addons"], - button![ - C!["button"], - attrs!{At::Title => "Mark as spam"}, + IF!(show_bulk_edit => + div![ + C!["level-left"], + div![ + C!["level-item"], + div![C!["buttons", "has-addons"], + button![ + C!["button","spam"], + 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"}, + div![ + C!["level-item"], + div![C!["buttons", "has-addons"], + button![ + C!["button","mark-read"], + attrs!{At::Title => "Mark as read"}, span![C!["icon", "is-small"], i![C!["far", "fa-envelope-open"]]], span!["Read"], ev(Ev::Click, |_| Msg::SelectionMarkAsRead) - ], - button![ - C!["button"], - attrs!{At::Title => "Mark as unread"}, + ], + button![ + C!["button","mark-unread"], + attrs!{At::Title => "Mark as unread"}, span![C!["icon", "is-small"], i![C!["far", "fa-envelope"]]], span!["Unread"], ev(Ev::Click, |_| Msg::SelectionMarkAsUnread) ] - ]), - ], + ] + ] + ]), div![ C!["level-right"], nav![ @@ -733,37 +739,49 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet) -> No C!["thread"], h3![C!["is-size-5"], subject], span![C!["tags"], tags_chiclet(&tags, false)], - span![ - 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() - )), + div![ + C!["level"], + div![ + C!["level-item"], + div![ + C!["buttons", "has-addons"], + button![ + C!["button", "spam"], + 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"}, - span![C!["icon", "is-small"], i![C!["far", "fa-envelope-open"]]], - span!["Read"], - ev(Ev::Click, move |_| Msg::SetUnread( - format!("thread:{read_thread_id}"), - false - )), - ], - button![ - C!["button"], - attrs! {At::Title => "Mark as unread"}, - span![C!["icon", "is-small"], i![C!["far", "fa-envelope"]]], - span!["Unread"], - ev(Ev::Click, move |_| Msg::SetUnread( - format!("thread:{unread_thread_id}"), - true - )), + div![ + C!["level-item"], + div![ + C!["buttons", "has-addons"], + button![ + C!["button", "mark-read"], + attrs! {At::Title => "Mark as read"}, + span![C!["icon", "is-small"], i![C!["far", "fa-envelope-open"]]], + span!["Read"], + ev(Ev::Click, move |_| Msg::SetUnread( + format!("thread:{read_thread_id}"), + false + )), + ], + button![ + C!["button", "mark-unread"], + attrs! {At::Title => "Mark as unread"}, + span![C!["icon", "is-small"], i![C!["far", "fa-envelope"]]], + span!["Unread"], + ev(Ev::Click, move |_| Msg::SetUnread( + format!("thread:{unread_thread_id}"), + true + )), + ], + ], ], ], messages, diff --git a/web/static/style.css b/web/static/style.css index 936575f..fa31048 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -282,3 +282,7 @@ display: none; .attachment .card-content { padding: 0.5rem 1.5rem; } + +.button.spam { + color: #f00; +}