Facet results now have "truncated" field

To indicate if there was more than 20 distinct values. Refs #255
This commit is contained in:
Simon Willison 2018-05-15 06:50:27 -03:00
commit 158e7950ec
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
3 changed files with 128 additions and 95 deletions

View file

@ -95,12 +95,15 @@
<p>Suggested facets: {% for facet in suggested_facets %}<a href="{{ facet.toggle_url }}">{{ facet.name }}</a> {% endfor %}
{% endif %}
{% for facet_name, facet_values in facet_results.items() %}
{% for facet_name, facet_info in facet_results.items() %}
<p><strong>{{ facet_name }}</strong></p>
<ul>
{% for facet_value in facet_values %}
{% for facet_value in facet_info.results %}
<li><a href="{{ facet_value.toggle_url }}">{{ facet_value.value }}</a> ({{ facet_value.count }})</li>
{% endfor %}
{% if facet_info.truncated %}
<li>...</li>
{% endif %}
</ul>
{% endfor %}