Browse Source

fix: bulk removal works again; some js relied on things I removed and I hadn't realized it

document-upload-removal-layout-update
nic 10 months ago
parent
commit
5d684c24e7
  1. 40
      templates/partials/document_remove.html
  2. 3
      templates/partials/invoice_search.html

40
templates/partials/document_remove.html

@ -21,7 +21,7 @@
<div id="step2-removal" class="content" style="display: none;"> <div id="step2-removal" class="content" style="display: none;">
<h3 class="submenu-header">Step 2: Select Documents to Remove</h3> <h3 class="submenu-header">Step 2: Select Documents to Remove</h3>
<div id="bulk-removal-tab"> <div id="bulk-removal-section">
<form id="bulk-remove-form" hx-post="/documents/remove/bulk" hx-target="#removal-results" <form id="bulk-remove-form" hx-post="/documents/remove/bulk" hx-target="#removal-results"
hx-indicator=".removal-overlay"> hx-indicator=".removal-overlay">
<div class="form-group"> <div class="form-group">
@ -80,10 +80,6 @@
<div id="job-ids-removal-container" style="display: none;"> <div id="job-ids-removal-container" style="display: none;">
<!-- Hidden input placeholder for job IDs --> <!-- Hidden input placeholder for job IDs -->
</div> </div>
<div id="job-results" class="job-selection">
<!-- Jobs and document selection will appear here -->
</div>
</div> </div>
<!-- Step 3: Results --> <!-- Step 3: Results -->
@ -103,26 +99,6 @@
<script> <script>
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
// Tab switching
const individualTabBtn = document.getElementById('individual-tab-btn');
const bulkTabBtn = document.getElementById('bulk-tab-btn');
const individualTab = document.getElementById('individual-selection-tab');
const bulkTab = document.getElementById('bulk-removal-tab');
individualTabBtn.addEventListener('click', function () {
individualTabBtn.classList.add('active');
bulkTabBtn.classList.remove('active');
individualTab.style.display = 'block';
bulkTab.style.display = 'none';
});
bulkTabBtn.addEventListener('click', function () {
bulkTabBtn.classList.add('active');
individualTabBtn.classList.remove('active');
bulkTab.style.display = 'block';
individualTab.style.display = 'none';
});
// Sync job IDs between forms // Sync job IDs between forms
htmx.on('#job-ids-removal-container', 'htmx:afterSwap', function () { htmx.on('#job-ids-removal-container', 'htmx:afterSwap', function () {
// Get jobIDs from the container // Get jobIDs from the container
@ -161,8 +137,7 @@
// If it's a removal action and successful, show step 3 and restart section // If it's a removal action and successful, show step 3 and restart section
if (evt.detail.successful && if (evt.detail.successful &&
(evt.detail.pathInfo.requestPath.includes('/documents/remove/job/') || (evt.detail.pathInfo.requestPath.includes('/documents/remove/bulk'))) {
evt.detail.pathInfo.requestPath.includes('/documents/remove/bulk'))) {
document.getElementById('step3-removal').style.display = 'block'; document.getElementById('step3-removal').style.display = 'block';
document.getElementById('restart-section-removal').style.display = 'block'; document.getElementById('restart-section-removal').style.display = 'block';
} }
@ -199,17 +174,6 @@
// Reset job IDs container // Reset job IDs container
document.getElementById('job-ids-removal-container').innerHTML = ''; document.getElementById('job-ids-removal-container').innerHTML = '';
// Reset tab selection
const individualTabBtn = document.getElementById('individual-tab-btn');
const bulkTabBtn = document.getElementById('bulk-tab-btn');
const individualTab = document.getElementById('individual-selection-tab');
const bulkTab = document.getElementById('bulk-removal-tab');
individualTabBtn.classList.add('active');
bulkTabBtn.classList.remove('active');
individualTab.style.display = 'block';
bulkTab.style.display = 'none';
// Show step 1 // Show step 1
document.getElementById('step1-removal').style.display = 'block'; document.getElementById('step1-removal').style.display = 'block';

3
templates/partials/invoice_search.html

@ -3,8 +3,7 @@
<div class="content"> <div class="content">
<h3 class="submenu-header">Search Invoice</h3> <h3 class="submenu-header">Search Invoice</h3>
<div id="search-container"> <div id="search-container">
<input class="card-input" type="text" name="search" <input class="card-input" type="text" name="search" placeholder="Enter invoice numbers/IDs" hx-get="/invoices"
placeholder="Enter invoice numbers/IDs (comma or space separated)" hx-get="/invoices"
hx-trigger="keyup changed delay:500ms" hx-target="#invoice-search-results" hx-indicator="#loading-indicator" /> hx-trigger="keyup changed delay:500ms" hx-target="#invoice-search-results" hx-indicator="#loading-indicator" />
<div class="help-text"> <div class="help-text">

Loading…
Cancel
Save