index 9f24a19fe400831077aebdc1b7f8886d62661b2f..cfe998e01dd97b4d149e654d29b8e1581bb57b2d 100644 (file)
- methods for easy filterspec link generation
- *user*, the current user node as an HTMLItem instance
- *form*, the current CGI form information as a FieldStorage
- 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*
*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 = {
'''
def getContext(self, client, classname, request):
c = {
'nothing': None,
'request': request,
'db': HTMLDatabase(client),
'nothing': None,
'request': request,
'db': HTMLDatabase(client),
+ 'config': client.instance.config,
'tracker': client.instance,
'utils': TemplatingUtils(client),
'templates': Templates(client.instance.config.TEMPLATES),
'tracker': client.instance,
'utils': TemplatingUtils(client),
'templates': Templates(client.instance.config.TEMPLATES),
# XXX do this
return []
# XXX do this
return []
- def history(self, direction='descending'):
+ def history(self, direction='descending', dre=re.compile('\d+')):
l = ['<table class="history">'
'<tr><th colspan="4" class="header">',
_('History'),
l = ['<table class="history">'
'<tr><th colspan="4" class="header">',
_('History'),
handled by the history display!</em></strong>''')
arg_s = '<strong><em>' + str(args) + '</em></strong>'
date_s = date_s.replace(' ', ' ')
handled by the history display!</em></strong>''')
arg_s = '<strong><em>' + str(args) + '</em></strong>'
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('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
date_s, user, action, arg_s))
if comments:
l.append('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>'%(
date_s, user, action, arg_s))
if comments: