exodus: Move some exodus-specific code out of the site theme.
[matthijs/projects/wipi.git] / plugin / theme / exodus.py
index f8d9bb466ea9812af943846146fb0eb1f854ca4d..498e1f6dbf25868aaf1d1d2f94f1fbb8a5dd7452 100644 (file)
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-1 -*-
 """
     MoinMoin - modern theme
 
@@ -7,11 +6,40 @@
 """
 
 from site import SiteTheme
+from MoinMoin.theme import ThemeBase
 
 class Theme(SiteTheme):
 
     name = "exodus"
 
+    def html_head(self, d):
+        html = [
+            SiteTheme.html_head(self, d),
+            #self.theme_script('jquery-1.3.2.min'),
+            self.theme_script('jquery-1.3.2'),
+        ]
+        if d['page'].page_name == 'Site':
+            html.append(self.theme_script('homepage'))
+            html.append(self._stylesheet_link(True, 'screen', 'home'))
+
+        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'</div><!-- #page -->'
+        else:
+            return SiteTheme.endPage(self, d)
+
+
 def execute(request):
     """
     Generate and return a theme object
@@ -21,3 +49,5 @@ def execute(request):
     @return: Theme object
     """
     return Theme(request)
+
+# vim: set sw=4 sts=4 expandtab: