Refactor series tags modal for improved structure and loading indication
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
<div class="series-tags-fragment">
|
<div class="series-tags-fragment">
|
||||||
<h6>Series DICOM tags (common across series)</h6>
|
<h6>Series DICOM tags (common across series)</h6>
|
||||||
|
<div class="mb-2">
|
||||||
|
<input id="series-tags-filter" class="form-control form-control-sm" type="search" placeholder="Filter tags (key or value)">
|
||||||
|
</div>
|
||||||
{% if common_tags %}
|
{% if common_tags %}
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -15,3 +18,25 @@
|
|||||||
<div class="text-muted">No consistent tags found across images in this series.</div>
|
<div class="text-muted">No consistent tags found across images in this series.</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
const input = document.getElementById('series-tags-filter');
|
||||||
|
if (!input) return;
|
||||||
|
input.addEventListener('input', function (e) {
|
||||||
|
const q = (e.target.value || '').trim().toLowerCase();
|
||||||
|
const table = document.querySelector('.series-tags-fragment table');
|
||||||
|
if (!table) return;
|
||||||
|
const rows = table.querySelectorAll('tbody tr');
|
||||||
|
rows.forEach(row => {
|
||||||
|
const key = (row.querySelector('th') && row.querySelector('th').textContent || '').toLowerCase();
|
||||||
|
const val = (row.querySelector('td') && row.querySelector('td').textContent || '').toLowerCase();
|
||||||
|
if (!q || key.indexOf(q) !== -1 || val.indexOf(q) !== -1) {
|
||||||
|
row.style.display = '';
|
||||||
|
} else {
|
||||||
|
row.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Global modal used for HTMX-loaded fragments (e.g. series tags) -->
|
<!-- Global modal used for HTMX-loaded fragments (e.g. series tags) -->
|
||||||
<div class="modal fade" id="seriesTagsModal" tabindex="-1" aria-hidden="true">
|
<div class="modal fade" id="seriesTagsModal" tabindex="-1" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-xl modal-dialog-centered">
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Show modal when HTMX swaps content into the modal body
|
// Show modal when HTMX swaps content into the modal body
|
||||||
|
|||||||
Reference in New Issue
Block a user