commit 15c445afbd3a91a801fdc9dbedd998de1cb70142
parent 463644b6ea09774892d092485f3912deb1986252
Author: Amit Dutta <mail@amit.is-a.dev>
Date: Fri, 4 Sep 2026 16:57:30 +0530
Filter out .gitattributes from item listing
Diffstat:
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/app/templates/index.html b/app/templates/index.html
@@ -418,6 +418,7 @@
{% endif %}
{% for item in items %}
+ {% if item.name != '.gitattributes' %}
<div class="list-item" data-name="{{ item.name }}">
<div class="item-name">
{% if item.is_dir %}
@@ -437,9 +438,11 @@
{% endif %}
</div>
</div>
+ {% endif %}
{% endfor %}
- {% if not items %}
+ {% set visible_items = items | rejectattr("name", "equalto", ".gitattributes") | list %}
+ {% if not visible_items %}
<div class="empty-state">
<svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>
<span>Empty directory</span>
@@ -633,7 +636,20 @@
<footer>
<div>
{% if page == 'listing' and items %}
- {{ items|length }} files
+ {% set visible_items = items | rejectattr("name", "equalto", ".gitattributes") | list %}
+ {% set file_count = visible_items | rejectattr("is_dir") | list | length %}
+ {% set dir_count = visible_items | selectattr("is_dir") | list | length %}
+
+ {% if dir_count > 0 %}
+ {{ dir_count }} folder{{ 's' if dir_count != 1 else '' }}
+ {% endif %}
+ {% if dir_count > 0 and file_count > 0 %} & {% endif %}
+ {% if file_count > 0 %}
+ {{ file_count }} file{{ 's' if file_count != 1 else '' }}
+ {% endif %}
+ {% if dir_count == 0 and file_count == 0 %}
+ 0 items
+ {% endif %}
{% else %}
cdn
{% endif %}