diff --git a/rattail/pyramid/templates/autocomplete.mako b/rattail/pyramid/templates/autocomplete.mako new file mode 100644 index 00000000..3c1dcb28 --- /dev/null +++ b/rattail/pyramid/templates/autocomplete.mako @@ -0,0 +1,29 @@ +<%def name="autocomplete(field_name, service_url, field_value=None, field_display=None, width='300px', callback=None)"> +
+ ${h.hidden(field_name, id=field_name, value=field_value)} + ${h.text(field_name+'-textbox', id=field_name+'-textbox', value=field_display, + class_='autocomplete-textbox', style='display: none;' if field_value else '')} + +
+ + diff --git a/rattail/pyramid/templates/people/crud.mako b/rattail/pyramid/templates/people/crud.mako new file mode 100644 index 00000000..ad3b56d5 --- /dev/null +++ b/rattail/pyramid/templates/people/crud.mako @@ -0,0 +1,28 @@ +<%inherit file="/crud.mako" /> + +## <%def name="crud_name()">Person + +<%def name="context_menu_items()"> +
  • ${h.link_to("Back to People", url('people'))}
  • + + +${parent.body()} + +## % if fieldset.edit: +##

    User Info

    +## % if user: +## ${user.render()|n} +##
    +## +##
    +## % else: +##

    This person does not have a user account.

    +## ${h.form(url('user.new'))} +## ${h.hidden('User--person_uuid', value=fieldset.model.uuid)} +## ${h.hidden('User--username')} +##
    +## ${h.submit('submit', "Create User")} +##
    +## ${h.end_form()} +## % endif +## % endif diff --git a/rattail/pyramid/templates/people/index.mako b/rattail/pyramid/templates/people/index.mako new file mode 100644 index 00000000..5ed2d063 --- /dev/null +++ b/rattail/pyramid/templates/people/index.mako @@ -0,0 +1,11 @@ +<%inherit file="/grid.mako" /> + +<%def name="title()">People + +## <%def name="context_menu_items()"> +## % if request.has_perm('people.create'): +##
  • ${h.link_to("Create a new Person", url('person.new'))}
  • +## % endif +## + +${parent.body()} diff --git a/rattail/pyramid/views/employees.py b/rattail/pyramid/views/employees.py index b7c27dd2..16fe1b05 100644 --- a/rattail/pyramid/views/employees.py +++ b/rattail/pyramid/views/employees.py @@ -29,7 +29,7 @@ from sqlalchemy import and_ from rattail.pyramid.views import SearchableAlchemyGridView -from rattail.db.model import Employee, Person +from rattail.db.model import Employee, Person, EmployeePhoneNumber from rattail.pyramid.forms import AssociationProxyField from rattail.enum import EMPLOYEE_STATUS_CURRENT