changeset 393:f25101c236bb

optimized footer display and print view, removed some ancient code imported from: moin--main--1.5--patch-397
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 21 Jan 2006 19:57:05 +0000
parents 4680a68ccfb6
children 4d58b19bd3a7
files ChangeLog MoinMoin/Page.py MoinMoin/request.py MoinMoin/theme/__init__.py MoinMoin/theme/classic.py MoinMoin/wikiutil.py docs/CHANGES wiki/htdocs/classic/css/common.css wiki/htdocs/classic/css/print.css wiki/htdocs/modern/css/common.css wiki/htdocs/modern/css/print.css wiki/htdocs/rightsidebar/css/common.css wiki/htdocs/rightsidebar/css/print.css
diffstat 13 files changed, 71 insertions(+), 150 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jan 21 16:28:02 2006 +0000
+++ b/ChangeLog	Sat Jan 21 19:57:05 2006 +0000
@@ -2,6 +2,28 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-01-21 20:57:05 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-397
+
+    Summary:
+      optimized footer display and print view, removed some ancient code
+    Revision:
+      moin--main--1.5--patch-397
+
+    optimized footer display and print view, removed some ancient code
+    
+
+    modified files:
+     ChangeLog MoinMoin/Page.py MoinMoin/request.py
+     MoinMoin/theme/__init__.py MoinMoin/theme/classic.py
+     MoinMoin/wikiutil.py docs/CHANGES
+     wiki/htdocs/classic/css/common.css
+     wiki/htdocs/classic/css/print.css
+     wiki/htdocs/modern/css/common.css
+     wiki/htdocs/modern/css/print.css
+     wiki/htdocs/rightsidebar/css/common.css
+     wiki/htdocs/rightsidebar/css/print.css
+
+
 2006-01-21 17:28:02 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-396
 
     Summary:
--- a/MoinMoin/Page.py	Sat Jan 21 16:28:02 2006 +0000
+++ b/MoinMoin/Page.py	Sat Jan 21 19:57:05 2006 +0000
@@ -1330,7 +1330,6 @@
                     request.log('page cache failed after creation')
                     self.format(parser)
         
-        self.updateFooterFragments(request)        
         request.clock.stop('send_page_content')
 
     def format(self, parser):
@@ -1388,19 +1387,6 @@
         self.cache_mtime = cache.mtime()
         return code
 
