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 4/4] view: label "relevance" in threaded search view
Date: Mon,  4 Jan 2016 01:03:52 +0000	[thread overview]
Message-ID: <20160104010352.26568-5-e@80x24.org> (raw)
In-Reply-To: <20160104010352.26568-1-e@80x24.org>

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 5d4f4fe..b3ddcb5 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 fac0fcb..4fc8ffc 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>" .
-- 
EW


      parent reply	other threads:[~2016-01-04  1:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04  1:03 [PATCH 0/4] misc updates to push Eric Wong
2016-01-04  1:03 ` [PATCH 1/4] examples/public-inbox.psgi: shorten to simplify Eric Wong
2016-01-04  1:03 ` [PATCH 2/4] www: comments for denoting Plack::Request vs CGI Eric Wong
2016-01-04  1:03 ` [PATCH 3/4] misc doc updates Eric Wong
2016-01-04  1:03 ` Eric Wong [this message]

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=20160104010352.26568-5-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).