backoffice: add possibility to filter on 'done' status (opposite of pending)

This commit is contained in:
Frédéric Péters 2012-08-16 13:09:49 +02:00
parent e0ad0b08af
commit a861d290b0
2 changed files with 4 additions and 1 deletions

View File

@ -255,7 +255,7 @@ class FormPage(Directory):
if self.formdef.workflow.possible_status:
'<h3>%s</h3>' % _('Filters')
'<ul>'
filters = [('all', _('All')), ('pending', _('Pending'))]
filters = [('all', _('All')), ('pending', _('Pending')), ('done', _('Done'))]
for status in self.formdef.workflow.possible_status:
filters.append((status.id, status.name))
for filter_id, filter_label in filters:

View File

@ -89,6 +89,9 @@ class FormDefUI:
if selected_filter == 'pending':
applied_filters = ['wf-%s' % x.id for x in \
self.formdef.workflow.get_not_endpoint_status()]
elif selected_filter == 'done':
applied_filters = ['wf-%s' % x.id for x in \
self.formdef.workflow.get_endpoint_status()]
else:
applied_filters = ['wf-%s' % selected_filter]
items = []