From 085557bd50969b97808e5f73a16abc31d6854ae4 Mon Sep 17 00:00:00 2001 From: Kasper Brandt Date: Thu, 9 Jun 2016 09:02:04 +0200 Subject: [PATCH] [#2189] Change project listing filters and hide status when not present --- akvo/rsr/filters.py | 6 +- akvo/templates/project_directory.html | 8 ++- akvo/templates/project_main_tabs/summary.html | 68 ++++++++++--------- akvo/utils.py | 5 +- 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/akvo/rsr/filters.py b/akvo/rsr/filters.py index 38a70e3f9d..9694df02ce 100644 --- a/akvo/rsr/filters.py +++ b/akvo/rsr/filters.py @@ -152,8 +152,8 @@ class ProjectFilter(django_filters.FilterSet): iati_status = django_filters.ChoiceFilter( initial=_('All'), - label=_(u'iati status'), - choices=([('', _('All'))] + codelist_choices(ACTIVITY_STATUS))) + label=_(u'status'), + choices=([('', _('All'))] + codelist_choices(ACTIVITY_STATUS, False))) title = django_filters.CharFilter( lookup_type='icontains', @@ -167,7 +167,7 @@ class ProjectFilter(django_filters.FilterSet): class Meta: model = Project - fields = ['status', 'location', 'organisation', 'category', + fields = ['status', 'iati_status', 'location', 'organisation', 'category', 'sector', 'title', ] diff --git a/akvo/templates/project_directory.html b/akvo/templates/project_directory.html index 4a7a1c7050..683e7bd06b 100644 --- a/akvo/templates/project_directory.html +++ b/akvo/templates/project_directory.html @@ -40,7 +40,7 @@
- {% bootstrap_field filter.form.status %} + {% bootstrap_field filter.form.iati_status %}
@@ -109,7 +109,9 @@

{% endif %}