diff --git a/tailbone/templates/people/view_profile_buefy.mako b/tailbone/templates/people/view_profile_buefy.mako index eb24cc29..79e51435 100644 --- a/tailbone/templates/people/view_profile_buefy.mako +++ b/tailbone/templates/people/view_profile_buefy.mako @@ -739,9 +739,14 @@ <%def name="render_customer_panel_buttons(customer)"> - % for button in customer_xref_buttons: - ${button} - % endfor + + {{ link.label }} + % if request.has_perm('customers.view'): View Customer diff --git a/tailbone/views/people.py b/tailbone/views/people.py index 75ddde05..2d85e5a7 100644 --- a/tailbone/views/people.py +++ b/tailbone/views/people.py @@ -420,6 +420,7 @@ class PersonView(MasterView): 'email_type_options': self.get_email_type_options(), 'max_lengths': self.get_max_lengths(), 'customers_data': self.get_context_customers(person), + # TODO: deprecate / remove this 'customer_xref_buttons': self.get_customer_xref_buttons(person), 'members_data': self.get_context_members(person), 'member_xref_buttons': self.get_member_xref_buttons(person), @@ -437,6 +438,7 @@ class PersonView(MasterView): template = 'view_profile_buefy' return self.render_to_response(template, context) + # TODO: deprecate / remove this def get_customer_xref_buttons(self, person): buttons = [] for supp in self.iter_view_supplements(): @@ -558,7 +560,7 @@ class PersonView(MasterView): data = [] for customer in customers: - data.append({ + context = { 'uuid': customer.uuid, '_key': getattr(customer, key), 'id': customer.id, @@ -570,7 +572,14 @@ class PersonView(MasterView): for p in customer.people], 'addresses': [self.get_context_address(a) for a in customer.addresses], - }) + 'external_links': [], + } + + for supp in self.iter_view_supplements(): + if hasattr(supp, 'get_context_for_customer'): + context = supp.get_context_for_customer(customer, context) + + data.append(context) return data