changeset 161:65efc38c4e23

separated interwiki display into an own div and made its display configurable via show_interwiki [1] imported from: moin--main--1.5--patch-163
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 30 Oct 2005 11:18:15 +0000
parents b18ec46a7b1d
children e8da71f39a92
files MoinMoin/multiconfig.py MoinMoin/theme/__init__.py MoinMoin/theme/classic.py MoinMoin/theme/modern.py MoinMoin/theme/rightsidebar.py docs/CHANGES wiki/htdocs/classic/css/screen.css wiki/htdocs/modern/css/screen.css wiki/htdocs/rightsidebar/css/screen.css
diffstat 9 files changed, 73 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/multiconfig.py	Sun Oct 30 09:44:47 2005 +0000
+++ b/MoinMoin/multiconfig.py	Sun Oct 30 11:18:15 2005 +0000
@@ -288,6 +288,7 @@
     rss_cache = 60 # suggested caching time for RecentChanges RSS, in seconds
     shared_intermap = None # can be string or list of strings (filenames)
     show_hosts = 1
+    show_interwiki = 1
     show_section_numbers = 0
     show_timings = 0
     show_version = 0
--- a/MoinMoin/theme/__init__.py	Sun Oct 30 09:44:47 2005 +0000
+++ b/MoinMoin/theme/__init__.py	Sun Oct 30 11:18:15 2005 +0000
@@ -145,9 +145,25 @@
             logo = wikiutil.link_tag(self.request, pagename, self.cfg.logo_string)
             html = u'''<div id="logo">%s</div>''' % logo
         return html
+
+    def interwiki(self, d):
+        """ Assemble the interwiki name display, linking to page_front_page
+        
+        @param d: parameter dictionary
+        @rtype: string
+        @return: interwiki html
+        """
+        html = u''
+        if self.request.cfg.show_interwiki:
+            # Show our interwikiname or Self (and link to page_front_page)
+            pagename = wikiutil.getFrontPage(self.request).page_name
+            pagename = wikiutil.quoteWikinameURL(pagename)
+            link = wikiutil.link_tag(self.request, pagename, self.request.cfg.interwikiname or 'Self')
+            html = u'<div id="interwiki">%s</div>' % link
+        return html
         
     def title(self, d):
-        """ Assemble the title (now using breadcrumbs and interwiki info)
+        """ Assemble the title (now using breadcrumbs)
         
         @param d: parameter dictionary
         @rtype: string
