mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Facet results now have "truncated" field
To indicate if there was more than 20 distinct values. Refs #255
This commit is contained in:
parent
590890fc46
commit
158e7950ec
3 changed files with 128 additions and 95 deletions
|
|
@ -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 %}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue