diff --git a/templates/adults.html b/templates/adults.html index e02740a..8087338 100644 --- a/templates/adults.html +++ b/templates/adults.html @@ -259,6 +259,24 @@ border-color: #00ff00; } + .filter-select { + background-color: #1a1a1a; + border: 1px solid #333; + color: #00ff00; + font-family: inherit; + font-size: 11px; + padding: 4px 8px; + outline: none; + } + + .filter-select:focus { + border-color: #00ff00; + } + + .month-hidden { + display: none !important; + } + .filter-label { color: #888; text-transform: lowercase; @@ -478,6 +496,20 @@
search member: + from: + + to: + + +
@@ -486,7 +518,7 @@ Member {% for m in months %} - {{ m }} + {{ m }} {% endfor %} Balance @@ -499,7 +531,7 @@ [i] {% for cell in row.months %} - {{ cell.text }} {% if cell.status == 'unpaid' or cell.status == 'partial' %} @@ -522,7 +554,7 @@ TOTAL {% for t in totals %} - + received / expected {{ t.text }} @@ -889,6 +921,38 @@ event.target.style.display = 'none'; } } + + // Month range filter + function applyMonthFilter() { + var fromIdx = parseInt(document.getElementById('fromMonth').value); + var toIdx = parseInt(document.getElementById('toMonth').value); + document.querySelectorAll('[data-month-idx]').forEach(function(el) { + var idx = parseInt(el.getAttribute('data-month-idx')); + if (idx >= fromIdx && idx <= toIdx) { + el.classList.remove('month-hidden'); + } else { + el.classList.add('month-hidden'); + } + }); + } + + function resetMonthFilter() { + var fromSelect = document.getElementById('fromMonth'); + var toSelect = document.getElementById('toMonth'); + fromSelect.value = 0; + toSelect.value = fromSelect.options.length - 1; + applyMonthFilter(); + } + + // Set defaults (last 5 months) and apply on load + (function() { + var fromSelect = document.getElementById('fromMonth'); + var toSelect = document.getElementById('toMonth'); + var defaultFrom = Math.max(0, fromSelect.options.length - 5); + fromSelect.value = defaultFrom; + toSelect.value = fromSelect.options.length - 1; + applyMonthFilter(); + })(); diff --git a/templates/juniors.html b/templates/juniors.html index 038cb61..c177cf7 100644 --- a/templates/juniors.html +++ b/templates/juniors.html @@ -259,6 +259,24 @@ border-color: #00ff00; } + .filter-select { + background-color: #1a1a1a; + border: 1px solid #333; + color: #00ff00; + font-family: inherit; + font-size: 11px; + padding: 4px 8px; + outline: none; + } + + .filter-select:focus { + border-color: #00ff00; + } + + .month-hidden { + display: none !important; + } + .filter-label { color: #888; text-transform: lowercase; @@ -478,6 +496,20 @@
search member: + from: + + to: + + +
@@ -486,7 +518,7 @@ Member {% for m in months %} - {{ m }} + {{ m }} {% endfor %} Balance @@ -499,7 +531,7 @@ [i] {% for cell in row.months %} - {{ cell.text }} {% if cell.status == 'unpaid' or cell.status == 'partial' %} @@ -522,7 +554,7 @@ TOTAL {% for t in totals %} - + received / expected {{ t.text }} @@ -870,6 +902,38 @@ event.target.style.display = 'none'; } } + + // Month range filter + function applyMonthFilter() { + var fromIdx = parseInt(document.getElementById('fromMonth').value); + var toIdx = parseInt(document.getElementById('toMonth').value); + document.querySelectorAll('[data-month-idx]').forEach(function(el) { + var idx = parseInt(el.getAttribute('data-month-idx')); + if (idx >= fromIdx && idx <= toIdx) { + el.classList.remove('month-hidden'); + } else { + el.classList.add('month-hidden'); + } + }); + } + + function resetMonthFilter() { + var fromSelect = document.getElementById('fromMonth'); + var toSelect = document.getElementById('toMonth'); + fromSelect.value = 0; + toSelect.value = fromSelect.options.length - 1; + applyMonthFilter(); + } + + // Set defaults (last 5 months) and apply on load + (function() { + var fromSelect = document.getElementById('fromMonth'); + var toSelect = document.getElementById('toMonth'); + var defaultFrom = Math.max(0, fromSelect.options.length - 5); + fromSelect.value = defaultFrom; + toSelect.value = fromSelect.options.length - 1; + applyMonthFilter(); + })();