# HG changeset patch # User Paul Boddie # Date 1196035981 -3600 # Node ID e34c08c0a4ec474be09f8797fdc1f31a3a38b7b4 # Parent c92dd64f4a8e787ceea95a1d9346aa8f46b459de Added a "site updates" macro, which is a much simpler summary of changes than that provided by the "recent changes" macro. diff -r c92dd64f4a8e -r e34c08c0a4ec macros/SiteUpdates.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros/SiteUpdates.py Mon Nov 26 01:13:01 2007 +0100 @@ -0,0 +1,60 @@ +# -*- coding: iso-8859-1 -*- +""" + MoinMoin - SiteUpdates Macro + + Inspired by the RecentChanges macro + + @copyright: 2007 by Paul Boddie + @license: GNU GPL, see COPYING for details. +""" + +from MoinMoin.Page import Page +from MoinMoin.logfile import editlog + +Dependencies = [] + +MAX_ENTRIES = 5 + +def execute(macro, args): + request = macro.request + + max_entries = MAX_ENTRIES + args = args.split(",") + if args: + try: + max_entries = int(args[0]) + except ValueError: + pass + + pages = {} + log = editlog.EditLog(request) + + for line in log.reverse(): + + if not request.user.may.read(line.pagename): + continue + + pages[line.pagename] = line + + if len(pages.keys()) >= max_entries: + break + + output = [] + + if pages: + output.append('\n') + + return ''.join(output) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r c92dd64f4a8e -r e34c08c0a4ec themes/ep2008/css/screen.css --- a/themes/ep2008/css/screen.css Sun Nov 25 20:50:20 2007 +0100 +++ b/themes/ep2008/css/screen.css Mon Nov 26 01:13:01 2007 +0100 @@ -591,5 +591,11 @@ color: white; } +ul.site-updates { + list-style-type: none; + margin: 0; + padding: 0; +} + /* vim: tabstop=4 expandtab shiftwidth=4 */