changeset 1215:a8fb67cb953b

search info bar added, misc i18n fixes
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Wed, 02 Aug 2006 20:15:05 +0200
parents 53a1bd19196e
children 4c3b141bda6b
files MoinMoin/macro/SystemInfo.py MoinMoin/search/results.py wiki/htdocs/modern/css/common.css
diffstat 3 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/SystemInfo.py	Wed Aug 02 18:53:35 2006 +0200
+++ b/MoinMoin/macro/SystemInfo.py	Wed Aug 02 20:15:05 2006 +0200
@@ -17,7 +17,6 @@
 from MoinMoin import action, macro, parser
 from MoinMoin.logfile import editlog, eventlog
 from MoinMoin.Page import Page
-from MoinMoin.util import timefuncs
 
 def execute(Macro, args):
     """ show SystemInfo: wiki infos, wiki sw version, space usage infos """
@@ -118,11 +117,13 @@
     idx = Search._xapianIndex(request)
     available = idx and idxState[0] or idxState[1]
     mtime = _('last modified: %s') % (idx and
-            timefuncs.formathttpdate(idx.mtime()) or _('unavailable'))
+            request.user.getFormattedDateTime(
+                wikiutil.version2timestamp(idx.mtime())) or
+                _('N/A'))
     row(_('Xapian search'), '%s, %s, %s'
             % (xapState[request.cfg.xapian_search], available, mtime))
 
-    row(_('Active threads'), t_count or 'N/A')
+    row(_('Active threads'), t_count or _('N/A'))
     buf.write(u'</dl>')
 
     return Macro.formatter.rawHTML(buf.getvalue())
--- a/MoinMoin/search/results.py	Wed Aug 02 18:53:35 2006 +0200
+++ b/MoinMoin/search/results.py	Wed Aug 02 20:15:05 2006 +0200
@@ -378,6 +378,7 @@
         self._reset(request, formatter)
         f = formatter
         write = self.buffer.write
+        _ = request.getText
         
         # Add pages formatted as definition list
         if self.hits:
@@ -418,6 +419,17 @@
                     f.definition_desc(1),
                     fmt_context,
                     f.definition_desc(0),
+                    f.definition_desc(1, attr={'class': 'searchresinfobar'}),
+                    f.text('%.1fk - ' % (page.page.size()/1024.0)),
+                    f.text('rev: %d %s- ' % (page.page.get_real_rev(),
+                        not page.page.rev and '(%s) ' % _('current') or '')),
+                    f.text('last modified: %(time)s - ' % page.page.lastEditInfo()),
+                    # XXX: proper metadata
+                    #f.text('lang: %s - ' % page.page.language),
+                    f.url(1, href='#'),
+                    f.text(_('Similar pages')),
+                    f.url(0),
+                    f.definition_desc(0),
                     ]
                 write(''.join(item))
             write(f.definition_list(0))
@@ -652,7 +664,7 @@
             if n < 0: n = 0
             l.append(''.join([
                 f.url(1, href=from_uri(n)),
-                _('Previous Page'),
+                f.text(_('Previous Page')),
                 f.url(0)
             ]))
         if hitsFrom + hitsPerPage < hitsNum:    # next page available
@@ -660,7 +672,7 @@
             if n >= hitsNum: n = hitsNum - 1
             l.append(''.join([
                 f.url(1, href=from_uri(n)),
-                _('Next Page'),
+                f.text(_('Next Page')),
                 f.url(0)
             ]))
         return f.text(' | ').join(l)
--- a/wiki/htdocs/modern/css/common.css	Wed Aug 02 18:53:35 2006 +0200
+++ b/wiki/htdocs/modern/css/common.css	Wed Aug 02 20:15:05 2006 +0200
@@ -341,6 +341,11 @@
     font-size: 0.85em;
 }
 
+.searchresults dd.searchresinfobar {
+    color: #008000;
+    margin-left: 15px;
+}
+
 p.searchstats {
     font-size: 0.8em;
     text-align: right;