unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/3] minor view tweaks
@ 2015-12-26  1:30 Eric Wong
  2015-12-26  1:30 ` [PATCH 1/3] view: reduce main landing page weight Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Wong @ 2015-12-26  1:30 UTC (permalink / raw)
  To: meta

3 changes to be pushed to git://80x24.org/public-inbox.org master:
      view: reduce main landing page weight
      searchview: fix unclosed tags in threaded search results
      use "Atom feed" consistently in headers/footers

 lib/PublicInbox/Feed.pm       |  2 +-
 lib/PublicInbox/SearchView.pm | 15 ++++++---------
 lib/PublicInbox/View.pm       | 23 +++++++++--------------
 3 files changed, 16 insertions(+), 24 deletions(-)

Additionally (sent separately):
      searchview: fixup stupid syntax error
      searchview: fix up Atom feed in search results


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

* [PATCH 1/3] view: reduce main landing page weight
  2015-12-26  1:30 [PATCH 0/3] minor view tweaks Eric Wong
@ 2015-12-26  1:30 ` Eric Wong
  2015-12-26  1:30 ` [PATCH 2/3] searchview: fix unclosed tags in threaded search results Eric Wong
  2015-12-26  1:30 ` [PATCH 3/3] use "Atom feed" consistently in headers/footers Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2015-12-26  1:30 UTC (permalink / raw)
  To: meta

Hopefully, "mbox.gz" is sufficiently understandabe that
we can get rid of the "title" attribute in <a> tags
(we already omitted the title in other pages).

Additionally, drop the '@' in front of the date.
The date should be obvious and is not necessary for
headers without author attribution.
---
 lib/PublicInbox/View.pm | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 7603c51..ad90eb3 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -15,7 +15,6 @@ use PublicInbox::Hval;
 use PublicInbox::MID qw/mid_clean id_compress mid2path/;
 use Digest::SHA qw/sha1_hex/;
 my $SALT = rand;
-my $MBOX_TITLE = 'title="download thread as gzipped mbox"';
 require POSIX;
 
 # TODO: make these constants tunable
