git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb: only display "next" links in logs if there is a next page
@ 2008-05-27 22:31 Lea Wiemann
  2008-05-27 23:08 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Lea Wiemann @ 2008-05-27 22:31 UTC (permalink / raw)
  To: git; +Cc: Lea Wiemann

There was a bug in the implementation of the "next" links in
format_paging_nav (for log and shortlog), which caused the next links
to always be displayed, even if there is no next page.  This fixes it.

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
---
 gitweb/gitweb.perl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 308fde2..874f53a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2752,7 +2752,7 @@ sub git_print_page_nav {
 }
 
 sub format_paging_nav {
-	my ($action, $hash, $head, $page, $has_more_pages) = @_;
+	my ($action, $hash, $head, $page, $has_next_link) = @_;
 	my $paging_nav;
 
 
@@ -2770,7 +2770,7 @@ sub format_paging_nav {
 		$paging_nav .= " &sdot; prev";
 	}
 
-	if ($has_more_pages) {
+	if ($has_next_link) {
 		$paging_nav .= " &sdot; " .
 			$cgi->a({-href => href(-replay=>1, page=>$page+1),
 			         -accesskey => "n", -title => "Alt-n"}, "next");
@@ -4661,7 +4661,7 @@ sub git_log {
 
 	my @commitlist = parse_commits($hash, 101, (100 * $page));
 
-	my $paging_nav = format_paging_nav('log', $hash, $head, $page, $#commitlist > 99);
+	my $paging_nav = format_paging_nav('log', $hash, $head, $page, $#commitlist >= 100);
 
 	git_header_html();
 	git_print_page_nav('log','', $hash,undef,undef, $paging_nav);
@@ -5581,7 +5581,7 @@ sub git_shortlog {
 
 	my @commitlist = parse_commits($hash, 101, (100 * $page));
 
-	my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, $#commitlist > 99);
+	my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, $#commitlist >= 100);
 	my $next_link = '';
 	if ($#commitlist >= 100) {
 		$next_link =
-- 
1.5.5.1

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

end of thread, other threads:[~2008-05-28  9:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 22:31 [PATCH] gitweb: only display "next" links in logs if there is a next page Lea Wiemann
2008-05-27 23:08 ` Junio C Hamano
2008-05-27 23:23   ` Lea Wiemann
2008-05-27 23:25     ` Lea Wiemann
2008-05-27 23:30       ` Lea Wiemann
2008-05-28  0:04         ` Junio C Hamano
2008-05-28  0:10           ` Lea Wiemann
2008-05-28  9:01       ` Jakub Narebski

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 NNTP newsgroup(s).