X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=roundup%2Fcgi%2Ftemplating.py;h=cfe998e01dd97b4d149e654d29b8e1581bb57b2d;hb=9f96bccb32cae3de034a552084ddad6c9f94b29a;hp=9f24a19fe400831077aebdc1b7f8886d62661b2f;hpb=00fff27257d55a1f7b2fc6daaa6e1fb037e8fb91;p=roundup.git diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 9f24a19..cfe998e 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -126,10 +126,10 @@ class RoundupPageTemplate(PageTemplate.PageTemplate): - methods for easy filterspec link generation - *user*, the current user node as an HTMLItem instance - *form*, the current CGI form information as a FieldStorage - *tracker* - The current tracker + *config* + The current tracker config. *db* - The current database, through which db.config may be reached. + The current database, used to access arbitrary database items. ''' def getContext(self, client, classname, request): c = { @@ -137,6 +137,7 @@ class RoundupPageTemplate(PageTemplate.PageTemplate): 'nothing': None, 'request': request, 'db': HTMLDatabase(client), + 'config': client.instance.config, 'tracker': client.instance, 'utils': TemplatingUtils(client), 'templates': Templates(client.instance.config.TEMPLATES), @@ -489,7 +490,7 @@ class HTMLItem(HTMLPermissions): # XXX do this return [] - def history(self, direction='descending'): + def history(self, direction='descending', dre=re.compile('\d+')): l = ['' ''%( date_s, user, action, arg_s)) if comments:
', _('History'), @@ -628,6 +629,10 @@ class HTMLItem(HTMLPermissions): handled by the history display!''') arg_s = '' + str(args) + '' date_s = date_s.replace(' ', ' ') + # if the user's an itemid, figure the username (older journals + # have the username) + if dre.match(user): + user = self._db.user.get(user, 'username') l.append('
%s%s%s%s