diff --git a/templates/base.html b/templates/base.html index 842bf0c..daa0c1f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,14 +1,15 @@ - + - {{ title }} + {{ tmp }} - {{ title }} - - -
-

{{ tmp }} - {{ title }}

- - -
+
- - Image +

{{ tmp }} - {{ title }}

+ {{ tmp }} - {{ title }} {% block content %}{% endblock %}
{% block scripts %}{% endblock %} - + diff --git a/templates/table.html b/templates/table.html index e67d67d..9ce54fa 100644 --- a/templates/table.html +++ b/templates/table.html @@ -1,30 +1,25 @@ {% extends "base.html" %} {% block content %} -
- -{{ inventory_list[0][5] }} - - -
+
- - - - - + + + + + {% for brick in inventory_list %} - - + + - +
NameColorQtyMissingNameColorQtyMissing
{{ brick[3] }}{{ brick[3] }}{{ brick[3] }} {{ brick[7] }}{{ brick[8] }}{{ brick[8] }}
{% set ns = namespace(count='') %} @@ -78,30 +73,6 @@ // } ); - - - -// document.addEventListener('DOMContentLoaded', function () { -// const myDataTable = document.getElementById('data'); - -// myDataTable.addEventListener('click', function (event) { -// const clickedRow = event.target.closest('td'); -// if (clickedRow) { -// // Remove highlighting from all rows -// const rows = myDataTable.querySelectorAll('tr'); -// rows.forEach(row => row.classList.remove('highlighted')); - -// // Add highlighting to the clicked row -// if (clickedRow.classList.contains('highlighted')) { - -// clickedRow.classList.remove('highlighted'); -// } else { -// clickedRow.classList.add('highlighted'); -// } -// } -// }); -// }); - function goToPage(url) { window.location.href = url; } @@ -135,12 +106,11 @@ document.addEventListener('DOMContentLoaded', function () { element.addEventListener('click', function () { const imgSrc = element.getAttribute('src'); textContent = ''; -try { - textContent = element.closest('tr').querySelector('td:nth-child(2)').textContent; // Adjust the index accordingly + console.log(element.getAttribute('alt')); + textContent = element.getAttribute('alt'); + // textContent = element.closest('tr').querySelector('td:nth-child(2)').textContent; // Adjust the index accordingly lightboxText.textContent = textContent; -} catch (e) { - textContent = ''; -} + lightboxImage.setAttribute('src', imgSrc); lightboxModal.style.display = 'block';