web: handle empty subjects
This commit is contained in:
parent
fc7a4a747c
commit
1ac7f5b6dc
@ -135,6 +135,11 @@ fn view_search_results(
|
||||
if let Some(idx) = unread_idx {
|
||||
tags.remove(idx);
|
||||
};
|
||||
let subject = if r.subject.is_empty() {
|
||||
"(no subject)"
|
||||
} else {
|
||||
&r.subject
|
||||
};
|
||||
tr![
|
||||
IF!(unread_idx.is_some() => C!["unread"]),
|
||||
td![label![
|
||||
@ -181,7 +186,7 @@ fn view_search_results(
|
||||
attrs! {
|
||||
At::Href => urls::thread(&tid)
|
||||
},
|
||||
&r.subject,
|
||||
&subject,
|
||||
]
|
||||
],
|
||||
td![
|
||||
@ -441,7 +446,7 @@ fn render_open_header(msg: &ShowThreadQueryThreadMessages) -> Node<Msg> {
|
||||
table![
|
||||
IF!(!msg.to.is_empty() =>
|
||||
tr![
|
||||
td![ "To" ],
|
||||
td![ "To:" ],
|
||||
//td![ if i==0 { "To" }else { "" } ],
|
||||
td![
|
||||
msg.to.iter().enumerate().map(|(i, to)|
|
||||
@ -467,7 +472,7 @@ fn render_open_header(msg: &ShowThreadQueryThreadMessages) -> Node<Msg> {
|
||||
]),
|
||||
IF!(!msg.cc.is_empty() =>
|
||||
tr![
|
||||
td![ "CC" ],
|
||||
td![ "CC:" ],
|
||||
td![
|
||||
msg.cc.iter().enumerate().map(|(i, cc)|
|
||||
small![
|
||||
@ -656,7 +661,12 @@ fn message_render(msg: &ShowThreadQueryThreadMessages, open: bool) -> Node<Msg>
|
||||
#[topo::nested]
|
||||
fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> Node<Msg> {
|
||||
// TODO(wathiede): show per-message subject if it changes significantly from top-level subject
|
||||
set_title(&thread.subject);
|
||||
let subject = if thread.subject.is_empty() {
|
||||
"(no subject)"
|
||||
} else {
|
||||
&thread.subject
|
||||
};
|
||||
set_title(subject);
|
||||
let mut tags: Vec<_> = thread
|
||||
.messages
|
||||
.iter()
|
||||
@ -675,7 +685,7 @@ fn thread(thread: &ShowThreadQueryThread, open_messages: &HashSet<String>) -> No
|
||||
let unread_thread_id = thread.thread_id.clone();
|
||||
div![
|
||||
C!["thread"],
|
||||
h3![C!["is-size-5"], &thread.subject],
|
||||
h3![C!["is-size-5"], subject],
|
||||
span![C!["tags"], tags_chiclet(&tags, false)],
|
||||
span![
|
||||
// TODO(wathiede): add "Mark as spam"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user