Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Use href(-replay=>1, page=>...) to generate pagination links
author
Jakub Narebski
<jnareb@gmail.com>
Thu, 1 Nov 2007 12:06:28 +0000
(13:06 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 2 Nov 2007 08:30:35 +0000
(
01:30
-0700)
Use href(-replay=>1, page=>$page-1) and href(-replay=>1, page=>$page+1)
to generate previous page and next page links.
Generate next page link only once.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
1cad283
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index c93c546fbfa9c59c5de54d9bb9b2c788d7acf5d9..d2adae31c897977bc556636b8dd4d85d729b1d30 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-2518,7
+2518,7
@@
sub format_paging_nav {
if ($page > 0) {
$paging_nav .= " ⋅ " .
if ($page > 0) {
$paging_nav .= " ⋅ " .
- $cgi->a({-href => href(
action=>$action, hash=>$hash
, page=>$page-1),
+ $cgi->a({-href => href(
-replay=>1
, page=>$page-1),
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
$paging_nav .= " ⋅ prev";
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
$paging_nav .= " ⋅ prev";
@@
-2526,7
+2526,7
@@
sub format_paging_nav {
if ($nrevs >= (100 * ($page+1)-1)) {
$paging_nav .= " ⋅ " .
if ($nrevs >= (100 * ($page+1)-1)) {
$paging_nav .= " ⋅ " .
- $cgi->a({-href => href(
action=>$action, hash=>$hash
, page=>$page+1),
+ $cgi->a({-href => href(
-replay=>1
, page=>$page+1),
-accesskey => "n", -title => "Alt-n"}, "next");
} else {
$paging_nav .= " ⋅ next";
-accesskey => "n", -title => "Alt-n"}, "next");
} else {
$paging_nav .= " ⋅ next";
@@
-4448,7
+4448,7
@@
sub git_log {
}
if ($#commitlist >= 100) {
print "<div class=\"page_nav\">\n";
}
if ($#commitlist >= 100) {
print "<div class=\"page_nav\">\n";
- print $cgi->a({-href => href(
action=>"log", hash=>$hash
, page=>$page+1),
+ print $cgi->a({-href => href(
-replay=>1
, page=>$page+1),
-accesskey => "n", -title => "Alt-n"}, "next");
print "</div>\n";
}
-accesskey => "n", -title => "Alt-n"}, "next");
print "</div>\n";
}
@@
-5015,27
+5015,20
@@
sub git_history {
file_name=>$file_name)},
"first");
$paging_nav .= " ⋅ " .
file_name=>$file_name)},
"first");
$paging_nav .= " ⋅ " .
- $cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
- file_name=>$file_name, page=>$page-1),
+ $cgi->a({-href => href(-replay=>1, page=>$page-1),
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
- if ($#commitlist >= 100) {
- $paging_nav .= " ⋅ " .
- $cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
- file_name=>$file_name, page=>$page+1),
- -accesskey => "n", -title => "Alt-n"}, "next");
- } else {
- $paging_nav .= " ⋅ next";
- }
my $next_link = '';
if ($#commitlist >= 100) {
$next_link =
my $next_link = '';
if ($#commitlist >= 100) {
$next_link =
- $cgi->a({-href => href(action=>"history", hash=>$hash, hash_base=>$hash_base,
- file_name=>$file_name, page=>$page+1),
+ $cgi->a({-href => href(-replay=>1, page=>$page+1),
-accesskey => "n", -title => "Alt-n"}, "next");
-accesskey => "n", -title => "Alt-n"}, "next");
+ $paging_nav .= " ⋅ $next_link";
+ } else {
+ $paging_nav .= " ⋅ next";
}
git_header_html();
}
git_header_html();
@@
-5105,30
+5098,23
@@
sub git_search {
searchtext=>$searchtext, searchtype=>$searchtype)},
"first");
$paging_nav .= " ⋅ " .
searchtext=>$searchtext, searchtype=>$searchtype)},
"first");
$paging_nav .= " ⋅ " .
- $cgi->a({-href => href(action=>"search", hash=>$hash,
- searchtext=>$searchtext, searchtype=>$searchtype,
- page=>$page-1),
+ $cgi->a({-href => href(-replay=>1, page=>$page-1),
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
-accesskey => "p", -title => "Alt-p"}, "prev");
} else {
$paging_nav .= "first";
$paging_nav .= " ⋅ prev";
}
+ my $next_link = '';
if ($#commitlist >= 100) {
if ($#commitlist >= 100) {
- $paging_nav .= " ⋅ " .
- $cgi->a({-href => href(action=>"search", hash=>$hash,
- searchtext=>$searchtext, searchtype=>$searchtype,
- page=>$page+1),
+ $next_link =
+ $cgi->a({-href => href(-replay=>1, page=>$page+1),
-accesskey => "n", -title => "Alt-n"}, "next");
-accesskey => "n", -title => "Alt-n"}, "next");
+ $paging_nav .= " ⋅ $next_link";
} else {
$paging_nav .= " ⋅ next";
}
} else {
$paging_nav .= " ⋅ next";
}
- my $next_link = '';
+
if ($#commitlist >= 100) {
if ($#commitlist >= 100) {
- $next_link =
- $cgi->a({-href => href(action=>"search", hash=>$hash,
- searchtext=>$searchtext, searchtype=>$searchtype,
- page=>$page+1),
- -accesskey => "n", -title => "Alt-n"}, "next");
}
git_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);
}
git_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);
@@
-5327,7
+5313,7
@@
sub git_shortlog {
my $next_link = '';
if ($#commitlist >= 100) {
$next_link =
my $next_link = '';
if ($#commitlist >= 100) {
$next_link =
- $cgi->a({-href => href(
action=>"shortlog", hash=>$hash
, page=>$page+1),
+ $cgi->a({-href => href(
-replay=>1
, page=>$page+1),
-accesskey => "n", -title => "Alt-n"}, "next");
}
-accesskey => "n", -title => "Alt-n"}, "next");
}