From 2b942707678b54c54d26640955a33d4b531d60d1 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sun, 24 Nov 2024 08:47:31 -0800 Subject: [PATCH] Link feed titles in summary to the full entry on the right --- cry/static/style.css | 5 +++++ cry/views.py | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/cry/static/style.css b/cry/static/style.css index 34b4633..13fcb4b 100644 --- a/cry/static/style.css +++ b/cry/static/style.css @@ -129,3 +129,8 @@ li.entry:before { text-overflow: ellipsis; white-space: nowrap; } + +.feed-summary-feed-link { + color: inherit; + text-decoration: inherit; +} diff --git a/cry/views.py b/cry/views.py index 45f1ef9..1e00348 100644 --- a/cry/views.py +++ b/cry/views.py @@ -45,13 +45,22 @@ def _feed_summary(f: feed.Feed) -> tags.li: " ago", ), ), - tags.p({"class": "feed-summary-entry"}, entry.title), + tags.p( + {"class": "feed-summary-entry"}, + tags.a({"href": entry.link, "target": "_blank"}, entry.title), + ), ] result = tags.li( {"class": "feed-summary"}, # TODO: Image! - tags.h2({"class": "feed-summary-title"}, f.title), + tags.h2( + {"class": "feed-summary-title"}, + tags.a( + {"class": "feed-summary-feed-link", "href": f"#{f.meta.url}"}, + f.title, + ), + ), last_entry, ) assert isinstance(result, tags.li) @@ -93,7 +102,7 @@ def feed_view(feeds: list[feed.Feed]) -> tags.html: tags.div( {"class": "fv-feed"}, tags.h2( - {"class": "fv-feed-title"}, + {"class": "fv-feed-title", "id": f.meta.url}, tags.a(f.title, href=f.link, target="_blank"), ), (