unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] view: use <hr> to delineate in /$MID/T/ view
@ 2016-08-05 18:14 Eric Wong
  2016-08-06  0:30 ` [PATCH 2/1] view: do not introduce excessive </pre> in $MID/t/ view Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2016-08-05 18:14 UTC (permalink / raw)
  To: meta; +Cc: Jeff King

The sacrifice in vertical space might be worth it to improve
ease-of-reading, as it's unreasonable to expect an entire
message thread to be able to fit into a single window.

https://public-inbox.org/git/20160805093544.scvl4yshkfg2l26p@sigill.intra.peff.net/

Cc: Jeff King <peff@peff.net>
---
 lib/PublicInbox/View.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index db0cdc0..e150a01 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -180,7 +180,7 @@ sub index_entry {
 		$rv .= " <a\nhref=#r$id>$ctx->{s_nr}</a>";
 	}
 
-	$rv .= $more ? "\n\n" : "\n";
+	$rv .= $more ? '</pre><hr><pre>' : '</pre>';
 }
 
 sub pad_link ($$;$) {
-- 
EW


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

* [PATCH 2/1] view: do not introduce excessive </pre> in $MID/t/ view
  2016-08-05 18:14 [PATCH] view: use <hr> to delineate in /$MID/T/ view Eric Wong
@ 2016-08-06  0:30 ` Eric Wong
  2016-08-06 21:09   ` [PATCH] www: use <hr> to delimit messages in /new.html view, too Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2016-08-06  0:30 UTC (permalink / raw)
  To: meta

When using <ul><li>..., we already setup <pre> tags
in thread_index_entry, so having an extra </pre> tag
causes validation errors.

Fixes: 6ef9b216156c ("view: use <hr> to delineate in /$MID/T/ view")
---
 lib/PublicInbox/View.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index e150a01..d6711d5 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -164,13 +164,17 @@ sub index_entry {
 		"<a\nhref=\"$mhref\">permalink</a>" .
 		" <a\nhref=\"${mhref}raw\">raw</a>" .
 		" <a\nhref=\"${mhref}#R\">reply</a>";
+
+	my $hr;
 	if (my $pct = $ctx->{pct}) { # used by SearchView.pm
 		$rv .= "\t[relevance $pct->{$mid_raw}%]";
+		$hr = 1;
 	} elsif ($mapping) {
 		my $threaded = 'threaded';
 		my $flat = 'flat';
 		my $end = '';
 		if ($ctx->{flat}) {
+			$hr = 1;
 			$flat = "<b>$flat</b>";
 		} else {
 			$threaded = "<b>$threaded</b>";
@@ -180,7 +184,8 @@ sub index_entry {
 		$rv .= " <a\nhref=#r$id>$ctx->{s_nr}</a>";
 	}
 
-	$rv .= $more ? '</pre><hr><pre>' : '</pre>';
+	$rv .= $more ? '</pre><hr><pre>' : '</pre>' if $hr;
+	$rv;
 }
 
 sub pad_link ($$;$) {
-- 
EW

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

* [PATCH] www: use <hr> to delimit messages in /new.html view, too
  2016-08-06  0:30 ` [PATCH 2/1] view: do not introduce excessive </pre> in $MID/t/ view Eric Wong
@ 2016-08-06 21:09   ` Eric Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-08-06 21:09 UTC (permalink / raw)
  To: meta

This is necessary to delimit messages when viewed without
threading.
---
 lib/PublicInbox/Feed.pm | 2 +-
 lib/PublicInbox/View.pm | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index a697a43..240c336 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -59,12 +59,12 @@ sub new_html {
 	}
 	$ctx->{-html_tip} = '<pre>';
 	$ctx->{-upfx} = '';
+	$ctx->{-hr} = 1;
 	PublicInbox::WwwStream->response($ctx, 200, sub {
 		while (my $path = shift @paths) {
 			my $m = do_cat_mail($ctx->{-inbox}, $path) or next;
 			my $more = scalar @paths;
 			my $s = PublicInbox::View::index_entry($m, $ctx, $more);
-			$s .= '</pre>' unless $more;
 			return $s;
 		}
 		new_html_footer($ctx, $last);
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index d6711d5..ed3c96e 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -182,6 +182,8 @@ sub index_entry {
 		$rv .= "\t[<a\nhref=\"${mhref}T/#u\">$flat</a>";
 		$rv .= "|<a\nhref=\"${mhref}t/#u\">$threaded</a>]";
 		$rv .= " <a\nhref=#r$id>$ctx->{s_nr}</a>";
+	} else {
+		$hr = $ctx->{-hr};
 	}
 
 	$rv .= $more ? '</pre><hr><pre>' : '</pre>' if $hr;
-- 
EW

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

end of thread, other threads:[~2016-08-06 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-05 18:14 [PATCH] view: use <hr> to delineate in /$MID/T/ view Eric Wong
2016-08-06  0:30 ` [PATCH 2/1] view: do not introduce excessive </pre> in $MID/t/ view Eric Wong
2016-08-06 21:09   ` [PATCH] www: use <hr> to delimit messages in /new.html view, too 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).