summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 898a893)
raw | patch | inline | side by side (parent: 898a893)
author | Jakub Narebski <jnareb@gmail.com> | |
Sun, 30 Jul 2006 15:49:00 +0000 (17:49 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 31 Jul 2006 01:41:26 +0000 (18:41 -0700) |
Add git_get_paging_nav subroutine which returns string with pager
(paging nav) for shortlog and log actions.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(paging nav) for shortlog and log actions.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.cgi | patch | blob | history |
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 03002f04f35dcfd615861604c6ab47444d7d3b62..8e5e4c83c5c0f865aacb4059acccae778ac9439f 100755 (executable)
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
"</div>\n";
}
+sub git_get_paging_nav {
+ my ($project, $action, $hash, $head, $page, $nrevs) = @_;
+ my $paging_nav;
+
+
+ if ($hash ne $head || $page) {
+ $paging_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action")}, "HEAD");
+ } else {
+ $paging_nav .= "HEAD";
+ }
+
+ if ($page > 0) {
+ $paging_nav .= " ⋅ " .
+ $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action;h=$hash;pg=" . ($page-1)),
+ -accesskey => "p", -title => "Alt-p"}, "prev");
+ } else {
+ $paging_nav .= " ⋅ prev";
+ }
+
+ if ($nrevs >= (100 * ($page+1)-1)) {
+ $paging_nav .= " ⋅ " .
+ $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action;h=$hash;pg=" . ($page+1)),
+ -accesskey => "n", -title => "Alt-n"}, "next");
+ } else {
+ $paging_nav .= " ⋅ next";
+ }
+
+ return $paging_nav;
+}
+
sub git_get_type {
my $hash = shift;
my @revlist = map { chomp; $_ } <$fd>;
close $fd;
- my $paging_nav = '';
- if ($hash ne $head || $page) {
- $paging_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log")}, "HEAD");
- } else {
- $paging_nav .= "HEAD";
- }
- if ($page > 0) {
- $paging_nav .= " ⋅ " .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$hash;pg=" . ($page-1)), -accesskey => "p", -title => "Alt-p"}, "prev");
- } else {
- $paging_nav .= " ⋅ prev";
- }
- if ($#revlist >= (100 * ($page+1)-1)) {
- $paging_nav .= " ⋅ " .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$hash;pg=" . ($page+1)), -accesskey => "n", -title => "Alt-n"}, "next");
- } else {
- $paging_nav .= " ⋅ next";
- }
+ my $paging_nav = git_get_paging_nav($project, 'log', $hash, $head, $page, $#revlist);
git_header_html();
git_page_nav('log','', $hash,undef,undef, $paging_nav);
my @revlist = map { chomp; $_ } <$fd>;
close $fd;
- my $paging_nav = '';
- if ($hash ne $head || $page) {
- $paging_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog")}, "HEAD");
- } else {
- $paging_nav .= "HEAD";
- }
- if ($page > 0) {
- $paging_nav .= " ⋅ " .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$hash;pg=" . ($page-1)), -accesskey => "p", -title => "Alt-p"}, "prev");
- } else {
- $paging_nav .= " ⋅ prev";
- }
- if ($#revlist >= (100 * ($page+1)-1)) {
- $paging_nav .= " ⋅ " .
- $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$hash;pg=" . ($page+1)), -accesskey => "n", -title => "Alt-n"}, "next");
- } else {
- $paging_nav .= " ⋅ next";
- }
+ my $paging_nav = git_get_paging_nav($project, 'shortlog', $hash, $head, $page, $#revlist);
git_header_html();
git_page_nav('shortlog','', $hash,$hash,$hash, $paging_nav);