bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1339598 - /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/timeline.py
Date Thu, 17 May 2012 13:36:14 GMT
Author: gjm
Date: Thu May 17 13:36:13 2012
New Revision: 1339598

URL: http://svn.apache.org/viewvc?rev=1339598&view=rev
Log:
dashboard: limit activity items to configureable default - #72

Modified:
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/timeline.py

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/timeline.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/timeline.py?rev=1339598&r1=1339597&r2=1339598&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/timeline.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/timeline.py Thu May
17 13:36:13 2012
@@ -29,6 +29,7 @@ from itertools import imap, islice
 
 from genshi.builder import tag
 from trac.core import implements, TracError
+from trac.config import IntOption
 from trac.timeline.web_ui import TimelineModule
 from trac.util.translation import _
 
@@ -41,6 +42,9 @@ from bhdashboard.util import WidgetBase,
 class TimelineWidget(WidgetBase):
     """Display activity feed.
     """
+    default_count = IntOption('widget_activity', 'limit', 25, 
+                        """Maximum number of items displayed by default""")
+
     def get_widget_params(self, name):
         """Return a dictionary containing arguments specification for
         the widget with specified name.
@@ -66,7 +70,6 @@ class TimelineWidget(WidgetBase):
                         'type' : ListField()
                     },
                 'max' : {
-                        'default' : 0,
                         'desc' : """Limit the number of events displayed""",
                         'type' : int
                     },
@@ -83,6 +86,8 @@ class TimelineWidget(WidgetBase):
                         'max')
             start, days, user, precision, filters, count = \
                     self.bind_params(name, options, *params)
+            if count is None:
+                count = self.default_count
 
             fakereq = dummy_request(self.env, req.authname)
             fakereq.args = {



Mime
View raw message