diff MoinMoin/themes/__init__.py @ 2864:7de85ecc3669

rework +tickets, add Update and Assignee columns, remove itemid and sort by age button
author RogerHaase <haaserd@gmail.com>
date Tue, 09 Dec 2014 07:45:40 -0700
parents 0b4b562f5b87
children ec34b7876eeb
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Wed Dec 03 12:56:05 2014 -0700
+++ b/MoinMoin/themes/__init__.py	Tue Dec 09 07:45:40 2014 -0700
@@ -22,7 +22,7 @@
 
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin import wikiutil, user
-from MoinMoin.constants.keys import USERID, ADDRESS, HOSTNAME, REVID, ITEMID, NAME_EXACT
+from MoinMoin.constants.keys import USERID, ADDRESS, HOSTNAME, REVID, ITEMID, NAME_EXACT, ASSIGNED_TO
 from MoinMoin.constants.contenttypes import CONTENTTYPES_MAP
 from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT, NAMESPACE_USERPROFILES, NAMESPACE_ALL
 from MoinMoin.search import SearchForm
@@ -539,6 +539,15 @@
     return result
 
 
+def get_assigned_to_info(meta):
+    display_name = ''
+    userid = meta.get(ASSIGNED_TO)
+    if userid:
+        u = user.User(userid)
+        display_name = u.display_name or u.name0
+    return display_name
+
+
 def shorten_fqname(fqname, length=25):
     """
     Shorten fqname
@@ -673,6 +682,7 @@
         'url_for_item': url_for_item,
         'get_fqname': get_fqname,
         'get_editor_info': lambda meta: get_editor_info(meta),
+        'get_assigned_to_info': lambda meta: get_assigned_to_info(meta),
         'utctimestamp': lambda dt: utctimestamp(dt),
         'gen': make_generator(),
         'search_form': SearchForm.from_defaults(),