Add "view profile" helper for all person-related views
This commit is contained in:
parent
97345c9710
commit
80158ffa95
|
@ -1,5 +1,6 @@
|
||||||
## -*- coding: utf-8; -*-
|
## -*- coding: utf-8; -*-
|
||||||
<%inherit file="/master/view.mako" />
|
<%inherit file="/master/view.mako" />
|
||||||
|
<%namespace file="/util.mako" import="view_profiles_helper" />
|
||||||
|
|
||||||
<%def name="extra_javascript()">
|
<%def name="extra_javascript()">
|
||||||
${parent.extra_javascript()}
|
${parent.extra_javascript()}
|
||||||
|
@ -18,4 +19,9 @@
|
||||||
% endif
|
% endif
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
<%def name="object_helpers()">
|
||||||
|
${parent.object_helpers()}
|
||||||
|
${view_profiles_helper(instance.people)}
|
||||||
|
</%def>
|
||||||
|
|
||||||
${parent.body()}
|
${parent.body()}
|
||||||
|
|
10
tailbone/templates/employees/view.mako
Normal file
10
tailbone/templates/employees/view.mako
Normal file
|
@ -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])}
|
||||||
|
</%def>
|
||||||
|
|
||||||
|
${parent.body()}
|
|
@ -1,5 +1,6 @@
|
||||||
## -*- coding: utf-8; -*-
|
## -*- coding: utf-8; -*-
|
||||||
<%inherit file="/master/view.mako" />
|
<%inherit file="/master/view.mako" />
|
||||||
|
<%namespace file="/util.mako" import="view_profiles_helper" />
|
||||||
|
|
||||||
<%def name="extra_javascript()">
|
<%def name="extra_javascript()">
|
||||||
${parent.extra_javascript()}
|
${parent.extra_javascript()}
|
||||||
|
@ -17,6 +18,11 @@
|
||||||
% endif
|
% endif
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
<%def name="object_helpers()">
|
||||||
|
${parent.object_helpers()}
|
||||||
|
${view_profiles_helper([instance])}
|
||||||
|
</%def>
|
||||||
|
|
||||||
${parent.body()}
|
${parent.body()}
|
||||||
|
|
||||||
% if not instance.users and request.has_perm('users.create'):
|
% if not instance.users and request.has_perm('users.create'):
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
## -*- coding: utf-8; -*-
|
## -*- coding: utf-8; -*-
|
||||||
<%inherit file="/master/view.mako" />
|
<%inherit file="/master/view.mako" />
|
||||||
|
<%namespace file="/util.mako" import="view_profiles_helper" />
|
||||||
|
|
||||||
<%def name="extra_styles()">
|
<%def name="extra_styles()">
|
||||||
${parent.extra_styles()}
|
${parent.extra_styles()}
|
||||||
${h.stylesheet_link(request.static_url('tailbone:static/css/perms.css'))}
|
${h.stylesheet_link(request.static_url('tailbone:static/css/perms.css'))}
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
|
<%def name="object_helpers()">
|
||||||
|
${parent.object_helpers()}
|
||||||
|
% if instance.person:
|
||||||
|
${view_profiles_helper([instance.person])}
|
||||||
|
% endif
|
||||||
|
</%def>
|
||||||
|
|
||||||
${parent.body()}
|
${parent.body()}
|
||||||
|
|
21
tailbone/templates/util.mako
Normal file
21
tailbone/templates/util.mako
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
## -*- coding: utf-8; -*-
|
||||||
|
|
||||||
|
<%def name="view_profile_button(person)">
|
||||||
|
<div class="buttons">
|
||||||
|
${h.link_to(person, url('people.view_profile', uuid=person.uuid), class_='button')}
|
||||||
|
</div>
|
||||||
|
</%def>
|
||||||
|
|
||||||
|
<%def name="view_profiles_helper(people)">
|
||||||
|
% if request.has_perm('people.view_profile'):
|
||||||
|
<div class="object-helper">
|
||||||
|
<h3>Profiles</h3>
|
||||||
|
<div class="object-helper-content">
|
||||||
|
<p>View full profile for:</p>
|
||||||
|
% for person in people:
|
||||||
|
${view_profile_button(person)}
|
||||||
|
% endfor
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
% endif
|
||||||
|
</%def>
|
Loading…
Reference in a new issue