@@ -155,12 +171,6 @@
         """
         _ = self.request.getText
         content = []
-        # Show our interwikiname or Self (and link to page_front_page)
-        pagename = wikiutil.getFrontPage(self.request).page_name
-        pagename = wikiutil.quoteWikinameURL(pagename)
-        link = wikiutil.link_tag(self.request, pagename, self.request.cfg.interwikiname or 'Self')
-        content.append(u"<li>%s</li>" % link)
-        
         if d['title_link']:
             curpage = ''
             segments = d['title_text'].split('/')
--- a/MoinMoin/theme/classic.py	Sun Oct 30 09:44:47 2005 +0000
+++ b/MoinMoin/theme/classic.py	Sun Oct 30 11:18:15 2005 +0000
@@ -94,6 +94,7 @@
             'config_header2_html': self.emit_custom_html(self.cfg.page_header2),
             'search_form_html': self.searchform(d),
             'logo_html':  self.logo(),
+            'interwiki_html':  self.interwiki(d),
             'title_html':  self.title(d),
             'username_html':  self.username(d),
             'navibar_html': self.navibar(d),
@@ -110,6 +111,7 @@
 %(logo_html)s
 %(search_form_html)s
 %(username_html)s
+%(interwiki_html)s
 %(title_html)s
 %(trail_html)s
 %(iconbar_html)s
--- a/MoinMoin/theme/modern.py	Sun Oct 30 09:44:47 2005 +0000
+++ b/MoinMoin/theme/modern.py	Sun Oct 30 11:18:15 2005 +0000
@@ -28,6 +28,7 @@
             self.logo(),
             self.searchform(d),
             self.username(d),
+            self.interwiki(d),
             self.title(d),
             self.trail(d),
             self.navibar(d),
--- a/MoinMoin/theme/rightsidebar.py	Sun Oct 30 09:44:47 2005 +0000
+++ b/MoinMoin/theme/rightsidebar.py	Sun Oct 30 11:18:15 2005 +0000
@@ -69,6 +69,7 @@
             u'<div id="header">',
             self.searchform(d),
             self.logo(),
+            self.interwiki(d),
             self.title(d),
             self.trail(d),
             u'</div>',
--- a/docs/CHANGES	Sun Oct 30 09:44:47 2005 +0000
+++ b/docs/CHANGES	Sun Oct 30 11:18:15 2005 +0000
@@ -194,7 +194,8 @@
   Theme changes:
     * logo_string is now should be really only the logo (img).
       If you included your wiki's name in logo_string you maybe want to remove
-      it now as it is shown as part of the location display now anyway.
+      it now as it is shown as part of the location display now anyway (when
+      show_interwiki = 1).
     * You maybe want to remove page_front_page from your navi_bar - we link to
       that page now from the logo and (new) from the interwiki name displayed
       in location display, so you maybe don't need it in navi_bar, too.
@@ -205,6 +206,9 @@
      * remove "#title h1 ..." CSS, not used any more.
      * maybe move both title() and trail() to header area, like the builtin
        themes do it.
+     * there is a new interwiki() base theme method that optionally (when
+       show_interwiki = 1) shows the interwiki name of this wiki and links to
+       page_front_page. The css for it is #interwiki.
 
   Developer notes:    
     * Plugin API was improved. When plugin module is missing,
--- a/wiki/htdocs/classic/css/screen.css	Sun Oct 30 09:44:47 2005 +0000
+++ b/wiki/htdocs/classic/css/screen.css	Sun Oct 30 11:18:15 2005 +0000
@@ -115,6 +115,21 @@
     clear: left;
 }
 
+#interwiki {
+    float: left;
+    margin: 8px 0;
+    padding: 0 2px;
+    font-size: 18px;
+}
+
+*[dir="rtl"] #interwiki {
+    float: right;
+}
+
+#interwiki :after {
+    content: ": ";
+}
+
 #pagelocation {
     clear: right;
     display: block;
@@ -157,11 +172,6 @@
     content: "";
 }
 
-#pagelocation li:first-child:after {
-    content: ": ";
-}
-
-
 #iconbar {
 	clear: both;
 	float: right;
--- a/wiki/htdocs/modern/css/screen.css	Sun Oct 30 09:44:47 2005 +0000
+++ b/wiki/htdocs/modern/css/screen.css	Sun Oct 30 11:18:15 2005 +0000
@@ -122,6 +122,21 @@
     clear: left;
 }
 
+#interwiki {
+    float: left;
+    margin: 8px 0;
+    padding: 0 2px;
+    font-size: 18px;
+}
+
+*[dir="rtl"] #interwiki {
+    float: right;
+}
+
+#interwiki :after {
+    content: ": ";
+}
+
 #pagelocation {
     clear: right;
     display: block;
@@ -164,10 +179,6 @@
     content: "";
 }
 
-#pagelocation li:first-child:after {
-    content: ": ";
-}
-
 #navibar {
     clear: both;  /* problem: clear: right; aligns nicely right of logo,
                     but lets it float high in the header, disconnected from ground */
--- a/wiki/htdocs/rightsidebar/css/screen.css	Sun Oct 30 09:44:47 2005 +0000
+++ b/wiki/htdocs/rightsidebar/css/screen.css	Sun Oct 30 11:18:15 2005 +0000
@@ -84,7 +84,7 @@
 }
 
 #sidebar {
-        display: inline;
+    display: inline;
 	margin: 10px;
 	float: right;
 	clear: right;
@@ -165,6 +165,21 @@
     clear: left;
 }
 
+#interwiki {
+    float: left;
+    margin: 8px 0;
+    padding: 0 2px;
+    font-size: 18px;
+}
+
+*[dir="rtl"] #interwiki {
+    float: right;
+}
+
+#interwiki :after {
+    content: ": ";
+}
+
 #pagelocation {
     clear: right;
     display: block;
@@ -207,10 +222,6 @@
     content: "";
 }
 
-#pagelocation li:first-child:after {
-    content: ": ";
-}
-
 #navibar li.current {
 	border: none;
 	background: #BFAE8F;