diff --git a/src/static/style.css b/src/static/style.css index 59b401f..a50e427 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -72,7 +72,7 @@ tr:nth-child(even) { } .selected, tr.selected { - background-color: #e5b5b5; /* Hervorhebung der Auswahl */ + background-color: #efcccc; /* Hervorhebung der Auswahl */ } tr:hover:not(.selected) { @@ -172,7 +172,7 @@ tr:hover:not(.selected) { } #database-nutrition-table tr.selected { - background-color: #f0e68c; + background-color: #efcccc; } diff --git a/src/templates/nutrition.html b/src/templates/nutrition.html index faf34a2..1c31917 100644 --- a/src/templates/nutrition.html +++ b/src/templates/nutrition.html @@ -40,6 +40,7 @@ // Beispielsweise das Formular zurücksetzen form.reset(); updateSubmitButtonState(); + loadDatabaseEntries(); }).catch(error => { console.error('Fehler:', error); }); @@ -98,7 +99,7 @@ } function updateDeleteButtonState() { - const selectedRows = document.querySelectorAll('#nutrition-table .selected').length; + const selectedRows = document.querySelectorAll('#database-nutrition-table .selected').length; const deleteButton = document.getElementById('delete-row-button'); deleteButton.disabled = selectedRows === 0; if (selectedRows === 0) { @@ -107,11 +108,13 @@ } + function loadDatabaseEntries() { fetch('/get_database_entries') // Pfad zur entsprechenden Flask-Route .then(response => response.json()) .then(data => { const tableBody = document.getElementById('database-nutrition-table').getElementsByTagName('tbody')[0]; + tableBody.innerHTML = ''; data.forEach(entry => { const row = tableBody.insertRow(); row.insertCell(0).innerHTML = entry.food;