unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/2] www: fix top nav bar for unindexed v1 inboxes
Date: Fri,  2 Sep 2022 09:10:53 +0000	[thread overview]
Message-ID: <20220902091054.1527844-2-e@80x24.org> (raw)
In-Reply-To: <20220902091054.1527844-1-e@80x24.org>

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.
---
 lib/PublicInbox/View.pm | 2 +-
 t/plack.t               | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

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 .= "<pre\nid=b>"; # 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 <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 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!<title>hihi - Me</title>!, 'HTML returned');
 	like($html, qr!<a\nhref=raw!s, 'raw link present');
 	like($html, qr!&gt; quoted text!s, 'quoted text inline');

  reply	other threads:[~2022-09-02  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  9:10 [PATCH 0/2] www: unindexed v1 fixes Eric Wong
2022-09-02  9:10 ` Eric Wong [this message]
2022-09-02  9:10 ` [PATCH 2/2] www: omit [thread overview] link for unindexed v1 Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220902091054.1527844-2-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).