🚑 Do not show empty categories (#8268)

This commit is contained in:
Franck Nijhof 2019-01-25 00:10:31 +01:00 committed by Klaas Schoute
parent bf83e6ade8
commit e75272d6d7

View File

@ -50,8 +50,9 @@ Support for these components is provided by the Home Assistant community.
<a href='#version/{{ added_two_ago_version }}' class="btn added_two_versions_ago">Added in {{ added_two_ago_version }} ({{ two_ago_version_components_count }})</a>
{%- for category in categories -%}
{%- if category and category != 'Other' -%}
<a href='#{{ category | slugify }}' class="btn">{{ category }} ({{ components | where: 'ha_category', category | size }})</a>
{%- assign components_count = components | where: 'ha_category', category | size -%}
{%- if category and category != 'Other' and components_count != 0 -%}
<a href='#{{ category | slugify }}' class="btn">{{ category }} ({{ components_count }})</a>
{%- endif -%}
{%- endfor -%}