From 6c853f5256f3a324c018a37a9e8a6b9fc8fdc063 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 27 Aug 2020 22:04:59 +0000 Subject: www: improve navigation around contemporary threads Sometimes it's useful to quickly get to threads and messages which are contemporaries of the current thread/message being focused on. This hopefully improves navigation by making: a) the top line (where $INBOX_DIR/description) is shown a link to the latest topics in search results and per-thread/per-message views. b) providing a link to contemporaries ("~YYYY-MM-DD") at around the thread overview skeleton area for per-thread and per-message views --- lib/PublicInbox/WwwStream.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/WwwStream.pm') diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index d79770ed..e06e3456 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -10,7 +10,7 @@ use strict; use parent qw(Exporter PublicInbox::GzipFilter); our @EXPORT_OK = qw(html_oneshot); use bytes (); # length -use PublicInbox::Hval qw(ascii_html prurl); +use PublicInbox::Hval qw(ascii_html prurl ts2str); our $TOR_URL = 'https://www.torproject.org/'; our $CODE_URL = 'https://public-inbox.org/public-inbox.git'; @@ -43,6 +43,13 @@ sub html_top ($) { my $color = $upfx.'_/text/color'; my $atom = $ctx->{-atom} || $upfx.'new.atom'; my $top = "$desc"; + if (my $t_max = $ctx->{-t_max}) { + $t_max = ts2str($t_max); + $top = qq($top); + # we had some kind of query, link to /$INBOX/?t=YYYYMMDDhhmmss + } elsif ($ctx->{qp}->{t}) { + $top = qq($top); + } my $links = "help / ". "color / ". "Atom feed"; -- cgit v1.2.3-24-ge0c7