diff --git a/tailbone/templates/customers/view.mako b/tailbone/templates/customers/view.mako index 27cc619c..23e8efde 100644 --- a/tailbone/templates/customers/view.mako +++ b/tailbone/templates/customers/view.mako @@ -1,5 +1,6 @@ ## -*- coding: utf-8; -*- <%inherit file="/master/view.mako" /> +<%namespace file="/util.mako" import="view_profiles_helper" /> <%def name="extra_javascript()"> ${parent.extra_javascript()} @@ -18,4 +19,9 @@ % endif +<%def name="object_helpers()"> + ${parent.object_helpers()} + ${view_profiles_helper(instance.people)} + + ${parent.body()} diff --git a/tailbone/templates/employees/view.mako b/tailbone/templates/employees/view.mako new file mode 100644 index 00000000..f9e54bd8 --- /dev/null +++ b/tailbone/templates/employees/view.mako @@ -0,0 +1,10 @@ +## -*- coding: utf-8; -*- +<%inherit file="/master/view.mako" /> +<%namespace file="/util.mako" import="view_profiles_helper" /> + +<%def name="object_helpers()"> + ${parent.object_helpers()} + ${view_profiles_helper([instance.person])} + + +${parent.body()} diff --git a/tailbone/templates/people/view.mako b/tailbone/templates/people/view.mako index 72079db8..90ce5941 100644 --- a/tailbone/templates/people/view.mako +++ b/tailbone/templates/people/view.mako @@ -1,5 +1,6 @@ ## -*- coding: utf-8; -*- <%inherit file="/master/view.mako" /> +<%namespace file="/util.mako" import="view_profiles_helper" /> <%def name="extra_javascript()"> ${parent.extra_javascript()} @@ -17,6 +18,11 @@ % endif +<%def name="object_helpers()"> + ${parent.object_helpers()} + ${view_profiles_helper([instance])} + + ${parent.body()} % if not instance.users and request.has_perm('users.create'): diff --git a/tailbone/templates/users/view.mako b/tailbone/templates/users/view.mako index c5b1980f..8477ebfa 100644 --- a/tailbone/templates/users/view.mako +++ b/tailbone/templates/users/view.mako @@ -1,9 +1,17 @@ ## -*- coding: utf-8; -*- <%inherit file="/master/view.mako" /> +<%namespace file="/util.mako" import="view_profiles_helper" /> <%def name="extra_styles()"> ${parent.extra_styles()} ${h.stylesheet_link(request.static_url('tailbone:static/css/perms.css'))} +<%def name="object_helpers()"> + ${parent.object_helpers()} + % if instance.person: + ${view_profiles_helper([instance.person])} + % endif + + ${parent.body()} diff --git a/tailbone/templates/util.mako b/tailbone/templates/util.mako new file mode 100644 index 00000000..dad82ba2 --- /dev/null +++ b/tailbone/templates/util.mako @@ -0,0 +1,21 @@ +## -*- coding: utf-8; -*- + +<%def name="view_profile_button(person)"> +
+ ${h.link_to(person, url('people.view_profile', uuid=person.uuid), class_='button')} +
+ + +<%def name="view_profiles_helper(people)"> + % if request.has_perm('people.view_profile'): +
+

Profiles

+
+

View full profile for:

+ % for person in people: + ${view_profile_button(person)} + % endfor +
+
+ % endif +