unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/2] www: navigation improvements (hopefully)
@ 2016-07-21  1:23 Eric Wong
  2016-07-21  1:23 ` [PATCH 1/2] www: label sections and hopefully improve navigation Eric Wong
  2016-07-21  1:23 ` [PATCH 2/2] view: split up --cc args for git-send-email Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2016-07-21  1:23 UTC (permalink / raw)
  To: meta

1/2 is purely subjective; 2/2 improves compatibility for
users of older git.

Eric Wong (2):
      www: label sections and hopefully improve navigation
      view: split up --cc args for git-send-email

 lib/PublicInbox/View.pm      | 31 ++++++++++++++++++-------------
 lib/PublicInbox/WwwStream.pm |  2 +-
 2 files changed, 19 insertions(+), 14 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] www: label sections and hopefully improve navigation
  2016-07-21  1:23 [PATCH 0/2] www: navigation improvements (hopefully) Eric Wong
@ 2016-07-21  1:23 ` Eric Wong
  2016-07-21  1:23 ` [PATCH 2/2] view: split up --cc args for git-send-email Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-07-21  1:23 UTC (permalink / raw)
  To: meta

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      | 19 ++++++++++++-------
 lib/PublicInbox/WwwStream.pm |  2 +-
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 4906864..5f99644 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -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 ";
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index bce384b..bdc8048 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -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: '.
-- 
EW


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] view: split up --cc args for git-send-email
  2016-07-21  1:23 [PATCH 0/2] www: navigation improvements (hopefully) Eric Wong
  2016-07-21  1:23 ` [PATCH 1/2] www: label sections and hopefully improve navigation Eric Wong
@ 2016-07-21  1:23 ` Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-07-21  1:23 UTC (permalink / raw)
  To: meta

Having long Cc: lines is inevitable for large threads
with many participants, and git-send-email only gained
the ability to recognize ',' in the "--cc" arg recently
with the release of git v2.6.0 in September 2015.
---
 lib/PublicInbox/View.pm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 5f99644..e0d81f0 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -59,7 +59,7 @@ sub msg_reply {
 
 	my ($arg, $link) = mailto_arg_link($hdr);
 	push @$arg, '/path/to/YOUR_REPLY';
-	$arg = join(" \\\n    ", '', @$arg);
+	$arg = ascii_html(join(" \\\n    ", '', @$arg));
 	<<EOF
 <hr><pre
 id=R><b>Reply instructions:</b>
@@ -619,15 +619,15 @@ sub mailto_arg_link {
 	my $subj = $hdr->header('Subject') || '';
 	$subj = "Re: $subj" unless $subj =~ /\bRe:/i;
 	my $mid = $hdr->header_raw('Message-ID');
-	push @arg, '--in-reply-to='.ascii_html(squote_maybe(mid_clean($mid)));
+	push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid));
 	my $irt = uri_escape_utf8($mid);
 	delete $cc{$to};
-	push @arg, '--to=' . ascii_html($to);
+	push @arg, "--to=$to";
 	$to = uri_escape_utf8($to);
 	$subj = uri_escape_utf8($subj);
-	my $cc = join(',', sort values %cc);
-	push @arg, '--cc=' . ascii_html($cc);
-	$cc = uri_escape_utf8($cc);
+	my @cc = sort values %cc;
+	push(@arg, map { "--cc=$_" } @cc);
+	my $cc = uri_escape_utf8(join(',', @cc));
 	my $href = "mailto:$to?In-Reply-To=$irt&Cc=${cc}&Subject=$subj";
 	$href =~ s/%20/+/g;
 
-- 
EW


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-21  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21  1:23 [PATCH 0/2] www: navigation improvements (hopefully) Eric Wong
2016-07-21  1:23 ` [PATCH 1/2] www: label sections and hopefully improve navigation Eric Wong
2016-07-21  1:23 ` [PATCH 2/2] view: split up --cc args for git-send-email Eric Wong

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).