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.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 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 A1B281F87F for ; Sat, 15 Jun 2019 20:23:42 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] searchview: add link at bottom to reverse results Date: Sat, 15 Jun 2019 20:23:42 +0000 Message-Id: <20190615202342.7730-3-e@80x24.org> In-Reply-To: <20190615202342.7730-1-e@80x24.org> References: <20190615202342.7730-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I could not find a place to put the link the top without making navigation too cluttered. Putting it at the bottom of the page seems reasonable... --- lib/PublicInbox/SearchView.pm | 4 +++- t/psgi_v2.t | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index f0d803e..6f07279 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -232,7 +232,9 @@ sub search_nav_bot { $rv .= qq{ next} if $next; $rv .= $join if $join; $rv .= qq{prev} if $prev; - $rv .= ''; + + my $rev = $q->qs_html(o => $o < 0 ? 0 : -1); + $rv .= qq{ | reverse results}; } sub sort_relevance { diff --git a/t/psgi_v2.t b/t/psgi_v2.t index 5c358cd..b8062de 100644 --- a/t/psgi_v2.t +++ b/t/psgi_v2.t @@ -155,7 +155,7 @@ test_psgi(sub { $www->call(@_) }, sub { $res = $cb->(GET('/v2test/?q=m:a-mid@b&x=t')); is($res->code, 200, 'success with threaded search'); my $raw = $res->content; - ok($raw =~ s/\A.*>Results 1-3 of 3Results 1-3 of 3\b//s, 'got all results'); my @over = ($raw =~ m/\d{4}-\d+-\d+\s+\d+:\d+ (.+)$/gm); is_deeply(\@over, [ '