From 4a5f1ce19a8ff7ff68d74ecbe66e66e7687f6803 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 19 Apr 2019 11:20:45 -0500 Subject: [PATCH] Improve default people "profile" view somewhat --- tailbone/templates/people/view_profile.mako | 443 +++++++++++++++----- 1 file changed, 345 insertions(+), 98 deletions(-) diff --git a/tailbone/templates/people/view_profile.mako b/tailbone/templates/people/view_profile.mako index 35a4e700..07448b73 100644 --- a/tailbone/templates/people/view_profile.mako +++ b/tailbone/templates/people/view_profile.mako @@ -4,8 +4,29 @@ <%def name="extra_javascript()"> ${parent.extra_javascript()} @@ -15,136 +36,321 @@
  • Personal
  • Customer
  • Employee
  • +
  • User
  • -
    -
    - -
    - ${person.first_name} -
    -
    -
    +
    -
    -
    - -
    - ${person.middle_name} -
    -
    -
    +
    -
    -
    - -
    - ${person.last_name} +
    +
    + +
    + ${person.first_name} +
    +
    -
    -
    -
    -
    - -
    - ${person.address.street if person.address else ''} +
    +
    + +
    + ${person.middle_name} +
    +
    -
    -
    -
    -
    - -
    - ${person.address.street2 if person.address else ''} +
    +
    + +
    + ${person.last_name} +
    +
    -
    -
    -
    -
    - -
    - ${person.address.city if person.address else ''} +
    +
    + +
    + ${person.address.street if person.address else ''} +
    +
    -
    -
    -
    -
    - -
    - ${person.address.state if person.address else ''} +
    +
    + +
    + ${person.address.street2 if person.address else ''} +
    +
    -
    -
    -
    -
    - -
    - ${person.address.zipcode if person.address else ''} +
    +
    + +
    + ${person.address.city if person.address else ''} +
    +
    -
    -
    +
    +
    + +
    + ${person.address.state if person.address else ''} +
    +
    +
    + +
    +
    + +
    + ${person.address.zipcode if person.address else ''} +
    +
    +
    + + % if person.phones: + % for phone in person.phones: +
    +
    + +
    + ${phone.number} (type: ${phone.type}) +
    +
    +
    + % endfor + % else: +
    +
    + +
    + (none on file) +
    +
    +
    + % endif + + % if person.emails: + % for email in person.emails: +
    +
    + +
    + ${email.address} (type: ${email.type}) +
    +
    +
    + % endfor + % else: +
    +
    + +
    + (none on file) +
    +
    +
    + % endif + +
    + +
    + % if request.has_perm('people.view'): + ${h.link_to("View Person", url('people.view', uuid=person.uuid), class_='button')} + % endif +
    + +
    - % for customer in person.customers: + % if person.customers: +

    ${person} is associated with ${len(person.customers)} customer account(s)

    +
    +
    + % for customer in person.customers: +

    ${customer.id} - ${customer.name}

    +
    -
    -
    - -
    - ${customer.id or ''} -
    -
    +
    + +
    + +
    +
    + +
    + ${customer.id or ''} +
    +
    +
    + +
    +
    + +
    + ${customer.name} +
    +
    +
    + + % if customer.phones: + % for phone in customer.phones: +
    +
    + +
    + ${phone.number} (type: ${phone.type}) +
    +
    +
    + % endfor + % else: +
    +
    + +
    + (none on file) +
    +
    +
    + % endif + + % if customer.emails: + % for email in customer.emails: +
    +
    + +
    + ${email.address} (type: ${email.type}) +
    +
    +
    + % endfor + % else: +
    +
    + +
    + (none on file) +
    +
    +
    + % endif + +
    + +
    + % if request.has_perm('customers.view'): + ${h.link_to("View Customer", url('customers.view', uuid=customer.uuid), class_='button')} + % endif +
    + +
    + +
    + % endfor
    -
    -
    - -
    - ${customer.name} -
    -
    -
    - - % endfor + % else: +

    ${person} has never been a customer.

    + % endif
    - % if person.employee: + % if employee: +
    -
    -
    - -
    - ${person.employee.id or ''} -
    -
    -
    +
    -
    -
    - -
    - ${person.employee.display_name or ''} +
    +
    + +
    + ${employee.id or ''} +
    +
    -
    -
    -
    -
    - -
    - ${enum.EMPLOYEE_STATUS[person.employee.status]} +
    +
    + +
    + ${employee.display_name or ''} +
    +
    + +
    +
    + +
    + ${enum.EMPLOYEE_STATUS.get(employee.status, '')} +
    +
    +
    + + % if employee.phones: + % for phone in employee.phones: +
    +
    + +
    + ${phone.number} (type: ${phone.type}) +
    +
    +
    + % endfor + % else: +
    +
    + +
    + (none on file) +
    +
    +
    + % endif + + % if employee.emails: + % for email in employee.emails: +
    +
    + +
    + ${email.address} (type: ${email.type}) +
    +
    +
    + % endfor + % else: +
    +
    + +
    + (none on file) +
    +
    +
    + % endif +
    + +
    + % if request.has_perm('employees.view'): + ${h.link_to("View Employee", url('employees.view', uuid=employee.uuid), class_='button')} + % endif +
    +
    % else: @@ -152,4 +358,45 @@ % endif
    +
    + % if person.users: +

    ${person} is associated with ${len(person.users)} user account(s)

    +
    +
    + % for user in person.users: +

    ${user.username}

    +
    + +
    + +
    + +
    +
    + +
    + ${user.username} +
    +
    +
    + +
    + +
    + % if request.has_perm('users.view'): + ${h.link_to("View User", url('users.view', uuid=user.uuid), class_='button')} + % endif +
    + +
    + +
    + % endfor +
    + + % else: +

    ${person} has never been a user.

    + % endif +
    +