From af774d3bb0d728f2f37c418b8c3e215f1d4d860f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 1 Oct 2021 02:10:27 +0000 Subject: search_view: various navigation tweaks This improves the "&x=t" navigation between the thread overview (skeleton) section at the bottom and jumping back to the top for the mbox download form. The "--links below ..." text ought to be helpful for users unfamiliar with the /$MSGID/T/ and /$MSGID/t/ views. --- lib/PublicInbox/SearchView.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index c0c801b3..91196cca 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -170,7 +170,7 @@ sub err_txt { sub search_nav_top { my ($mset, $q, $ctx) = @_; my $m = $q->qs_html(x => 'm', r => undef, t => undef); - my $rv = qq{
};
+	my $rv = qq{
};
 	my $initial_q = $ctx->{-uxs_retried};
 	if (defined $initial_q) {
 		my $rewritten = $q->{'q'};
@@ -195,17 +195,19 @@ sub search_nav_top {
 	$rv .= ']  view[';
 
 	my $x = $q->{x};
+	my $pfx = "\t\t\t";
 	if ($x eq '') {
 		my $t = $q->qs_html(x => 't');
 		$rv .= qq{summary|nested}
-	} elsif ($q->{x} eq 't') {
+	} elsif ($x eq 't') {
 		my $s = $q->qs_html(x => '');
 		$rv .= qq{summary|nested};
+		$pfx = "thread overview below | ";
 	}
 	my $A = $q->qs_html(x => 'A', r => undef);
 	$rv .= qq{|Atom feed]};
 	if ($ctx->{ibx}->isrch->has_threadid) {
-		$rv .= qq{\n\t\t\tdownload mbox.gz: } .
+		$rv .= qq{\n${pfx}download mbox.gz: } .
 			# we set name=z w/o using it since it seems required for
 			# lynx (but works fine for w3m).
 			qq{};
 	} else { # BOFH needs to --reindex
-		$rv .= qq{\n\t\t\t\t\t\tdownload: } .
+		$rv .= qq{\n${pfx}download: } .
 			qq{}
 	}
 	$rv .= qq{
};
@@ -269,7 +271,9 @@ sub search_nav_bot { # also used by WwwListing for searching extindex miscidx
 	$rv .= qq{prev $pd} if $prev;
 
 	my $rev = $q->qs_html(o => $o < 0 ? 0 : -1);
-	$rv .= qq{ | reverse
}; + $rv .= qq{ | reverse} . + q{ | sort options + mbox downloads } . + q{above
}; } sub sort_relevance { @@ -294,7 +298,9 @@ sub mset_thread { my $rootset = PublicInbox::SearchThread::thread($msgs, $r ? \&sort_relevance : \&PublicInbox::View::sort_ds, $ctx); - my $skel = search_nav_bot($mset, $q). "
";
+	my $skel = search_nav_bot($mset, $q).
+		"
-- links below jump to the message on this page --\n";
+
 	$ctx->{-upfx} = '';
 	$ctx->{anchor_idx} = 1;
 	$ctx->{cur_level} = 0;
-- 
cgit v1.2.3-24-ge0c7