backoffice: do not display the user-label field by default

It will most most often be redundant as the formdata itself will have a name
field. (#1722)
This commit is contained in:
Frédéric Péters 2012-10-02 10:23:37 +02:00
parent a3aadf6ac3
commit e915d3693a
1 changed files with 14 additions and 0 deletions

View File

@ -33,5 +33,19 @@ class BackofficeRootDirectory(wcs.backoffice.root.RootDirectory):
html_top('home', _('Pending Forms'))
get_response().breadcrumb[-1:] = [('home', _('Pending Forms'))]
def _q_lookup(self, component):
return FormPage(component)
class FormPage(wcs.backoffice.root.FormPage):
def get_fields_from_query(self):
field_ids = [x for x in get_request().form.keys()]
fields = wcs.backoffice.root.FormPage.get_fields_from_query(self)
if not field_ids:
# do not display the user-label field by default, as it will most
# most often be redundant (the formdata itself will have a name
# field)
return [x for x in fields if x.id != 'user-label']
return fields
get_publisher_class().backoffice_directory_class = BackofficeRootDirectory