diff --git a/tailbone/forms/renderers/employees.py b/tailbone/forms/renderers/employees.py index 0a9d7e55..ead3c93a 100644 --- a/tailbone/forms/renderers/employees.py +++ b/tailbone/forms/renderers/employees.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2015 Lance Edgar +# Copyright © 2010-2017 Lance Edgar # # This file is part of Rattail. # @@ -24,9 +24,11 @@ Employee Field Renderers """ -from __future__ import unicode_literals +from __future__ import unicode_literals, absolute_import -from .common import AutocompleteFieldRenderer +from webhelpers.html import tags + +from tailbone.forms.renderers import AutocompleteFieldRenderer class EmployeeFieldRenderer(AutocompleteFieldRenderer): @@ -39,4 +41,7 @@ class EmployeeFieldRenderer(AutocompleteFieldRenderer): employee = self.raw_value if not employee: return '' - return unicode(employee.person) + title = unicode(employee.person) + if self.request.has_perm('employees.view'): + return tags.link_to(title, self.request.route_url('employees.view', uuid=employee.uuid)) + return title