From 0d613bfde45bdf3e28d1a247ffc59e6f805dc64a Mon Sep 17 00:00:00 2001
From: Eric Wong <e@80x24.org>
Date: Mon, 4 Jan 2016 01:01:41 +0000
Subject: [PATCH] view: label "relevance" in threaded search view

The threaded search view is somewhat alien to new users,
so ensure we label the word "relevance" for them.
---
 lib/PublicInbox/SearchView.pm | 2 ++
 lib/PublicInbox/View.pm       | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 5d4f4fe2..b3ddcb54 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -56,6 +56,8 @@ sub sres_top_html {
 	[$code, ['Content-Type'=>'text/html; charset=UTF-8'], [$res]];
 }
 
+# display non-threaded search results similar to what users expect from
+# regular WWW search engines:
 sub dump_mset {
 	my ($res, $mset) = @_;
 
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index fac0fcb1..4fc8ffc3 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -140,8 +140,8 @@ sub index_entry {
 		}
 		$rv .= " <a\nhref=\"$parent_anchor\">parent</a>";
 	}
-	if (my $pct = $state->{pct}) {
-		$rv .= " [$pct->{$mid_raw}%]";
+	if (my $pct = $state->{pct}) { # used by SearchView.pm
+		$rv .= " [relevance $pct->{$mid_raw}%]";
 	} elsif ($srch) {
 		if ($ctx->{flat}) {
 			$rv .= " [<a\nhref=\"${path}$href/t/#u\">threaded</a>" .
-- 
2.50.0