diff --git a/tailbone/templates/customers/view.mako b/tailbone/templates/customers/view.mako index 7ec2662e..6c9de1ce 100644 --- a/tailbone/templates/customers/view.mako +++ b/tailbone/templates/customers/view.mako @@ -21,7 +21,7 @@ <%def name="object_helpers()"> ${parent.object_helpers()} - % if instance.people: + % if show_profiles_helper and instance.people: ${view_profiles_helper(instance.people)} % endif diff --git a/tailbone/views/customers.py b/tailbone/views/customers.py index cc473531..e8ada107 100644 --- a/tailbone/views/customers.py +++ b/tailbone/views/customers.py @@ -54,6 +54,9 @@ class CustomersView(MasterView): people_detachable = True touchable = True + # whether to show "view full profile" helper for customer view + show_profiles_helper = True + labels = { 'id': "ID", 'default_phone': "Phone Number", @@ -245,6 +248,10 @@ class CustomersView(MasterView): f.set_renderer('groups', self.render_groups) f.set_readonly('groups') + def template_kwargs_view(self, **kwargs): + kwargs['show_profiles_helper'] = self.show_profiles_helper + return kwargs + def unique_id(self, node, value): query = self.Session.query(model.Customer)\ .filter(model.Customer.id == value)