From: Eric Wong Date: Fri, 2 Sep 2022 09:10:53 +0000 (+0000) Subject: www: fix top nav bar for unindexed v1 inboxes X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=4fe706e6a86da985755cd101bc52ce813d044554 www: fix top nav bar for unindexed v1 inboxes For /$INBOX/$MSGID/ pages, we need to point all nav bar links ../ regardless of whether ->over exists. I've also verified this doesn't affect /$INBOX/new.html at all. --- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 2e5228e1..11a94ba9 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -678,7 +678,7 @@ sub _msg_page_prepare_obuf { $ctx->{chash} = content_hash($eml) if $ctx->{smsg}; # reused MID $rv .= ""; # anchor for body start } - $ctx->{-upfx} = '../' if $have_over; + $ctx->{-upfx} = '../'; my @title; # (Subject[0], From[0]) for my $v ($eml->header('From')) { my @n = PublicInbox::Address::names($v); diff --git a/t/plack.t b/t/plack.t index 32209c7d..3ba2e6fb 100644 --- a/t/plack.t +++ b/t/plack.t @@ -1,5 +1,5 @@ #!perl -w -# Copyright (C) 2014-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ use strict; use v5.10.1; @@ -154,6 +154,7 @@ my $c1 = sub { $res = $cb->(GET($pfx . $path)); is(200, $res->code, "success for $path"); my $html = $res->content; + like($html, qr!\bhref="\Q../_/text/help/"!, 'help available'); like($html, qr!hihi - Me!, 'HTML returned'); like($html, qr!