fix: tweak template for people/view_profile per wutta compat

wutta has the view defined but it returns minimal context
This commit is contained in:
Lance Edgar 2024-08-15 18:44:14 -05:00
parent bab09e3fe7
commit 1cacfab2a6

View file

@ -15,7 +15,7 @@
</%def> </%def>
<%def name="content_title()"> <%def name="content_title()">
${dynamic_content_title} ${dynamic_content_title or str(instance)}
</%def> </%def>
<%def name="render_instance_header_title_extras()"> <%def name="render_instance_header_title_extras()">
@ -1008,7 +1008,7 @@
<div style="display: flex; justify-content: space-between; width: 100%;"> <div style="display: flex; justify-content: space-between; width: 100%;">
<div style="flex-grow: 1;"> <div style="flex-grow: 1;">
<b-field horizontal label="${customer_key_label}"> <b-field horizontal label="${customer_key_label or 'TODO: Customer Key'}">
{{ customer._key }} {{ customer._key }}
</b-field> </b-field>
@ -1996,7 +1996,9 @@
<script type="text/javascript"> <script type="text/javascript">
let PersonalTabData = { let PersonalTabData = {
% if hasattr(master, 'profile_tab_personal'):
refreshTabURL: '${url('people.profile_tab_personal', uuid=person.uuid)}', refreshTabURL: '${url('people.profile_tab_personal', uuid=person.uuid)}',
% endif
// nb. hack to force refresh for vue3 // nb. hack to force refresh for vue3
refreshPersonalCard: 1, refreshPersonalCard: 1,
@ -2447,7 +2449,9 @@
<script type="text/javascript"> <script type="text/javascript">
let CustomerTabData = { let CustomerTabData = {
% if hasattr(master, 'profile_tab_customer'):
refreshTabURL: '${url('people.profile_tab_customer', uuid=person.uuid)}', refreshTabURL: '${url('people.profile_tab_customer', uuid=person.uuid)}',
% endif
customers: [], customers: [],
} }
@ -2521,7 +2525,9 @@
<script type="text/javascript"> <script type="text/javascript">
let EmployeeTabData = { let EmployeeTabData = {
% if hasattr(master, 'profile_tab_employee'):
refreshTabURL: '${url('people.profile_tab_employee', uuid=person.uuid)}', refreshTabURL: '${url('people.profile_tab_employee', uuid=person.uuid)}',
% endif
employee: {}, employee: {},
employeeHistory: [], employeeHistory: [],
@ -2756,7 +2762,9 @@
<script type="text/javascript"> <script type="text/javascript">
let NotesTabData = { let NotesTabData = {
% if hasattr(master, 'profile_tab_notes'):
refreshTabURL: '${url('people.profile_tab_notes', uuid=person.uuid)}', refreshTabURL: '${url('people.profile_tab_notes', uuid=person.uuid)}',
% endif
notes: [], notes: [],
noteTypeOptions: [], noteTypeOptions: [],
@ -2920,7 +2928,9 @@
<script type="text/javascript"> <script type="text/javascript">
let UserTabData = { let UserTabData = {
% if hasattr(master, 'profile_tab_user'):
refreshTabURL: '${url('people.profile_tab_user', uuid=person.uuid)}', refreshTabURL: '${url('people.profile_tab_user', uuid=person.uuid)}',
% endif
users: [], users: [],
% if request.has_perm('users.create'): % if request.has_perm('users.create'):
@ -2976,7 +2986,9 @@
createUserSave() { createUserSave() {
this.createUserSaving = true this.createUserSaving = true
% if hasattr(master, 'profile_make_user'):
let url = '${master.get_action_url('profile_make_user', instance)}' let url = '${master.get_action_url('profile_make_user', instance)}'
% endif
let params = { let params = {
username: this.createUserUsername, username: this.createUserUsername,
active: this.createUserActive, active: this.createUserActive,
@ -3015,13 +3027,13 @@
let ProfileInfoData = { let ProfileInfoData = {
activeTab: location.hash ? location.hash.substring(1) : 'personal', activeTab: location.hash ? location.hash.substring(1) : 'personal',
tabchecks: ${json.dumps(tabchecks)|n}, tabchecks: ${json.dumps(tabchecks or {})|n},
today: '${rattail_app.today()}', today: '${rattail_app.today()}',
profileLastChanged: Date.now(), profileLastChanged: Date.now(),
person: ${json.dumps(person_data)|n}, person: ${json.dumps(person_data or {})|n},
phoneTypeOptions: ${json.dumps(phone_type_options)|n}, phoneTypeOptions: ${json.dumps(phone_type_options or [])|n},
emailTypeOptions: ${json.dumps(email_type_options)|n}, emailTypeOptions: ${json.dumps(email_type_options or [])|n},
maxLengths: ${json.dumps(max_lengths)|n}, maxLengths: ${json.dumps(max_lengths or {})|n},
% if request.has_perm('people_profile.view_versions'): % if request.has_perm('people_profile.view_versions'):
loadingRevisions: false, loadingRevisions: false,