From: richard Date: Mon, 10 Aug 2009 02:02:00 +0000 (+0000) Subject: don't show entire history by default (fixes http://bugs.debian.org/cgi-bin/bugreport... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cefcbadec7125aaa2cd940f4e7ab1cbdc5ba5283;hp=e12f197243297c0d8f066dc1c5d89f855aea7d9f;p=roundup.git don't show entire history by default (fixes bugs.debian.org/cgi-bin/bugreport.cgi?bug=540629) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4338 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 1cae36a..2087508 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -880,7 +880,8 @@ class _HTMLItem(HTMLInputMixin, HTMLPermissions): # XXX do this return [] - def history(self, direction='descending', dre=re.compile('^\d+$')): + def history(self, direction='descending', dre=re.compile('^\d+$'), + limit=None): if not self.is_view_ok(): return self._('[hidden]') @@ -912,6 +913,10 @@ class _HTMLItem(HTMLInputMixin, HTMLPermissions): history.sort() history.reverse() + # restrict the volume + if limit: + history = history[:limit] + timezone = self._db.getUserTimezone() l = [] comments = {} diff --git a/share/roundup/templates/classic/html/_generic.item.html b/share/roundup/templates/classic/html/_generic.item.html index d9b98ae..9ce1f1a 100644 --- a/share/roundup/templates/classic/html/_generic.item.html +++ b/share/roundup/templates/classic/html/_generic.item.html @@ -44,7 +44,12 @@ - + +

Showing 10 items. +Show all history +(warning: this could be VERY long)

diff --git a/share/roundup/templates/minimal/html/_generic.item.html b/share/roundup/templates/minimal/html/_generic.item.html index ac60acb..9ce1f1a 100644 --- a/share/roundup/templates/minimal/html/_generic.item.html +++ b/share/roundup/templates/minimal/html/_generic.item.html @@ -9,18 +9,18 @@ -You are not allowed to view this page. +

+ You are not allowed to view this page.

-Please login with your username and password. +

+ Please login with your username and password.

+ +
@@ -44,21 +44,14 @@
- - - - - - - - -
- + +

Showing 10 items. +Show all history +(warning: this could be VERY long)

- - - +