From f486bd532ba93377dc638228f3a42f812f337865 Mon Sep 17 00:00:00 2001 From: Konrad du Plessis Date: Mon, 23 Feb 2026 01:45:43 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20resource=20filter=20=E2=80=94=20Bootstrap?= =?UTF-8?q?=20d-flex=20!important=20was=20overriding=20inline=20display:no?= =?UTF-8?q?ne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Active/Inactive/All filter buttons weren't actually hiding rows because Bootstrap's d-flex class uses display:flex !important, which beats inline display:none. Switched to V2's approach: a .resource-hidden CSS class with display:none !important that properly overrides d-flex. Co-Authored-By: Claude Opus 4.6 --- core/templates/core/index.html | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 88b18f6..9ff89c7 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -4,6 +4,10 @@ {% block title %}Dashboard | FoxFitt{% endblock %} {% block content %} +
@@ -203,7 +207,7 @@ {# === WORKERS TAB === #}
{% for item in workers %} -
+
{{ item.name }}
@@ -218,7 +222,7 @@ {# === PROJECTS TAB === #}
{% for item in projects %} -
+
{{ item.name }}
@@ -233,7 +237,7 @@ {# === TEAMS TAB === #}
{% for item in teams %} -
+
{{ item.name }}
@@ -359,18 +363,25 @@ document.addEventListener('DOMContentLoaded', function() { var filterBtns = document.querySelectorAll('#resourceFilter button'); function applyFilter() { + // Use the resource-hidden CLASS (not inline display:none) because + // Bootstrap's d-flex has !important which overrides inline styles. + // Our .resource-hidden also has !important, so it wins. document.querySelectorAll('.resource-row').forEach(function(row) { var isActive = row.dataset.active === 'true'; var show = false; if (currentFilter === 'all') show = true; else if (currentFilter === 'active') show = isActive; else if (currentFilter === 'inactive') show = !isActive; - row.style.display = show ? '' : 'none'; + if (show) { + row.classList.remove('resource-hidden'); + } else { + row.classList.add('resource-hidden'); + } }); // Show "No matching items" if a tab has rows but none are visible document.querySelectorAll('.tab-pane').forEach(function(pane) { var rows = pane.querySelectorAll('.resource-row'); - var visibleRows = Array.from(rows).filter(function(r) { return r.style.display !== 'none'; }); + var visibleRows = Array.from(rows).filter(function(r) { return !r.classList.contains('resource-hidden'); }); var emptyMsg = pane.querySelector('.resource-empty'); if (emptyMsg) { emptyMsg.style.display = (rows.length > 0 && visibleRows.length === 0) ? '' : 'none';