changeset 5849:f7a570f3c1cb

theme: added RC RSS link for the front page, added page history RSS link for all other pages.
author Eugene Syromyatnikov <evgsyr@gmail.com>
date Wed, 16 May 2012 08:25:04 +0400
parents 468e63254a4a
children 8b4f02226670
files MoinMoin/theme/__init__.py
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Thu May 17 02:43:08 2012 +0400
+++ b/MoinMoin/theme/__init__.py	Wed May 16 08:25:04 2012 +0400
@@ -869,8 +869,10 @@
         """
         if not rss_supported:
             return False
-        return page.page_name == u'RecentChanges' or \
-           page.page_name == self.request.getText(u'RecentChanges')
+        return page.page_name in [u'RecentChanges',
+            self.request.getText(u'RecentChanges'),
+            self.request.cfg.page_front_page,
+            self.request.getText(self.request.cfg.page_front_page)]
 
     def rsshref(self, page):
         """ Create rss href, used for rss button and head link
@@ -899,6 +901,14 @@
                     u'href="%s" type="application/rss+xml">') % (
                         wikiutil.escape(self.cfg.sitename, True),
                         wikiutil.escape(self.rsshref(page), True) )
+        elif rss_supported:
+            link = (u'<link rel="alternate" title="%s: %s" '
+                    u'href="%s" type="application/rss+xml">') % (
+                        wikiutil.escape(self.cfg.sitename, True), page.page_name,
+                        wikiutil.escape(page.url(self.request, querystr={
+                            'action': 'rss_rc', 'ddiffs': '1', 'unique': '0',
+                            'diffs': '1', 'show_att': '1',
+                            'page': page.page_name }, escape=0), True) )
         return link
 
     def html_head(self, d):