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