crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit 9c3f9fa9b1db8964ffd8c4e49d779aad98a4695d
parent 5796ebef3a76d3cdecc417eec2f88a897634d0ab
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Mon, 27 Dec 2021 11:09:13 -0800

make reply count more prominent

Diffstat:
Msrc/main.rs | 62++++++++++++++++++++++++++++++++------------------------------
Msrc/style.css | 7+++----
2 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -163,40 +163,42 @@ impl<'a> ThreadList<'a> { } pub fn write_to_file(&self) -> Result<()> { let tmp = html! { - h1(class="page-title") { - : &Config::global().list_name; - : Raw(" "); - a(href="atom.xml") { - img(alt="Atom feed", src=utils::rss_svg); - } - } + h1(class="page-title") { + : &Config::global().list_name; + : Raw(" "); + a(href="atom.xml") { + img(alt="Atom feed", src=utils::rss_svg); + } + } - a(href=format!("mailto:{}", &Config::global().list_email)) { - : &Config::global().list_email - } - span { // Hack - : " | " - } - a(href=&Config::global().homepage) { - : "about" - } - hr; - @ for thread in &self.threads { - div(class="message-sum") { - a(class="threadlink", href=format!("threads/{}.html", &thread.hash)) { - : &thread.messages[0].subject + a(href=format!("mailto:{}", &Config::global().list_email)) { + : &Config::global().list_email } - br; - span(class="timeago") { - : format!(" {created} | {replies} replies | updated {last}", replies=thread.messages.len() - 1, created=time::secs_to_date(thread.messages[0].date).ymd(), last=time::secs_to_date(thread.last_reply()).ymd()) - }br; a(class="addr", href=format!("mailto:{}", &thread.messages[0].from.addr)){ - : short_name(&thread.messages[0].from) + span { // Hack + : " | " + } + a(href=&Config::global().homepage) { + : "about" } - br; + hr; + @ for thread in &self.threads { + div(class="message-sum") { + a(class="threadlink", href=format!("threads/{}.html", &thread.hash)) { + : &thread.messages[0].subject + } + : format!(" ({})", thread.messages.len() -1) ; + br; + a(class="addr", href=format!("mailto:{}", &thread.messages[0].from.addr)){ + : short_name(&thread.messages[0].from) + } - } - } - }; + span(class="timeago") { + : format!(" {created} | updated {last}", created=time::secs_to_date(thread.messages[0].date).ymd(), last=time::secs_to_date(thread.last_reply()).ymd()) + } br; + + } + } + }; let file = File::create(&Config::global().out_dir.join("index.html"))?; let mut br = BufWriter::new(file); diff --git a/src/style.css b/src/style.css @@ -1,6 +1,6 @@ :root { --light-text: dimgrey; - --main-link: #202020; + --main-link: #222; --secondary-link: #369; } @@ -41,8 +41,8 @@ table { border-spacing: 0.5em 0.1em; } } .threadlink { - font-size: 1.3rem; - color: #202020; + font-size: 1.2rem; + color: #222; } .timeago { @@ -54,7 +54,6 @@ table { border-spacing: 0.5em 0.1em; } } .email-body { white-space:pre-line; - background-color: #fafafa; font-family:monospace; font-size: 1rem; }