{% load machado_extras %}
{% comment %} Selections this form renders no checkbox for -- a card collapsed to one option, or a value beyond the 100 a card lists. Without these the next "Apply Filters" would submit the form without them and silently drop the filter. Only ever emitted for selections that have no checkbox, so a value is never submitted twice and unchecking a box still removes it. {% comment %}, not {# #}: the latter is single-line only and a multi-line one renders verbatim into the page. {% endcomment %} {% for facet_field in unrendered_selected_facets %} {% endfor %}

Filters

{% if selected_facets or query %}
Selected filters
{%endif%} {% for facet in facet_fields_order %} {% with facets.fields|get_item:facet as exists %} {% if exists and facets.fields|get_count:facet > 1 %}
{% with facet_fields_desc|get_item:facet as facet_description %}
{% if facet == "so_term" %} Feature type {% elif facet == "orthologs_coexpression" %} Orthologous coexpression {% elif facet == "orthologous_group" %} Orthologous group {% elif facet == "coexpression_group" %} Coexpression group {% elif facet == "doi" %} DOI {% else %} {{ facet|capfirst }} {% endif %} {% if facets.fields|get_count:facet > 4 %} ({% if facets.fields|get_count:facet == 100 %}Truncated to {% endif %}{{ facets.fields|get_count:facet }}) {% endif %}
{% endwith %}
{% for item in facets.fields|get_item:facet|dictsort:0 %} {% with facet_item=facet|add:":"|add:item.0 %} {% if forloop.counter <= 4 or facet_item in selected_facets %}
{% else %}
{% endif %} {% if facet == "organism" %} {{ item.0|capfirst }} {% elif facet == "orthology" %} {% if item.0 == 0 %} no orthology {% else %} orthology {% endif %} {% elif facet == "coexpression" %} {% if item.0 == 0 %} no coexpression groups {% else %} coexpression groups {% endif %} {% elif facet == "orthologs_coexpression" %} {% if item.0 == 'false' %} no coexpression {% else %} coexpression {% endif %} {% elif facet == "orthologs_biomaterial" %} {{ item.0|capfirst }} {% elif facet == "doi" %} {% with title=doi_titles|get_item:item.0 %} {{ title|default:item.0 }} {% endwith %} {% else %} {{ item.0 }} {% endif %} {% endwith %} ({{ item.1 }})
{% endfor %}
{% if facets.fields|get_count:facet > 4 %} {% endif %}
{% endif %} {% endwith %} {% endfor %}