When shoing .label as item name add possible actors

This commit is contained in:
Benjamin Dauvergne 2011-06-14 17:38:55 +02:00 committed by Frédéric Péters
parent 71ae10bdd7
commit 293fbbc78d
1 changed files with 7 additions and 1 deletions

View File

@ -109,7 +109,13 @@ def graphviz(workflow, url_prefix='', select=None, svg=True,
next_id = status.id
print >>out, 'status%s -> status%s' % (i, next_id)
url = 'status/%s/items/%s/' % (i, item.id)
label = getattr(item, 'label', False) or item.render_as_line()
if hasattr(item, 'label'):
label = item.label
if hasattr(item, 'by'):
roles = render_list_of_roles(item.by)
label += ' %s %s' % (_('by'), roles)
else:
label = item.render_as_line()
label = textwrap.fill(label.replace('"', '\\"'), 20)
label = label.replace('\n', '\\n')
print >>out, '[label="%s"' % label,