Merge branch 'main' of gitea.hottis.de:moerp/elo-rezept-rechner
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
21ea1aa56f
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user