* [PATCH 11/11] view: do not fold top-level messages in thread
@ 2015-08-20 2:57 7% ` Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-08-20 2:57 UTC (permalink / raw)
To: meta
This hopefully reduces clicking. We may drop folding entirely
since we can use Xapian to make searching easier.
---
lib/PublicInbox/View.pm | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 391e3ad..17af21f 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -109,11 +109,15 @@ sub index_entry {
}
$rv .= "\n\n";
+ my ($fhref, $more_ref);
my $mhref = "${path}m/$href.html";
- my $fhref = "${path}f/$href.html";
+ if ($level > 0) {
+ $fhref = "${path}f/$href.html";
+ $more_ref = \$more;
+ }
# scan through all parts, looking for displayable text
$mime->walk_parts(sub {
- $rv .= index_walk($_[0], $enc_msg, $part_nr, $fhref, \$more);
+ $rv .= index_walk($_[0], $enc_msg, $part_nr, $fhref, $more_ref);
$part_nr++;
});
$mime->body_set('');
@@ -220,12 +224,14 @@ sub index_walk {
my $s = add_text_body($enc, $part, $part_nr, $fhref);
- # drop the remainder of git patches, they're usually better
- # to review when the full message is viewed
- $s =~ s!^---+\n.*\z!!ms and $$more = 'more...';
+ if ($more) {
+ # drop the remainder of git patches, they're usually better
+ # to review when the full message is viewed
+ $s =~ s!^---+\n.*\z!!ms and $$more = 'more...';
- # Drop signatures
- $s =~ s/^-- \n.*\z//ms and $$more = 'more...';
+ # Drop signatures
+ $s =~ s/^-- \n.*\z//ms and $$more = 'more...';
+ }
# kill any leading or trailing whitespace lines
$s =~ s/^\s*$//sgm;
--
EW
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-08-20 2:57 [PATCH 01/11] feed: remove threading from index Eric Wong
2015-08-20 2:57 7% ` [PATCH 11/11] view: do not fold top-level messages in thread Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).