Add a menu bar to the site theme.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 26 Nov 2008 15:37:14 +0000 (16:37 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 26 Nov 2008 15:37:14 +0000 (16:37 +0100)
The contents of the menu bar are taken from the Site/Menu page.

This commit also slighty changes other aspects of the time.

plugin/theme/site.py
static/exodus/css/common.css

index e9344851be65d92f702aa69a199296f8e569cbaf..21d8aa66c017d01608a633a9b5e0cdaf3a97b65c 100644 (file)
@@ -10,6 +10,7 @@
 """
 
 from MoinMoin.theme import ThemeBase
+from MoinMoin.Page import Page
 
 class SiteTheme(ThemeBase):
 
@@ -38,19 +39,19 @@ class SiteTheme(ThemeBase):
 
             # Header
             u'<div id="header">',
+            self.menu(d),
             #self.logo(),
-            self.searchform(d),
             #self.username(d),
-            u'<div id="locationline">',
+            #u'<div id="locationline">',
             #self.interwiki(d),
-            self.title(d),
-            u'</div>',
-            self.trail(d),
-            #self.navibar(d),
+            #self.title(d),
+            #u'</div>',
+            self.navibar(d),
             #u'<hr id="pageline">',
             #u'<div id="pageline"><hr style="display:none;"></div>',
             self.msg(d),
             self.editbar(d),
+            self.trail(d),
             u'</div>',
 
             # Post header custom html (not recommended)
@@ -106,6 +107,7 @@ class SiteTheme(ThemeBase):
             # Footer
             u'<div id="footer">',
             self.username(d),
+            self.searchform(d),
             #self.editbar(d),
             #self.credits(d),
             #self.showversion(d, **keywords),
@@ -116,6 +118,25 @@ class SiteTheme(ThemeBase):
             ]
         return u'\n'.join(html)
 
+    def menu(self, d):
+        """ Assemble a "main menu
+            
+            @param d: parameter dictionary
+            @rtype:   unicode
+            @return: menu html
+        """
+        items = Page(self.request, 'Site/Menu').data.split('\n')
+        
+        html = '<ul id="menubar">'
+
+        for item in items:
+            if (not item.startswith("#")):
+                (pagename, link) = self.splitNavilink(item)
+                html = html + ("<li class=\"menulink\">%s</li>" % link)
+        
+        html = html + '</ul>'
+
+        return html
 
 def execute(request):
     """
index ce511fc43a26d19932a6d398b8d1f6ede9ad9bc1..ad7b89d87e80af0987ee1f1808e6a9317f4e90c7 100644 (file)
@@ -456,5 +456,23 @@ TD.tip {
     text-align: right;
 }
 
+#menubar {
+       display: block;
+       margin-bottom: 60px;
+       margin-top: 30px;
+}
+
+#menubar li {
+       /* Hide the leading dots */
+       display: inline;
+       /* Put the menu items horizontal */
+       float: left;
+       /* Put some spacing between items */
+       padding: 0px 5px;
+       
+       font-size: +4pt;
+       font-weight: bold;
+}
+
 /* end MonthCalendar stuff */