-    def updateFooterFragments(self, request):
-        """ Add a DeleteCache to footer fragments
-        
-        TODO: move this into theme (currently used only by classic)
-        """
-        _ = request.getText
-        url = wikiutil.quoteWikinameURL(self.page_name) + '?action=refresh'
-        link = wikiutil.link_tag(request, url, _("DeleteCache", formatted=0))
-        cache = caching.CacheEntry(request, self, self.getFormatterName())
-        date = request.user.getFormattedDateTime(cache.mtime())
-        fragment = link + ' ' +  _('(cached %s)') % date
-        request.add2footer('DeleteCache', fragment)
-
     def _emptyPageText(self, request):
         """
         Output the default page content for new pages.
--- a/MoinMoin/request.py	Sat Jan 21 16:28:02 2006 +0000
+++ b/MoinMoin/request.py	Sat Jan 21 19:57:05 2006 +0000
@@ -454,7 +454,6 @@
         # during the rendering of a page by lang macros
         self.current_lang = self.cfg.language_default
 
-        self._footer_fragments = {}
         self._all_pages = None
         # caches unique ids
         self._page_ids = {}
@@ -506,11 +505,6 @@
         self.content_lang = lang
         self.current_lang = lang
 
-    def add2footer(self, key, htmlcode):
-        """ Add a named HTML fragment to the footer, after the default links
-        """
-        self._footer_fragments[key] = htmlcode
-
     def getPragma(self, key, defval=None):
         """ Query a pragma value (#pragma processing instruction)
 
--- a/MoinMoin/theme/__init__.py	Sat Jan 21 16:28:02 2006 +0000
+++ b/MoinMoin/theme/__init__.py	Sat Jan 21 19:57:05 2006 +0000
@@ -266,7 +266,6 @@
                 # Just use the text as is.
                 pagename = title = text
 
-
         # Handle regular pagename like "FrontPage"
         else:
             # Use localized pages for the current user
@@ -617,9 +616,9 @@
     def pageinfo(self, page):
         """ Return html fragment with page meta data
 
-        Since page information use translated text, it use the ui
+        Since page information uses translated text, it uses the ui
         language and direction. It looks strange sometimes, but
-        translated text using page direction look worse.
+        translated text using page direction looks worse.
         
         @param page: current page
         @rtype: unicode
@@ -634,6 +633,10 @@
                     info = _("last edited %(time)s by %(editor)s") % info
                 else:
                     info = _("last modified %(time)s") % info
+                pagename = page.page_name
+                if self.request.cfg.show_interwiki:
+                    pagename = "%s: %s" % (self.request.cfg.interwikiname, pagename)
+                info = "%s  (%s)" % (pagename, info)
                 html = '<p id="pageinfo" class="info"%(lang)s>%(info)s</p>\n' % {
                     'lang': self.ui_lang_attr(),
                     'info': info
@@ -695,7 +698,7 @@
         """
         html = ''
         if self.cfg.show_version and not keywords.get('print_mode', 0):
-            html = (u'<div id="version">MoinMoin %s, Copyright 2000-2005 by '
+            html = (u'<div id="version">MoinMoin %s, Copyright 2000-2006 by '
                     'Juergen Hermann</div>') % (version.revision,)
         return html
 
--- a/MoinMoin/theme/classic.py	Sat Jan 21 16:28:02 2006 +0000
+++ b/MoinMoin/theme/classic.py	Sat Jan 21 19:57:05 2006 +0000
@@ -13,6 +13,7 @@
 """
 
 from MoinMoin import wikiutil, version
+from MoinMoin import caching
 from MoinMoin.theme import ThemeBase
 from MoinMoin.Page import Page
 
@@ -32,7 +33,9 @@
         @rtype: unicode
         @return: page footer html
         """
+        page = d['page']
         parts = [# End of page
+                 self.pageinfo(page),
                  self.endPage(),
 
                  # Pre footer custom html (not recommended!)
@@ -51,7 +54,6 @@
         if not self.shouldShowEditbar(d['page']):
             return ''
         parts = [u'<div id="footer">',
-                 self.footer_fragments(d, **keywords),
                  self.edit_link(d, **keywords),
                  self.availableactions(d),
                  u'</div>',]
@@ -168,21 +170,7 @@
         @return: edittext link html
         """
         page = d['page']
-        return  u'<ul class="editbar"><li>%s</li><li>%s</li></ul>' % (
-                    self.editorLink(page), self.pageinfo(page))
-
-    def footer_fragments(self, d, **keywords):
-        """
-        assemble HTML code fragments added by the page formatters
-        
-        @param d: parameter dictionary
-        @rtype: string
-        @return: footer fragments html
-        """
-        html = ''
-        if d['footer_fragments']:
-            html = ''.join(d['footer_fragments'].values())
-        return html
+        return  u'<ul class="editbar"><li>%s</li></ul>' % self.editorLink(page)
 
     def availableactions(self, d):    
         """
@@ -194,12 +182,12 @@
         """
         request = self.request
         _ = request.getText
-        html = ''
-        available = request.getAvailableActions(d['page'])
+        html = []
+        page = d['page']
+        available = request.getAvailableActions(page)
         if available:
             available = available.keys()
             available.sort()
-            html = []
             for action in available:
                 # Always add spaces: AttachFile -> Attach File 
                 # XXX TODO do not make a page object just for split_title
@@ -210,7 +198,15 @@
                 link = wikiutil.link_tag(request, params, title)
                 html.append(link)
                 
-            html = u'<p>%s %s</p>\n' % (_('Or try one of these actions:'),
+        title = _("DeleteCache", formatted=False)
+        params = '%s?action=%s' % (d['page_name'], 'refresh')
+        link = wikiutil.link_tag(request, params, title)
+        
+        cache = caching.CacheEntry(request, page, page.getFormatterName())
+        date = request.user.getFormattedDateTime(cache.mtime())
+        deletecache = u'<p>%s %s</p>' % (link, _('(cached %s)') % date)
+
+        html = deletecache + u'<p>%s %s</p>\n' % (_('Or try one of these actions:'),
                                        u', '.join(html))
         return html
 
--- a/MoinMoin/wikiutil.py	Sat Jan 21 16:28:02 2006 +0000
+++ b/MoinMoin/wikiutil.py	Sat Jan 21 19:57:05 2006 +0000
@@ -1395,8 +1395,6 @@
         request.write(theme.pageinfo(d['page']))
         request.write(theme.endPage())
     else:
-        # This is used only by classic now, kill soon
-        d['footer_fragments'] = request._footer_fragments
         request.write(theme.footer(d, **keywords))
 
     
--- a/docs/CHANGES	Sat Jan 21 16:28:02 2006 +0000
+++ b/docs/CHANGES	Sat Jan 21 19:57:05 2006 +0000
@@ -39,6 +39,8 @@
       is 25, of course.
     * removed unused kwargs showpage/editable/form from wikiutil.send_footer
     * updated i18n (translation texts, additional languages)
+    * removed interwiki:pagename from print view's top of page, added it to
+      the "lasted edited" line at bottom right.
 
 
 Version 1.5.0:
--- a/wiki/htdocs/classic/css/common.css	Sat Jan 21 16:28:02 2006 +0000
+++ b/wiki/htdocs/classic/css/common.css	Sat Jan 21 19:57:05 2006 +0000
@@ -134,6 +134,11 @@
 .footnotes li {
 }
 
+.info {
+    float: right;
+    font-size: 0.7em;
+    color: gray;
+}
 
 /* eye catchers */
 .warning 
--- a/wiki/htdocs/classic/css/print.css	Sat Jan 21 16:28:02 2006 +0000
+++ b/wiki/htdocs/classic/css/print.css	Sat Jan 21 19:57:05 2006 +0000
@@ -24,6 +24,10 @@
 	text-decoration: underline;
 }
 
+.info a {
+    color: gray;
+}
+
 pre {
 	font-size: 10pt;
 }
@@ -43,40 +47,7 @@
 
 /* user interface styles */
 
-#header, #sidebar, #footer, #timings, #credits {
+#header, #sidebar, #footer, #timings, #credits, #interwiki, #pagelocation {
 	display: none;
 }
 
-#interwiki {
-    float: left;
-    margin: 0;
-    padding: 0;
-    font-size: 0.4em;
-}
-
-*[dir="rtl"] #interwiki {
-    float: right;
-}
-
-#interwiki span:after {
-    content: ": ";
-}
-
-#pagelocation {
-    clear: right;
-    display: block;
-    margin: 0;
-    padding: 0;
-    font-size: 0.4em;
-}
-
-*[dir="rtl"] #pagelocation {
-    clear: left;
-}
-
-#pagelocation li {
-    display: inline;
-    padding: 0 0.3em;
-    margin: 0;
-}
-
--- a/wiki/htdocs/modern/css/common.css	Sat Jan 21 16:28:02 2006 +0000
+++ b/wiki/htdocs/modern/css/common.css	Sat Jan 21 19:57:05 2006 +0000
@@ -158,7 +158,8 @@
 }
 
 .info {
-    font-size: 0.85em;
+    float: right;
+    font-size: 0.7em;
     color: gray;
 }
 
--- a/wiki/htdocs/modern/css/print.css	Sat Jan 21 16:28:02 2006 +0000
+++ b/wiki/htdocs/modern/css/print.css	Sat Jan 21 19:57:05 2006 +0000
@@ -24,6 +24,10 @@
 	text-decoration: underline;
 }
 
+.info a {
+    color: gray;
+}
+
 pre {
 	font-size: 10pt;
 }
@@ -43,40 +47,7 @@
 
 /* user interface styles */
 
-#header, #sidebar, #footer, #timings, #credits {
+#header, #sidebar, #footer, #timings, #credits, #interwiki, #pagelocation {
 	display: none;
 }
 
-#interwiki {
-    float: left;
-    margin: 0;
-    padding: 0;
-    font-size: 0.4em;
-}
-
-*[dir="rtl"] #interwiki {
-    float: right;
-}
-
-#interwiki span:after {
-    content: ": ";
-}
-
-#pagelocation {
-    clear: right;
-    display: block;
-    margin: 0;
-    padding: 0;
-    font-size: 0.4em;
-}
-
-*[dir="rtl"] #pagelocation {
-    clear: left;
-}
-
-#pagelocation li {
-    display: inline;
-    padding: 0 0.3em;
-    margin: 0;
-}
-
--- a/wiki/htdocs/rightsidebar/css/common.css	Sat Jan 21 16:28:02 2006 +0000
+++ b/wiki/htdocs/rightsidebar/css/common.css	Sat Jan 21 19:57:05 2006 +0000
@@ -136,7 +136,8 @@
 }
 
 .info {
-    font-size: 0.85em;
+    float: right;
+    font-size: 0.7em;
     color: gray;
 }
 
--- a/wiki/htdocs/rightsidebar/css/print.css	Sat Jan 21 16:28:02 2006 +0000
+++ b/wiki/htdocs/rightsidebar/css/print.css	Sat Jan 21 19:57:05 2006 +0000
@@ -24,6 +24,10 @@
 	text-decoration: underline;
 }
 
+.info a {
+    color: gray;
+}
+
 pre {
 	font-size: 10pt;
 }
@@ -43,40 +47,7 @@
 
 /* user interface styles */
 
-#header, #sidebar, #footer, #timings, #credits {
+#header, #sidebar, #footer, #timings, #credits, #interwiki, #pagelocation {
 	display: none;
 }
 
-#interwiki {
-    float: left;
-    margin: 0;
-    padding: 0;
-    font-size: 0.4em;
-}
-
-*[dir="rtl"] #interwiki {
-    float: right;
-}
-
-#interwiki span:after {
-    content: ": ";
-}
-
-#pagelocation {
-    clear: right;
-    display: block;
-    margin: 0;
-    padding: 0;
-    font-size: 0.4em;
-}
-
-*[dir="rtl"] #pagelocation {
-    clear: left;
-}
-
-#pagelocation li {
-    display: inline;
-    padding: 0 0.3em;
-    margin: 0;
-}
-