user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/9] view: eliminate redundant [threaded|flat] link
  @ 2015-09-04  8:58  7% ` Eric Wong
  2015-09-04  8:58  6% ` [PATCH 5/9] view: reduce redundant attributions in permalink refs Eric Wong
  1 sibling, 0 replies; 2+ results
From: Eric Wong @ 2015-09-04  8:58 UTC (permalink / raw)
  To: meta

We do not need to waste space with that link when
we have it conveniently placed where every message
is located.
---
 lib/PublicInbox/View.pm | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index bd174b1..bb3afda 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -196,11 +196,6 @@ sub emit_thread_html {
 	my $next = "<a\nid=\"s$final_anchor\">";
 	$next .= $final_anchor == 1 ? 'only message in' : 'end of';
 	$next .= " thread</a>, back to <a\nhref=\"../../\">index</a>";
-	if ($flat) {
-		$next .= " [<a\nhref=\"../t/#u\">threaded</a>|<b>flat</b>]";
-	} else {
-		$next .= " [<b>threaded</b>|<a\nhref=\"../T/#u\">flat</a>]";
-	}
 	$next .= "\ndownload thread: <a\nhref=\"../t.mbox.gz\">mbox.gz</a>";
 	$next .= " / follow: <a\nhref=\"../t.atom\">Atom feed</a>";
 	$cb->write("<hr />" . PRE_WRAP . $next . "\n\n". $foot .
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 5/9] view: reduce redundant attributions in permalink refs
    2015-09-04  8:58  7% ` [PATCH 1/9] view: eliminate redundant [threaded|flat] link Eric Wong
@ 2015-09-04  8:58  6% ` Eric Wong
  1 sibling, 0 replies; 2+ results
From: Eric Wong @ 2015-09-04  8:58 UTC (permalink / raw)
  To: meta

No point in repeating authorship when PATCH messages are
threaded and it's obvious from the top message who the author
is of the series:

 [this message] - John Smith @ 2015-09-04 00:04:20 UTC
  ` [PATCH 1/4] view: eliminate redundant [threaded|flat] link
  ` [PATCH 2/4] view: one line for thread subjects
  ` [PATCH 3/4] view: adjust spacing and indentation of index threads
  ` [PATCH 4/4] view: add missing newline to inline dump
---
 lib/PublicInbox/View.pm | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 6b71703..d025c99 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -465,6 +465,8 @@ sub thread_inline {
 		cur => $mid,
 		parent_cmp => defined $parent ? $parent : '',
 		parent => $parent,
+		prev_attr => '',
+		prev_level => 0,
 	};
 	for (thread_results(load_results($res))->rootset) {
 		inline_dump($dst, $state, $upfx, $_, 0);
@@ -691,15 +693,24 @@ sub _inline_header {
 	my $mid = mid_clean($mime->header('Message-ID'));
 	my $f = $mime->header('X-PI-From');
 	my $d = _msg_date($mime);
-	$f = PublicInbox::Hval->new($f);
-	$d = PublicInbox::Hval->new($d);
-	$f = $f->as_html;
-	$d = $d->as_html . ' UTC';
+	$f = PublicInbox::Hval->new($f)->as_html;
+	$d = PublicInbox::Hval->new($d)->as_html;
+	my $attr = "$f @ $d";
+	$state->{first_level} ||= $level;
+	if ($attr ne $state->{prev_attr} || $state->{prev_level} > $level) {
+		$state->{prev_attr} = $attr;
+		$attr = ' - ' . $attr;
+		$attr .= ' UTC' if $level >= $state->{first_level};
+	} else {
+		$attr = '';
+	}
+	$state->{prev_level} = $level;
+
 	if ($cur) {
 		if ($cur eq $mid) {
 			delete $state->{cur};
 			$$dst .= "$pfx` <b><a\nid=\"r\"\nhref=\"#t\">".
-				 "[this message]</a></b> by $f @ $d\n";
+				 "[this message]</a></b>$attr\n";
 
 			return;
 		}
@@ -722,7 +733,7 @@ sub _inline_header {
 	my $m = PublicInbox::Hval->new_msgid($mid);
 	$m = $upfx . '../' . $m->as_href . '/';
 	if (defined $s) {
-		$$dst .= "$pfx` <a\nhref=\"$m\">$s</a> by $f @ $d\n";
+		$$dst .= "$pfx` <a\nhref=\"$m\">$s</a>$attr\n";
 	} else {
 		$$dst .= "$pfx` <a\nhref=\"$m\">$f @ $d</a>\n";
 	}
-- 
EW


^ permalink raw reply related	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-04  8:58     [PATCH 0/9] another round of updates Eric Wong
2015-09-04  8:58  7% ` [PATCH 1/9] view: eliminate redundant [threaded|flat] link Eric Wong
2015-09-04  8:58  6% ` [PATCH 5/9] view: reduce redundant attributions in permalink refs 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).