diff --git a/umap/templates/umap/search.html b/umap/templates/umap/search.html
index 074c54c6..98af8429 100644
--- a/umap/templates/umap/search.html
+++ b/umap/templates/umap/search.html
@@ -7,11 +7,18 @@
{% if q %}
- {% if maps %}
- {% include "umap/map_list.html" with prefix='search_map' %}
- {% else %}
- {% trans "Not map found." %}
- {% endif %}
+ {% if maps %}
+
+ {% blocktranslate count counter=count %}
+ {{ count }} map found:
+ {% plural %}
+ {{ count }} maps found:
+ {% endblocktranslate %}
+
+ {% include "umap/map_list.html" with prefix='search_map' %}
+ {% else %}
+ {% trans "No map found." %}
+ {% endif %}
{% endif %}
diff --git a/umap/views.py b/umap/views.py
index 29006252..9485a2b9 100644
--- a/umap/views.py
+++ b/umap/views.py
@@ -212,6 +212,7 @@ class Search(TemplateView, PaginatorMixin):
def get_context_data(self, **kwargs):
q = self.request.GET.get("q")
+ qs_count = 0
results = []
if q:
vector = SearchVector("name", config=settings.UMAP_SEARCH_CONFIGURATION)
@@ -220,8 +221,9 @@ class Search(TemplateView, PaginatorMixin):
)
qs = Map.objects.annotate(search=vector).filter(search=query)
qs = qs.filter(share_status=Map.PUBLIC).order_by("-modified_at")
+ qs_count = qs.count()
results = self.paginate(qs)
- kwargs.update({"maps": results, "q": q})
+ kwargs.update({"maps": results, "count": qs_count, "q": q})
return kwargs
def get_template_names(self):