Add "make user" button when viewing person w/ no user account
This commit is contained in:
parent
b26036f366
commit
2bbe6c8346
2 changed files with 68 additions and 5 deletions
27
tailbone/templates/people/view.mako
Normal file
27
tailbone/templates/people/view.mako
Normal file
|
@ -0,0 +1,27 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/master/view.mako" />
|
||||
|
||||
<%def name="extra_javascript()">
|
||||
${parent.extra_javascript()}
|
||||
% if not instance.users and request.has_perm('users.create'):
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#make-user').click(function() {
|
||||
if (confirm("Really make a user account for this person?")) {
|
||||
disable_button(this);
|
||||
$('form[name="make-user-form"]').submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
||||
|
||||
% if not instance.users and request.has_perm('users.create'):
|
||||
${h.form(url('people.make_user'), name='make-user-form')}
|
||||
${h.csrf_token(request)}
|
||||
${h.hidden('person_uuid', value=instance.uuid)}
|
||||
${h.end_form()}
|
||||
% endif
|
Loading…
Add table
Add a link
Reference in a new issue