]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Patch from Recai to limit recentchanges to displaying max 10 files for a
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 14 Oct 2006 03:12:30 +0000 (03:12 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 14 Oct 2006 03:12:30 +0000 (03:12 +0000)
  given changeset (to avoid large number of file changes excessively
  bloating the page).

IkiWiki/CGI.pm
debian/changelog

index 53eda2158ad0958c97c3fad511ef9b1a60380a23..fe89e2758b924cdf8063eb1d03ea3f082be360dc 100644 (file)
@@ -83,12 +83,16 @@ sub cgi_recentchanges ($) { #{{{
        foreach my $change (@$changelog) {
                $change->{when} = concise(ago($change->{when}));
                $change->{user} = htmllink("", "", escapeHTML($change->{user}), 1);
        foreach my $change (@$changelog) {
                $change->{when} = concise(ago($change->{when}));
                $change->{user} = htmllink("", "", escapeHTML($change->{user}), 1);
+
+               my $is_excess = exists $change->{pages}[10]; # limit pages to first 10
+               delete @{$change->{pages}}[10 .. @{$change->{pages}}] if $is_excess;
                $change->{pages} = [
                        map {
                                $_->{link} = htmllink("", "", $_->{page}, 1);
                                $_;
                        } @{$change->{pages}}
                ];
                $change->{pages} = [
                        map {
                                $_->{link} = htmllink("", "", $_->{page}, 1);
                                $_;
                        } @{$change->{pages}}
                ];
+               push @{$change->{pages}}, { link => '...' } if $is_excess;
        }
 
        my $template=template("recentchanges.tmpl"); 
        }
 
        my $template=template("recentchanges.tmpl"); 
index 75c49880fd365d9a01478ce02d54beb578216598..4d018c79d9fd6668d607e797d448532ebd293f9c 100644 (file)
@@ -22,8 +22,11 @@ ikiwiki (1.29) UNRELEASED; urgency=low
   * $IkiWiki::version now holds the program version, and is accessible to
     plugins.
   * Make the aggregate plugin emphasize error messages.
   * $IkiWiki::version now holds the program version, and is accessible to
     plugins.
   * Make the aggregate plugin emphasize error messages.
+  * Patch from Recai to limit recentchanges to displaying max 10 files for a
+    given changeset (to avoid large number of file changes excessively
+    bloating the page).
 
 
- -- Joey Hess <joeyh@debian.org>  Fri, 13 Oct 2006 14:19:28 -0400
+ -- Joey Hess <joeyh@debian.org>  Fri, 13 Oct 2006 23:10:40 -0400
 
 ikiwiki (1.28) unstable; urgency=low
 
 
 ikiwiki (1.28) unstable; urgency=low