Merge news and email search results

This commit is contained in:
2024-08-06 20:44:25 -07:00
parent a84c9f0eaf
commit e570202ba2
9 changed files with 288 additions and 227 deletions

View File

@@ -305,23 +305,11 @@ fn search_toolbar(
show_bulk_edit: bool,
show_icon_text: bool,
) -> Node<Msg> {
let start = pager
.start_cursor
.as_ref()
.map(|i| i.parse().unwrap_or(0))
.unwrap_or(0)
+ 1;
let end = pager
.end_cursor
.as_ref()
.map(|i| i.parse().unwrap_or(count))
.unwrap_or(count)
+ 1;
nav![
C!["level", "is-mobile"],
IF!(show_bulk_edit =>
div![
C!["level-left"],
IF!(show_bulk_edit =>
div![
C!["level-item"],
div![C!["buttons", "has-addons"],
@@ -340,7 +328,8 @@ fn search_toolbar(
ev(Ev::Click, |_| Msg::SelectionMarkAsUnread)
]
]
],
]),
IF!(show_bulk_edit =>
div![
C!["level-item"],
div![C!["buttons", "has-addons"],
@@ -357,8 +346,8 @@ fn search_toolbar(
)
],
],
]
]),
])
],
div![
C!["level-right"],
nav![
@@ -383,10 +372,7 @@ fn search_toolbar(
">",
IF!(pager.has_next_page => ev(Ev::Click, |_| Msg::NextPage))
],
ul![
C!["pagination-list"],
li![format!("{} - {} of {}", start, end, count)],
],
ul![C!["pagination-list"], li![format!("{count} results")],],
]
]
]