[Moin-user] Discussion/Comments and section editing?

Jim Wight j.k.wight at ncl.ac.uk
Fri Oct 21 00:39:40 EDT 2005


On Fri, 2005-10-21 at 08:22 +0200, Arp wrote:
> I had found the PageComment macro but as it appends the comments to
> the page it will probably make for messy printing if one only wants to
> print the article - so I figured it'd be nicer in a seperate page/tab.

I've made the following addition to .../MoinMoin/theme/__init__.py in
order to achieve that :

        # Format
        items = '\n'.join(['<li>%s</li>' % item for item in links if item != ''])

+        if not quotedname.endswith('/Comment'):
+            if Page(request, quotedname + '/Comment').isStandardPage(False):
+                items= items + '\n<li>%s</li>' % link(request, quotedname + '/Comment', _('Comment', formatted=False))
+            else:
+                items= items + '\n<li class="nocomment">%s</li>' % link(request, quotedname + '/Comment', _('Comment', formatted=False))

        html = u'<ul class="editbar">\n%s\n</ul>\n' % items


This gives a 'Comment' tab to the right of the 'More Actions' menu for
accessing a '/Comment' subpage. CSS is used to show the text in red as
in MediaWiki if the page doesn't exist (class=nocomment).

Jim






More information about the Moin-user mailing list