Compare commits
No commits in common. "72622032ad7a3187e35ce244a358a8cc54263e00" and "7bfef154d9eeca5c745402b46d10f726d422c430" have entirely different histories.
72622032ad
...
7bfef154d9
1
dev.sh
1
dev.sh
@ -1,4 +1,3 @@
|
|||||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
|
||||||
tmux new-session -d -s letterbox-dev
|
tmux new-session -d -s letterbox-dev
|
||||||
tmux rename-window web
|
tmux rename-window web
|
||||||
tmux send-keys "cd web; trunk serve --release --address 0.0.0.0 --port 6758 --proxy-backend http://localhost:9345/ --proxy-rewrite=/api/ -w ../shared -w ../notmuch -w ./" C-m
|
tmux send-keys "cd web; trunk serve --release --address 0.0.0.0 --port 6758 --proxy-backend http://localhost:9345/ --proxy-rewrite=/api/ -w ../shared -w ../notmuch -w ./" C-m
|
||||||
|
|||||||
@ -5,7 +5,6 @@ enum MatchType {
|
|||||||
From,
|
From,
|
||||||
Sender,
|
Sender,
|
||||||
To,
|
To,
|
||||||
Cc,
|
|
||||||
Subject,
|
Subject,
|
||||||
List,
|
List,
|
||||||
DeliveredTo,
|
DeliveredTo,
|
||||||
@ -82,11 +81,6 @@ impl FromStr for Match {
|
|||||||
match_type: MatchType::From,
|
match_type: MatchType::From,
|
||||||
needle: cleanup_match(FROM, needle),
|
needle: cleanup_match(FROM, needle),
|
||||||
});
|
});
|
||||||
} else if needle.starts_with(CC) {
|
|
||||||
return Ok(Match {
|
|
||||||
match_type: MatchType::Cc,
|
|
||||||
needle: cleanup_match(CC, needle),
|
|
||||||
});
|
|
||||||
} else if needle.starts_with(TOCC) {
|
} else if needle.starts_with(TOCC) {
|
||||||
return Ok(Match {
|
return Ok(Match {
|
||||||
match_type: MatchType::To,
|
match_type: MatchType::To,
|
||||||
@ -94,7 +88,7 @@ impl FromStr for Match {
|
|||||||
});
|
});
|
||||||
} else if needle.starts_with(SENDER) {
|
} else if needle.starts_with(SENDER) {
|
||||||
return Ok(Match {
|
return Ok(Match {
|
||||||
match_type: MatchType::Sender,
|
match_type: MatchType::From,
|
||||||
needle: cleanup_match(SENDER, needle),
|
needle: cleanup_match(SENDER, needle),
|
||||||
});
|
});
|
||||||
} else if needle.starts_with(SUBJECT) {
|
} else if needle.starts_with(SUBJECT) {
|
||||||
@ -146,6 +140,7 @@ impl FromStr for Match {
|
|||||||
needle: cleanup_match("", &needle),
|
needle: cleanup_match("", &needle),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Ok(Match::default())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +161,6 @@ fn notmuch_from_rules<W: Write>(mut w: W, rules: &[Rule]) -> anyhow::Result<()>
|
|||||||
// TODO(wathiede): something more specific?
|
// TODO(wathiede): something more specific?
|
||||||
MatchType::Sender => "from:",
|
MatchType::Sender => "from:",
|
||||||
MatchType::To => "to:",
|
MatchType::To => "to:",
|
||||||
MatchType::Cc => "to:",
|
|
||||||
MatchType::Subject => "subject:",
|
MatchType::Subject => "subject:",
|
||||||
MatchType::List => "List-ID:",
|
MatchType::List => "List-ID:",
|
||||||
MatchType::Body => "",
|
MatchType::Body => "",
|
||||||
|
|||||||
@ -8,7 +8,7 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use log::{debug, error, info, Level};
|
use log::{debug, error, info, warn, Level};
|
||||||
use notmuch::{Content, Part, Thread, ThreadNode, ThreadSet};
|
use notmuch::{Content, Part, Thread, ThreadNode, ThreadSet};
|
||||||
use seed::{prelude::*, *};
|
use seed::{prelude::*, *};
|
||||||
use serde::de::Deserialize;
|
use serde::de::Deserialize;
|
||||||
@ -512,8 +512,7 @@ fn view_mobile_search_results(query: &str, search_results: &shared::SearchResult
|
|||||||
div![
|
div![
|
||||||
h1!["Search results"],
|
h1!["Search results"],
|
||||||
view_search_pager(first, summaries.len(), search_results.total),
|
view_search_pager(first, summaries.len(), search_results.total),
|
||||||
rows,
|
rows
|
||||||
view_search_pager(first, summaries.len(), search_results.total)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,35 +564,26 @@ fn view_search_results(query: &str, search_results: &shared::SearchResult) -> No
|
|||||||
th![C!["date"], "Date"]
|
th![C!["date"], "Date"]
|
||||||
]],
|
]],
|
||||||
tbody![rows]
|
tbody![rows]
|
||||||
],
|
]
|
||||||
view_search_pager(first, summaries.len(), search_results.total)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn view_search_pager(start: usize, count: usize, total: usize) -> Node<Msg> {
|
fn view_search_pager(page: usize, count: usize, total: usize) -> Node<Msg> {
|
||||||
let is_first = start <= 0;
|
|
||||||
let is_last = (start + SEARCH_RESULTS_PER_PAGE) >= total;
|
|
||||||
nav![
|
nav![
|
||||||
C!["pagination"],
|
C!["pagination"],
|
||||||
a![
|
a![
|
||||||
C![
|
C!["pagination-previous", "button"],
|
||||||
"pagination-previous",
|
|
||||||
"button",
|
|
||||||
IF!(is_first => "is-static"),
|
|
||||||
IF!(is_first => "is-info"),
|
|
||||||
],
|
|
||||||
"<",
|
"<",
|
||||||
ev(Ev::Click, |_| Msg::PreviousPage)
|
ev(Ev::Click, |_| Msg::PreviousPage)
|
||||||
],
|
],
|
||||||
a![
|
a![
|
||||||
C!["pagination-next", "button", IF!(is_last => "is-static")],
|
C!["pagination-next", "button"],
|
||||||
IF!(is_last => attrs!{ At::Disabled=>true }),
|
|
||||||
">",
|
">",
|
||||||
ev(Ev::Click, |_| Msg::NextPage)
|
ev(Ev::Click, |_| Msg::NextPage)
|
||||||
],
|
],
|
||||||
ul![
|
ul![
|
||||||
C!["pagination-list"],
|
C!["pagination-list"],
|
||||||
li![format!("{} - {} of {}", start, start + count, total)],
|
li![format!("{} - {} of {}", page, page + count, total)],
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user