web: tweak style and behavior of view original link

This commit is contained in:
Bill Thiede 2025-04-19 13:11:57 -07:00
parent 7d9376d607
commit 17ea2a35cb
2 changed files with 37 additions and 38 deletions

View File

@ -801,7 +801,10 @@ fn render_open_header(msg: &ShowThreadQueryThreadOnEmailThreadMessages) -> Node<
At::Href=>href,
At::Target=>"_blank",
},
"View original"
"View original",
ev(Ev::Click, move |e| {
e.stop_propagation();
})
]]
]
]
@ -946,20 +949,23 @@ fn render_closed_header(msg: &ShowThreadQueryThreadOnEmailThreadMessages) -> Nod
C!["text-right"],
msg.timestamp
.map(|ts| div![C!["text-xs", "text-nowrap"], human_age(ts)]),
i![C![
"mx-4",
"read-status",
"far",
if is_unread {
"fa-envelope"
} else {
"fa-envelope-open"
},
]],
ev(Ev::Click, move |e| {
e.stop_propagation();
Msg::SetUnread(id, !is_unread)
}),
div![
C!["p-2"],
i![C![
"mx-4",
"read-status",
"far",
if is_unread {
"fa-envelope"
} else {
"fa-envelope-open"
},
]],
ev(Ev::Click, move |e| {
e.stop_propagation();
Msg::SetUnread(id, !is_unread)
})
],
]
]
}
@ -992,7 +998,7 @@ fn message_render(msg: &ShowThreadQueryThreadOnEmailThreadMessages, open: bool)
],
IF!(open =>
div![
C!["bg-white", "text-black", "p-4", "min-w-full", "w-0","overflow-x-auto", from],
C!["content", "bg-white", "text-black", "p-4", "min-w-full", "w-0","overflow-x-auto", from],
match &msg.body {
ShowThreadQueryThreadOnEmailThreadMessagesBody::UnhandledContentType(
ShowThreadQueryThreadOnEmailThreadMessagesBodyOnUnhandledContentType { contents ,content_tree},
@ -1096,7 +1102,6 @@ fn render_attachements(
]
}
// TODO: add cathup_mode:bool and hide elements when true
#[topo::nested]
fn thread(
thread: &ShowThreadQueryThreadOnEmailThread,
@ -1187,13 +1192,7 @@ fn thread(
el_ref(content_el),
messages,
IF!(!catchup_mode => click_to_top())
],
/* TODO(wathiede): plumb in orignal id
a![
attrs! {At::Href=>api::original(&thread_node.0.as_ref().expect("message missing").id)},
"Original"
],
*/
]
]
}

View File

@ -2,23 +2,23 @@ html {
background-color: black;
}
.mail-thread a,
.mail-thread .content a,
.news-post a {
color: var(--color-link) !important;
text-decoration: underline;
}
.mail-thread br,
.mail-thread .content br,
.news-post br {
display: block;
margin-top: 1em;
content: " ";
}
.mail-thread h1,
.mail-thread h2,
.mail-thread h3,
.mail-thread h4,
.mail-thread .content h1,
.mail-thread .content h2,
.mail-thread .content h3,
.mail-thread .content h4,
.news-post h1,
.news-post h2,
.news-post h3,
@ -27,12 +27,12 @@ html {
margin-bottom: 1em !important;
}
.mail-thread p,
.mail-thread .content p,
.news-post p {
margin-bottom: 1em;
}
.mail-thread pre,
.mail-thread .content pre,
.news-post pre {
font-family: monospace;
background-color: #eee !important;
@ -40,28 +40,28 @@ html {
white-space: break-spaces;
}
.mail-thread code,
.mail-thread .content code,
.news-post code {
font-family: monospace;
white-space: break-spaces;
background-color: #eee !important;
}
.mail-thread blockquote {
.mail-thread .content blockquote {
padding-left: 1em;
border-left: 2px solid #ddd;
}
.mail-thread ol,
.mail-thread ul {
.mail-thread .content ol,
.mail-thread .content ul {
margin-left: 2em;
}
.mail-thread .noreply-news-bloomberg-com a {
.mail-thread .content .noreply-news-bloomberg-com a {
background-color: initial !important;
}
.mail-thread .noreply-news-bloomberg-com h2 {
.mail-thread .content .noreply-news-bloomberg-com h2 {
margin: 0 !important;
padding: 0 !important;
}