From 60b94304e6f704ae567056a9b8b41a7c2806f84e Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 19 Apr 2010 16:55:23 +0200 Subject: [PATCH] exodus: Move some exodus-specific code out of the site theme. --- plugin/theme/exodus.py | 17 +++++++++++++++++ plugin/theme/site.py | 16 ++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/plugin/theme/exodus.py b/plugin/theme/exodus.py index 5a27ef5..498e1f6 100644 --- a/plugin/theme/exodus.py +++ b/plugin/theme/exodus.py @@ -6,6 +6,7 @@ """ from site import SiteTheme +from MoinMoin.theme import ThemeBase class Theme(SiteTheme): @@ -23,6 +24,22 @@ class Theme(SiteTheme): return '\n'.join(html) + def startPage(self, d): + # For the homepage, don't use SiteTheme's changes + if d['page'].page_name == 'Site': + return ThemeBase.startPage(self) + else: + return SiteTheme.startPage(self, d) + + def endPage(self, d): + # For the homepage, don't use SiteTheme's changes, but also don't use + # ThemeBase, since that adds a #pagebottom. + if d['page'].page_name == 'Site': + return u'' + else: + return SiteTheme.endPage(self, d) + + def execute(request): """ Generate and return a theme object diff --git a/plugin/theme/site.py b/plugin/theme/site.py index 683272d..e3288c2 100644 --- a/plugin/theme/site.py +++ b/plugin/theme/site.py @@ -170,20 +170,16 @@ class SiteTheme(ThemeBase): return html def startPage(self, d): + # This opens up #page html = ThemeBase.startPage(self) - if d['page'].page_name != 'Site': - html += u'
\n' - html += u'
' + html += u'
\n' + html += u'
\n' return html def endPage(self, d): - if d['page'].page_name != 'Site': - html = u'
' - html += u'
' - html += u'
' - else: - html = u'' - #html += ThemeBase.endPage(self) + html = u'\n' + html += ThemeBase.endPage(self) + # This adds #pagebottom and closes #page return html def execute(request): -- 2.30.2