diff options
author | Michael Buesch <m@bues.ch> | 2024-11-20 20:47:42 +0100 |
---|---|---|
committer | Michael Buesch <m@bues.ch> | 2024-11-20 20:47:42 +0100 |
commit | fe929850c956208248a46f81e0408e072bb94161 (patch) | |
tree | 8315f6e13e3f106a00926b0149b76cd4cccebb01 | |
parent | ee36d7640daf780c50b5a1fc5a43d27472853515 (diff) | |
download | feedreaders-fe929850c956208248a46f81e0408e072bb94161.tar.xz feedreaders-fe929850c956208248a46f81e0408e072bb94161.zip |
page: Add NEW-marker to new items
-rw-r--r-- | feeds/src/pagegen.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/feeds/src/pagegen.rs b/feeds/src/pagegen.rs index 0dab168..2becbde 100644 --- a/feeds/src/pagegen.rs +++ b/feeds/src/pagegen.rs @@ -140,6 +140,7 @@ async fn gen_item_list( } else { format!("{} - ", escape(&item.author, 32)) }; + let new_marker = if item.seen { "" } else { "(NEW) " }; let timestring = item.published.format("%Y-%m-%d %H:%M:%S"); let mut history = String::new(); if count > 1 { @@ -151,7 +152,7 @@ async fn gen_item_list( ln!(b, r#" <a class="title" href="{link}">{author}{title}</a>"#)?; ln!(b, r#" {history}"#)?; ln!(b, r#" <br />"#)?; - ln!(b, r#" <div class="date">{timestring}</div>"#)?; + ln!(b, r#" <div class="date">{new_marker}{timestring}</div>"#)?; ln!(b, r#" <br />"#)?; ln!(b, r#" <div class="summary">{summary}</div>"#)?; ln!(b, r#" </div>"#)?; |