diff options
author | Eric Wong <e@80x24.org> | 2014-09-15 03:00:49 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-09-15 03:00:49 +0000 |
commit | 27a0b84774ad63a4462bc17c07c4f9b8e78a54f1 (patch) | |
tree | 28a059186f62e0626bca3c5df23286f13f9dbacd /lib | |
parent | a81f21e9f203c39e5d90426b97b40f2aa2f1e52c (diff) | |
download | public-inbox-27a0b84774ad63a4462bc17c07c4f9b8e78a54f1.tar.gz |
Sometimes people come from sharing links and not the index, so the back button in their browser does not really go back.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/View.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 92c20238..d3849dcc 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -301,7 +301,7 @@ sub headers_to_html_header { } sub html_footer { - my ($mime, $purge) = @_; + my ($mime, $standalone) = @_; my %cc; # everyone else my $to; # this is the From address @@ -316,7 +316,7 @@ sub html_footer { $to ||= $dst; } } - Email::Address->purge_cache if $purge; + Email::Address->purge_cache if $standalone; my $subj = $mime->header('Subject') || ''; $subj = "Re: $subj" unless $subj =~ /\bRe:/; @@ -329,7 +329,9 @@ sub html_footer { my $cc = uri_escape_utf8(join(',', values %cc)); my $href = "mailto:$to?In-Reply-To=$irp&Cc=${cc}&Subject=$subj"; - "<a\nhref=\"" . ascii_html($href) . '">reply</a>'; + my $idx = $standalone ? " <a\nhref=\"../\">index</a>" : ''; + + "<a\nhref=\"" . ascii_html($href) . '">reply</a>' . $idx; } sub linkify_refs { |