Add some links to various grid columns

This commit is contained in:
Lance Edgar 2017-08-02 20:40:02 -05:00
parent 8186366b69
commit f20a40e818
5 changed files with 10 additions and 0 deletions

View file

@ -85,6 +85,8 @@ class CustomersView(MasterView):
g.set_label('phone', "Phone Number")
g.set_label('email', "Email Address")
g.set_link('name')
def get_mobile_data(self, session=None):
# TODO: hacky!
return self.get_data(session=session).order_by(model.Customer.name)

View file

@ -410,6 +410,8 @@ class MasterView2(MasterView):
g.set_label('issued_at', "Changed")
g.set_label('user', "Changed by")
g.set_label('remote_addr', "IP Address")
# TODO: why does this render '#' as url?
# g.set_link('issued_at')
def render_version_comment(self, transaction, column):
return transaction.meta.get('comment', "")

View file

@ -103,6 +103,8 @@ class PeopleView(MasterView):
g.set_label('email', "Email Address")
g.set_label('customer_id', "Customer ID")
g.set_link('display_name')
def get_instance(self):
# TODO: I don't recall why this fallback check for a vendor contact
# exists here, but leaving it intact for now.

View file

@ -56,6 +56,7 @@ class RolesView(PrincipalMasterView):
g.filters['name'].default_active = True
g.filters['name'].default_verb = 'contains'
g.default_sortkey = 'name'
g.set_link('name')
def _preconfigure_fieldset(self, fs):
fs.append(PermissionsField('permissions'))

View file

@ -174,6 +174,9 @@ class UsersView(PrincipalMasterView):
g.set_label('person', "Person's Name")
g.set_link('username')
g.set_link('person')
def _preconfigure_fieldset(self, fs):
fs.username.set(renderer=forms.renderers.StrippedTextFieldRenderer, validate=unique_username)
fs.person.set(renderer=forms.renderers.PersonFieldRenderer, options=[])