06/05 Optimize app

This commit is contained in:
2026-06-05 09:29:41 -04:00
parent deba20cf7e
commit 8481e9c214
5 changed files with 201 additions and 67 deletions
+23 -1
View File
@@ -177,9 +177,18 @@
<div class="d-flex align-items-center flex-wrap gap-2 mb-3">
<span class="fmt-badge"><i class="bi bi-check-circle"></i><span id="fmt-label"></span></span>
<span class="text-muted" style="font-size:13px;" id="row-count-label"></span>
<div class="ms-auto d-flex gap-2 align-items-center">
<div class="ms-auto d-flex gap-2 align-items-center flex-wrap">
<button id="select-all-btn" class="btn btn-sm btn-outline-secondary">Select All</button>
<button id="select-none-btn" class="btn btn-sm btn-outline-secondary">None</button>
<div class="d-flex align-items-center gap-1">
<select id="bulk-cat-select" class="form-select form-select-sm" style="min-width:140px;font-size:12px;">
<option value="">— Set category —</option>
{% for c in categories %}
<option value="{{ c.id }}">{{ c.name }}</option>
{% endfor %}
</select>
<button id="bulk-cat-btn" class="btn btn-sm btn-outline-secondary" style="font-size:12px;white-space:nowrap;">Apply to Selected</button>
</div>
<button id="import-btn" class="btn btn-sm btn-success px-3">
<span id="import-spinner" class="spinner-border spinner-border-sm me-1 d-none"></span>
<i class="bi bi-cloud-upload me-1" id="import-icon"></i>
@@ -536,6 +545,19 @@
updateImportCount();
});
// Bulk: set category for all selected rows
$('bulk-cat-btn').addEventListener('click', () => {
const catId = $('bulk-cat-select').value;
if (!catId) return;
document.querySelectorAll('#preview-body tr').forEach(tr => {
const chk = tr.querySelector('.row-chk');
if (!chk || !chk.checked) return;
const sel = tr.querySelector('.cat-select');
if (sel) sel.value = catId;
});
$('bulk-cat-select').value = '';
});
// ── Import ────────────────────────────────────────────────────────────────
$('import-btn').addEventListener('click', () => {
const accountId = $('account-select').value;