comparison data/plugin/action/CheckTranslation.py @ 375:005e0551b2c6

CheckTranslation: fixes and better rendering
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 19 Apr 2009 15:23:44 +0200
parents e93b8be38fcc
children 2425d9e491dc
comparison
equal deleted inserted replaced
374:e93b8be38fcc 375:005e0551b2c6
52 trans_page_name = trans(orig_page_name) 52 trans_page_name = trans(orig_page_name)
53 orig_page = Page(request, orig_page_name) 53 orig_page = Page(request, orig_page_name)
54 trans_page = Page(request, trans_page_name) 54 trans_page = Page(request, trans_page_name)
55 55
56 orig_status = ["Original:"] 56 orig_status = ["Original:"]
57 orig_status.append("size: %s" % orig_page.size()) 57 orig_status.append("size: %d" % orig_page.size())
58 last_edit = orig_page.lastEditInfo() 58 last_edit = orig_page.lastEditInfo()
59 orig_status.append(last_edit and "last edit: %(editor)s %(time)s" % last_edit or "") 59 if last_edit:
60 orig_status.append("last edit: %(editor)s %(time)s" % last_edit)
60 61
61 trans_status = ["Translation:"] 62 trans_status = ["Translation:"]
62 trans_status.append("size: %s, %s" % trans_page.size()) 63 trans_status.append("size: %d" % trans_page.size())
63 last_edit = trans_page.lastEditInfo() 64 last_edit = trans_page.lastEditInfo()
64 trans_status.append(last_edit and "last edit: %(editor)s %(time)s" % last_edit or "") 65 if last_edit:
66 trans_status.append("last edit: %(editor)s %(time)s" % last_edit)
65 67
66 status = orig_status + ["<hr>"] + trans_status 68 status = "<br>".join(orig_status) + "<hr>" + "<br>".join(trans_status)
67 data.addRow((orig_page.link_to(request, orig_page_name, querystr=raw_querystr), 69 data.addRow((orig_page.link_to(request, orig_page_name, querystr=raw_querystr),
68 trans_page.link_to(request, trans_page_name, querystr=edit_querystr, **edit_attrs), 70 trans_page.link_to(request, trans_page_name, querystr=edit_querystr, **edit_attrs),
69 '<br>'.join(status))) 71 status))
70 72
71 table = DataBrowserWidget(request) 73 table = DataBrowserWidget(request)
72 table.setData(data) 74 table.setData(data)
73 page_table = ''.join(table.format(method='GET')) 75 page_table = ''.join(table.format(method='GET'))
74 76