about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-20 02:51:28 +0000
committerEric Wong <e@80x24.org>2015-08-20 02:51:28 +0000
commit506b57e6f76888cbc930cd401af6d9e9ed87eb0f (patch)
tree69ab0960e9e9e29c72f2f432fd84f04bcb624676 /lib
parent69ed3f6087171f460e7aa4398b1eaac690a53033 (diff)
downloadpublic-inbox-506b57e6f76888cbc930cd401af6d9e9ed87eb0f.tar.gz
This hopefully reduces clicking.  We may drop folding entirely
since we can use Xapian to make searching easier.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/View.pm20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 391e3ad7..17af21f7 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;