changeset 365:951d12e53825

action.CheckTranslation: changed links for master to raw page and for the translated page to edit link. Another column of status data added (size and last editor).
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Wed, 15 Apr 2009 10:56:36 +0200
parents 5fbb949f75d2
children c53c862bd556
files data/plugin/action/CheckTranslation.py
diffstat 1 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/CheckTranslation.py	Wed Apr 15 09:19:04 2009 +0200
+++ b/data/plugin/action/CheckTranslation.py	Wed Apr 15 10:56:36 2009 +0200
@@ -31,12 +31,35 @@
     data.columns = [
            Column('en', label=_('Developer language')),
            Column(users_lang, label=_('Preferred language')),
+           Column('status', label=_('Status')),
         ]
 
+    edit_querystr = {'action': 'edit', 'editor': 'text'}
+    edit_attrs = {'name': 'editlink', 'rel': 'nofollow', }
+    raw_querystr = {'action': 'raw'}
+
     for page_name in SystemPages:
         master = Page(request, page_name)
         translated = Page(request, _(page_name))
-        data.addRow((master.link_to(request, page_name), translated.link_to(request, _(page_name))))
+        master_last_edit_info = master.lastEditInfo()
+        translated_last_edit_info = translated.lastEditInfo()
+
+        status = []
+        status.append("size: %s, %s" % (master.size(), translated.size()))
+        if master_last_edit_info != {}:
+            status.append('<hr>')
+            status.append("last master editor: %(editor)s" % master_last_edit_info)
+            status.append("last master edit time: %(time)s" % master_last_edit_info)
+
+        if translated_last_edit_info != {}:
+            status.append('<hr>')
+            status.append("last translation editor: %(editor)s" % translated_last_edit_info)
+            status.append("last translation edit time: %(time)s" % translated_last_edit_info)
+
+        status = '<br>'.join(status)
+        status = "%s</br>" % status
+        data.addRow((master.link_to(request, page_name, querystr=raw_querystr),
+                                    translated.link_to(request, _(page_name), querystr=edit_querystr, **edit_attrs), status))
 
     table = DataBrowserWidget(request)
     table.setData(data)