Merge branch 'main' of gitea.hottis.de:moerp/elo-rezept-rechner
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Wolfgang Hottgenroth 2024-01-31 16:46:36 +01:00
commit 21ea1aa56f
Signed by: wn
GPG Key ID: 836E9E1192A6B132
2 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;