From 2fbcf638f2a768776117252c88140c234a3b7e1b Mon Sep 17 00:00:00 2001 From: James B Date: Thu, 20 Mar 2025 10:40:14 +0000 Subject: [PATCH] Add Funders count to recipients listing https://github.com/ThreeSixtyGiving/grantnav/issues/940 --- dataload/import_to_elasticsearch.py | 2 ++ .../templates/components/recipient-search-result.html | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/dataload/import_to_elasticsearch.py b/dataload/import_to_elasticsearch.py index e9754738..c5c67cbc 100755 --- a/dataload/import_to_elasticsearch.py +++ b/dataload/import_to_elasticsearch.py @@ -306,6 +306,7 @@ def maybe_create_index(index_name=ES_INDEX): "aggregate": { "properties": { "grants": {"type": "double"}, + "funders": {"type": "double"}, "maxAwardDate": { "type": "date", "ignore_malformed": True @@ -321,6 +322,7 @@ def maybe_create_index(index_name=ES_INDEX): "properties": { "avg": {"type": "double"}, "total": {"type": "double"}, + "funders": {"type": "double"}, } } diff --git a/grantnav/frontend/templates/components/recipient-search-result.html b/grantnav/frontend/templates/components/recipient-search-result.html index d1c96c0d..fd865ac7 100644 --- a/grantnav/frontend/templates/components/recipient-search-result.html +++ b/grantnav/frontend/templates/components/recipient-search-result.html @@ -34,6 +34,10 @@ Smallest {%if stat.currency != 'GBP' or result.stats_by_currency|length > 1 %}
{{stat.currency}} {% endif %}

{{stat.currency | currency_symbol}}{{stat.min | get_amount}} +
+ Funders {%if stat.currency != 'GBP' or result.stats_by_currency|length > 1%}
{{stat.currency}} {% endif %}

+ {{stat.funders | get_amount }} +
{% endfor %}