summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chimere/models.py2
-rw-r--r--chimere/templates/search/search.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/chimere/models.py b/chimere/models.py
index 09987c9..3dae073 100644
--- a/chimere/models.py
+++ b/chimere/models.py
@@ -656,7 +656,7 @@ class Marker(GeographicItem):
def default_category(self):
# Should we select only available ones ?
# Should we catch if not exists ?
- cats = self.categories
+ cats = self.categories.filter(available=True, category__available=True)
if cats.count():
return cats.all()[0]
diff --git a/chimere/templates/search/search.html b/chimere/templates/search/search.html
index 572276f..929dade 100644
--- a/chimere/templates/search/search.html
+++ b/chimere/templates/search/search.html
@@ -16,7 +16,7 @@ for (idx=0 ; idx < new_ids.length ; idx++){
<ul>
{% for result in page.object_list %}
<li>
- <a href="#" onclick="$('#main-map').chimere('showPopup', {{result.object.pk}});return false;">{{ result.object }}</a>
+ <img src='{{MEDIA_URL}}{{result.object.default_category.icon.image}}'/><a href="#" onclick="$('#main-map').chimere('showPopup', {{result.object.pk}});return false;">{{ result.object }}</a>
</li>
{% empty %}
<li>{% trans "No results found." %}</li>