]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: label sections and hopefully improve navigation
authorEric Wong <e@80x24.org>
Thu, 21 Jul 2016 01:23:02 +0000 (01:23 +0000)
committerEric Wong <e@80x24.org>
Thu, 21 Jul 2016 01:23:18 +0000 (01:23 +0000)
Clearly label "Thread overview" and "Reply instructions"
so users can quickly skip stuff they're not interested in.

Additionally, note the fact the thread view allows quick
navigation within the thread to avoid extra network requests
and improve the display for single-message threads.

Finally, use <hr> to better-delineate sections of each page.

lib/PublicInbox/View.pm
lib/PublicInbox/WwwStream.pm

index 49068641cf17f7a0aae9c5e39f800fb505530852..5f99644f8abaaebf630624c587b1b835dcd52058 100644 (file)
@@ -61,10 +61,12 @@ sub msg_reply {
        push @$arg, '/path/to/YOUR_REPLY';
        $arg = join(" \\\n    ", '', @$arg);
        <<EOF
-<pre
-id=R>You may reply publically to <a
-href=#t>this message</a> via
-plain-text email using any one of the following methods:
+<hr><pre
+id=R><b>Reply instructions:</b>
+
+You may reply publically to <a
+href=#t>this message</a> 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: <a
@@ -326,10 +328,12 @@ sub thread_html {
        return missing_thread($ctx) if $nr == 0;
        my $skel = '<hr><pre>';
        $skel .= $nr == 1 ? 'only message in thread' : 'end of thread';
-       $skel .= ", back to <a\nhref=\"../../\">index</a>";
-       $skel .= "\n<a\nid=t>$nr+ messages in thread:</a> (download: ";
-       $skel .= "<a\nhref=\"../t.mbox.gz\">mbox.gz</a>";
+       $skel .= ", back to <a\nhref=\"../../\">index</a>\n\n";
+       $skel .= "<b\nid=t>Thread overview:</b> ";
+       $skel .= $nr == 1 ? '(only message)' : "$nr+ messages";
+       $skel .= " (download: <a\nhref=\"../t.mbox.gz\">mbox.gz</a>";
        $skel .= " / follow: <a\nhref=\"../t.atom\">Atom feed</a>)\n";
+       $skel .= "-- links below jump to the message on this page --\n";
        $ctx->{-upfx} = '../../';
        $ctx->{cur_level} = 0;
        $ctx->{dst} = \$skel;
@@ -523,6 +527,7 @@ sub thread_skel {
                        qq(/ <a\nhref="${tpfx}t.atom">Atom feed</a>);
 
        my $parent = in_reply_to($hdr);
+       $$dst .= "\n<b>Thread overview: </b>";
        if ($nr <= 1) {
                if (defined $parent) {
                        $$dst .= "($expand)\n ";
index bce384b77ed1aea91f9d88b99d16c91baa9c6553..bdc8048d5ef1cc6050d6a4903b0f3b308bfd7101 100644 (file)
@@ -80,7 +80,7 @@ sub _html_end {
                        join("\n", map { "\tgit clone --mirror $_" } @urls);
        }
        my $url = PublicInbox::Hval::prurl($ctx->{env}, PI_URL);
-       '<pre>'.join("\n",
+       '<hr><pre>'.join("\n",
                '- ' . $desc,
                $urls,
                'Served with public-inbox: '.