web: separate spam button from read buttons and color red.

This commit is contained in:
Bill Thiede 2024-04-06 08:00:35 -07:00
parent 8abf9398e9
commit b0305b7411
3 changed files with 70 additions and 50 deletions

View File

@ -42,7 +42,6 @@ pub fn init(url: Url, orders: &mut impl Orders<Msg>) -> 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<Vec<Tag>>,
}

View File

@ -255,35 +255,41 @@ fn search_toolbar(
.unwrap_or(0);
nav![
C!["level"],
IF!(show_bulk_edit =>
div![
C!["level-left"],
IF!(show_bulk_edit =>
span![
// TODO(wathiede): add "Mark as spam"
C!["level-item", "buttons", "has-addons"],
div![
C!["level-item"],
div![C!["buttons", "has-addons"],
button![
C!["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()))
],
],
],
div![
C!["level-item"],
div![C!["buttons", "has-addons"],
button![
C!["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"],
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,10 +739,14 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> No
C!["thread"],
h3![C!["is-size-5"], subject],
span![C!["tags"], tags_chiclet(&tags, false)],
span![
C!["level-item", "buttons", "has-addons"],
div![
C!["level"],
div![
C!["level-item"],
div![
C!["buttons", "has-addons"],
button![
C!["button"],
C!["button", "spam"],
attrs! {At::Title => "Spam"},
span![C!["icon", "is-small"], i![C!["far", "fa-hand"]]],
span!["Spam"],
@ -745,8 +755,14 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> No
"Spam".to_string()
)),
],
],
],
div![
C!["level-item"],
div![
C!["buttons", "has-addons"],
button![
C!["button"],
C!["button", "mark-read"],
attrs! {At::Title => "Mark as read"},
span![C!["icon", "is-small"], i![C!["far", "fa-envelope-open"]]],
span!["Read"],
@ -756,7 +772,7 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> No
)),
],
button![
C!["button"],
C!["button", "mark-unread"],
attrs! {At::Title => "Mark as unread"},
span![C!["icon", "is-small"], i![C!["far", "fa-envelope"]]],
span!["Unread"],
@ -766,6 +782,8 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> No
)),
],
],
],
],
messages,
/* TODO(wathiede): plumb in orignal id
a![

View File

@ -282,3 +282,7 @@ display: none;
.attachment .card-content {
padding: 0.5rem 1.5rem;
}
.button.spam {
color: #f00;
}