
this starts to get things more aligned between wuttaweb and tailbone. the use case in mind so far is for a wuttaweb view to be included in a tailbone app. form and grid classes now have some new methods to match wuttaweb, so templates call the shared method names where possible. templates can no longer assume they have tailbone-native master view, form, grid etc. so must inspect context more closely in some cases.
45 lines
1.1 KiB
Mako
45 lines
1.1 KiB
Mako
## -*- 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])}
|
|
</%def>
|
|
|
|
<%def name="render_form()">
|
|
<div class="form">
|
|
<${form.vue_tagname} v-on:make-user="makeUser"></${form.vue_tagname}>
|
|
</div>
|
|
</%def>
|
|
|
|
<%def name="modify_this_page_vars()">
|
|
${parent.modify_this_page_vars()}
|
|
<script type="text/javascript">
|
|
|
|
${form.vue_component}.methods.clickMakeUser = function(event) {
|
|
this.$emit('make-user')
|
|
}
|
|
|
|
ThisPage.methods.makeUser = function(event) {
|
|
if (confirm("Really make a user account for this person?")) {
|
|
this.$refs.makeUserForm.submit()
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</%def>
|
|
|
|
<%def name="page_content()">
|
|
${parent.page_content()}
|
|
% if not instance.users and request.has_perm('users.create'):
|
|
${h.form(url('people.make_user'), ref='makeUserForm')}
|
|
${h.csrf_token(request)}
|
|
${h.hidden('person_uuid', value=instance.uuid)}
|
|
${h.end_form()}
|
|
% endif
|
|
</%def>
|
|
|
|
|
|
${parent.body()}
|
|
|
|
|