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::Href=>href,
At::Target=>"_blank", 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"], C!["text-right"],
msg.timestamp msg.timestamp
.map(|ts| div![C!["text-xs", "text-nowrap"], human_age(ts)]), .map(|ts| div![C!["text-xs", "text-nowrap"], human_age(ts)]),
i![C![ div![
"mx-4", C!["p-2"],
"read-status", i![C![
"far", "mx-4",
if is_unread { "read-status",
"fa-envelope" "far",
} else { if is_unread {
"fa-envelope-open" "fa-envelope"
}, } else {
]], "fa-envelope-open"
ev(Ev::Click, move |e| { },
e.stop_propagation(); ]],
Msg::SetUnread(id, !is_unread) 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 => IF!(open =>
div![ 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 { match &msg.body {
ShowThreadQueryThreadOnEmailThreadMessagesBody::UnhandledContentType( ShowThreadQueryThreadOnEmailThreadMessagesBody::UnhandledContentType(
ShowThreadQueryThreadOnEmailThreadMessagesBodyOnUnhandledContentType { contents ,content_tree}, ShowThreadQueryThreadOnEmailThreadMessagesBodyOnUnhandledContentType { contents ,content_tree},
@ -1096,7 +1102,6 @@ fn render_attachements(
] ]
} }
// TODO: add cathup_mode:bool and hide elements when true
#[topo::nested] #[topo::nested]
fn thread( fn thread(
thread: &ShowThreadQueryThreadOnEmailThread, thread: &ShowThreadQueryThreadOnEmailThread,
@ -1187,13 +1192,7 @@ fn thread(
el_ref(content_el), el_ref(content_el),
messages, messages,
IF!(!catchup_mode => click_to_top()) 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; background-color: black;
} }
.mail-thread a, .mail-thread .content a,
.news-post a { .news-post a {
color: var(--color-link) !important; color: var(--color-link) !important;
text-decoration: underline; text-decoration: underline;
} }
.mail-thread br, .mail-thread .content br,
.news-post br { .news-post br {
display: block; display: block;
margin-top: 1em; margin-top: 1em;
content: " "; content: " ";
} }
.mail-thread h1, .mail-thread .content h1,
.mail-thread h2, .mail-thread .content h2,
.mail-thread h3, .mail-thread .content h3,
.mail-thread h4, .mail-thread .content h4,
.news-post h1, .news-post h1,
.news-post h2, .news-post h2,
.news-post h3, .news-post h3,
@ -27,12 +27,12 @@ html {
margin-bottom: 1em !important; margin-bottom: 1em !important;
} }
.mail-thread p, .mail-thread .content p,
.news-post p { .news-post p {
margin-bottom: 1em; margin-bottom: 1em;
} }
.mail-thread pre, .mail-thread .content pre,
.news-post pre { .news-post pre {
font-family: monospace; font-family: monospace;
background-color: #eee !important; background-color: #eee !important;
@ -40,28 +40,28 @@ html {
white-space: break-spaces; white-space: break-spaces;
} }
.mail-thread code, .mail-thread .content code,
.news-post code { .news-post code {
font-family: monospace; font-family: monospace;
white-space: break-spaces; white-space: break-spaces;
background-color: #eee !important; background-color: #eee !important;
} }
.mail-thread blockquote { .mail-thread .content blockquote {
padding-left: 1em; padding-left: 1em;
border-left: 2px solid #ddd; border-left: 2px solid #ddd;
} }
.mail-thread ol, .mail-thread .content ol,
.mail-thread ul { .mail-thread .content ul {
margin-left: 2em; margin-left: 2em;
} }
.mail-thread .noreply-news-bloomberg-com a { .mail-thread .content .noreply-news-bloomberg-com a {
background-color: initial !important; background-color: initial !important;
} }
.mail-thread .noreply-news-bloomberg-com h2 { .mail-thread .content .noreply-news-bloomberg-com h2 {
margin: 0 !important; margin: 0 !important;
padding: 0 !important; padding: 0 !important;
} }