changeset 497:a4e59a30d352

merged main
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 11 Feb 2010 22:35:38 +0100
parents 0fc6d8edd693 (current diff) 73cf57f641a7 (diff)
children c5ffd7c05b90
files
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Thu Feb 11 22:34:09 2010 +0100
+++ b/data/plugin/action/CheckTranslation.py	Thu Feb 11 22:35:38 2010 +0100
@@ -11,7 +11,7 @@
     @license: GNU GPL, see COPYING for details.
 """
 
-import re, time
+import re, time, calendar
 from MoinMoin import i18n, search
 from MoinMoin.i18n import strings
 i18n.strings = strings
@@ -149,9 +149,13 @@
                         trans_status.append(_('/!\\ ##master-revision special comment can\'t be parsed. Value of special comment: "%s". Please use correct revision number.', wiki=True) % request.formatter.text(master_rev))
                     else:
                         if rev_num < orig_page_rev and translation_warnings['outdated_master_rev']:
-                            trans_status.append(_('(!) Translated page is outdated: it is based on revision %(trans_rev)s, but original page has revision %(orig_rev)s.', wiki=True) % {
+                            trans_status.append(_('(!) Translated page is outdated: it is based on revision %(trans_rev)s, but original page has revision %(orig_rev)s. %(diff_link)s.', wiki=True) % {
                                 'orig_rev': request.formatter.text(orig_page_rev),
                                 'trans_rev': request.formatter.text(master_rev),
+                                'diff_link': orig_page.link_to(request, on=1, querystr={
+                                    'action': 'diff',
+                                    'rev1': request.formatter.text(master_rev),
+                                    }) + request.formatter.text(_("Diff of original page")) + orig_page.link_to(request, on=0),
                             })
 
                 if 'date' in master_metas and translation_warnings['outdated_master_date']:
@@ -170,9 +174,13 @@
                         orig_date_s = time.strftime('%Y-%m-%d %H:%M:%S', orig_date)
 
                         if master_date < orig_date:
-                            trans_status.append(_('(!) Translated page is outdated: it has master date %(master_date)s, but original page last edited at %(orig_date)s.', wiki=True) % {
+                            trans_status.append(_('(!) Translated page is outdated: it has master date %(master_date)s, but original page last edited at %(orig_date)s. %(diff_link)s.', wiki=True) % {
                                 'orig_date': request.formatter.text(orig_date_s),
                                 'master_date': request.formatter.text(time.strftime('%Y-%m-%d %H:%M:%S', master_date)),
+                                'diff_link': orig_page.link_to(request, on=1, querystr={
+                                    'action': 'diff',
+                                    'date': (calendar.timegm(master_date) * 1000000),
+                                    }) + request.formatter.text(_("Diff of original page")) + orig_page.link_to(request, on=0),
                             })
 
         data.addRow(("<br>".join(orig_status), "<br>".join(trans_status)))
--- a/data/plugin/macro/CollectLists.py	Thu Feb 11 22:34:09 2010 +0100
+++ b/data/plugin/macro/CollectLists.py	Thu Feb 11 22:35:38 2010 +0100
@@ -111,7 +111,7 @@
         filter_column_value = u''
 
     if search_expression is None:
-        search_expression = u'regex:title:%s/' % pagename
+        search_expression = u'regex:title:^%s/' % pagename
 
     search_result = search.searchPages(request, search_expression)
     pages = [title.page_name for title in search_result.hits]