From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 444DC1F59D for ; Fri, 2 Sep 2022 09:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662109921; bh=HAt38MwN35P9Z4zd7nPu2430MW0d02qlwrzx0QGMFlU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hxcOn1S+EPAmESHWjJsxo9r+HveJzQDGY6+2LpOXT0SY9xU64Qu1cr/qac9jzTdh+ oOxin66vR9CljJfVf25+l0j80j5G2r0Ck4TPdOwFE40kEkj8ExPadSiMoePpa25nwr qKFNDSJxA8Qmke9AvcWp2yB0+danBqJt94EaZO4w= From: Eric Wong 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 Message-Id: <20220902091054.1527844-2-e@80x24.org> In-Reply-To: <20220902091054.1527844-1-e@80x24.org> References: <20220902091054.1527844-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 .= ""; # 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!