changeset 3290:abb32b0af96b

revision history: enable the user to get more revisions show by using max_count=123, enable wiki admin to limit that
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 17 Mar 2008 17:17:54 +0100
parents dd6ace16bc8f
children 69e39cb66e38
files MoinMoin/action/info.py MoinMoin/config/multiconfig.py docs/CHANGES
diffstat 3 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/info.py	Mon Mar 17 16:46:41 2008 +0100
+++ b/MoinMoin/action/info.py	Mon Mar 17 17:17:54 2008 +0100
@@ -5,7 +5,7 @@
     Displays page history, some general page infos and statistics.
 
     @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
-                2006-2007 MoinMoin:ThomasWaldmann
+                2006-2008 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -74,6 +74,12 @@
     def history(page, pagename, request):
         # show history as default
         _ = request.getText
+        default_count, limit_max_count = request.cfg.history_count
+        try:
+            max_count = int(request.form.get('max_count', [default_count])[0])
+        except:
+            max_count = default_count
+        max_count = min(max_count, limit_max_count)
 
         # open log for this page
         from MoinMoin.util.dataset import TupleDataset, Column
@@ -151,7 +157,7 @@
                 "&nbsp;".join(actions),
             ))
             count += 1
-            if count >= 100:
+            if count >= max_count:
                 break
 
         # print version history
--- a/MoinMoin/config/multiconfig.py	Mon Mar 17 16:46:41 2008 +0100
+++ b/MoinMoin/config/multiconfig.py	Mon Mar 17 17:17:54 2008 +0100
@@ -333,6 +333,8 @@
     html_head_normal  = '''<meta name="robots" content="index,nofollow">\n'''
     html_pagetitle = None
 
+    history_count = (100, 200) # (default_revisions_shown, max_revisions_shown)
+
     interwiki_preferred = [] # list of wiki names to show at top of interwiki list
 
     language_default = 'en'
--- a/docs/CHANGES	Mon Mar 17 16:46:41 2008 +0100
+++ b/docs/CHANGES	Mon Mar 17 17:17:54 2008 +0100
@@ -95,6 +95,10 @@
     * DocBook-formatter has support for the MoinMoin comment element, though
       only inline comments are likely to be valid since the DocBook remark is
       and inline element.
+    * ?action=info&max_count=42 - show the last 42 history entries of the page.
+      max_count has a default of default_count and a upper limit of
+      limit_max_count - you can configure both in your wiki config:
+      cfg.history_count = (100, 200) # (default_count, limit_max_count) default
 
   Other changes:
     * cfg.show_login is gone, see code in theme/__init__.py, this affects