@@ -205,7 +204,7 @@ sub emit_thread_html {
 	$next .= $final_anchor == 1 ? 'only message in' : 'end of';
 	$next .= " thread</a>, back to <a\nhref=\"../../\">index</a>";
 	$next .= "\ndownload thread: ";
-	$next .= "<a\n$MBOX_TITLE\nhref=\"../t.mbox.gz\">mbox.gz</a>";
+	$next .= "<a\nhref=\"../t.mbox.gz\">mbox.gz</a>";
 	$next .= " / follow: <a\nhref=\"../t.atom\">Atom feed</a>";
 	$cb->write('<hr /><pre>' . $next . "\n\n".
 			$foot .  '</pre></body></html>');
@@ -879,19 +878,15 @@ sub dump_topics {
 
 		my $attr;
 		$ts = fmt_ts($ts);
-		if ($n == 1) {
-			$attr = "@ $ts UTC";
-			$n = "";
-		} else {
-			# $n isn't the total number of posts on the topic,
-			# just the number of posts in the current results
-			# window, so leave it unlabeled
-			$attr = "@ $ts UTC";
-			$n = " ($n)";
-		}
+		$attr = " $ts UTC";
+
+		# $n isn't the total number of posts on the topic,
+		# just the number of posts in the current results
+		# window, so leave it unlabeled
+		$n = $n == 1 ? '' : " ($n+ messages)";
+
 		if ($level == 0 || $attr ne $prev_attr) {
-			my $mbox = qq(<a\n$MBOX_TITLE\n) .
-				   qq(href="$mid/t.mbox.gz">mbox.gz</a>);
+			my $mbox = qq(<a\nhref="$mid/t.mbox.gz">mbox.gz</a>);
 			my $atom = qq(<a\nhref="$mid/t.atom">Atom</a>);
 			$pfx .= INDENT if $level > 0;
 			$dst .= $pfx . $attr . $n . " - $mbox / $atom\n";
-- 
EW


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

* [PATCH 2/3] searchview: fix unclosed tags in threaded search results
  2015-12-26  1:30 [PATCH 0/3] minor view tweaks Eric Wong
  2015-12-26  1:30 ` [PATCH 1/3] view: reduce main landing page weight Eric Wong
@ 2015-12-26  1:30 ` Eric Wong
  2015-12-26  1:30 ` [PATCH 3/3] use "Atom feed" consistently in headers/footers Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2015-12-26  1:30 UTC (permalink / raw)
  To: meta

Oops, we've had this forever and we also lacked a space
between the this was noticed while adding an extra
line between the "Search results ordered by" header
and actual messages.
---
 lib/PublicInbox/SearchView.pm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 994bf0d..8751fca 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -43,13 +43,13 @@ sub sres_top_html {
 		my $x = $q->{x};
 		return sub { adump($_[0], $mset, $q, $ctx) } if ($x eq 'A');
 
-		$res .= search_nav_top($mset, $q);
+		$res .= search_nav_top($mset, $q) . "\n\n";
 		if ($x eq 't') {
 			return sub { tdump($_[0], $res, $mset, $q, $ctx) };
 		}
-		$res .= "\n\n";
 		dump_mset(\$res, $mset);
-		$res .= search_nav_bot($mset, $q) . "\n\n" . foot($ctx);
+		$res .= '</pre>' . search_nav_bot($mset, $q) .
+			"\n\n" . foot($ctx);
 	}
 
 	$res .= "</pre></body></html>";
@@ -111,8 +111,7 @@ sub search_nav_top {
 		$rv .= qq{<b>threaded</b>};
 	}
 	my $A = $q->qs_html(x => 'A', r => undef);
-	$rv .= qq{|<a\nhref="?$A">Atom</a>};
-	$rv .= ']';
+	$rv .= qq{|<a\nhref="?$A">Atom</a>]};
 }
 
 sub search_nav_bot {
-- 
EW


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

* [PATCH 3/3] use "Atom feed" consistently in headers/footers
  2015-12-26  1:30 [PATCH 0/3] minor view tweaks Eric Wong
  2015-12-26  1:30 ` [PATCH 1/3] view: reduce main landing page weight Eric Wong
  2015-12-26  1:30 ` [PATCH 2/3] searchview: fix unclosed tags in threaded search results Eric Wong
@ 2015-12-26  1:30 ` Eric Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2015-12-26  1:30 UTC (permalink / raw)
  To: meta

While having the extra " feed" is noisy in the main topic
landing page, it is useful in headers/footers which have
plenty of space to be more descriptive.
---
 lib/PublicInbox/Feed.pm       | 2 +-
 lib/PublicInbox/SearchView.pm | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 7ebc050..5708b60 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -194,7 +194,7 @@ sub nav_footer {
 		$head = $cgi->path_info;
 		$head = qq!<a\nhref="$head">head</a>!;
 	}
-	my $atom = "<a\nhref=\"$feed_opts->{atomurl}\">Atom</a>";
+	my $atom = "<a\nhref=\"$feed_opts->{atomurl}\">Atom feed</a>";
 	"<a\nname=\"s$anchor\">page:</a> $next $head $atom";
 }
 
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 8751fca..ab3dddb 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -103,15 +103,13 @@ sub search_nav_top {
 	my $x = $q->{x};
 	if ($x eq '') {
 		my $t = $q->qs_html(x => 't');
-		$rv .= qq{<b>summary</b>|};
-		$rv .= qq{<a\nhref="?$t">threaded</a>}
+		$rv .= qq{<b>summary</b>|<a\nhref="?$t">threaded</a>}
 	} elsif ($q->{x} eq 't') {
 		my $s = $q->qs_html(x => '');
-		$rv .= qq{<a\nhref="?$s">summary</a>|};
-		$rv .= qq{<b>threaded</b>};
+		$rv .= qq{<a\nhref="?$s">summary</a>|<b>threaded</b>};
 	}
 	my $A = $q->qs_html(x => 'A', r => undef);
-	$rv .= qq{|<a\nhref="?$A">Atom</a>]};
+	$rv .= qq{|<a\nhref="?$A">Atom feed</a>]};
 }
 
 sub search_nav_bot {
-- 
EW


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

end of thread, other threads:[~2015-12-26  1:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-26  1:30 [PATCH 0/3] minor view tweaks Eric Wong
2015-12-26  1:30 ` [PATCH 1/3] view: reduce main landing page weight Eric Wong
2015-12-26  1:30 ` [PATCH 2/3] searchview: fix unclosed tags in threaded search results Eric Wong
2015-12-26  1:30 ` [PATCH 3/3] use "Atom feed" consistently in headers/footers 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).