diff --git a/app/static/app/js/dbcontrol.js b/app/static/app/js/dbcontrol.js index bacbe9c..c6cd138 100644 --- a/app/static/app/js/dbcontrol.js +++ b/app/static/app/js/dbcontrol.js @@ -361,6 +361,14 @@ function fillTableWithEntries(entries, sortField = 'date', sortDirection = 'asc' } else if (entry.type === 1) { typeCell.textContent = 'Dienst'; // Ansonsten zeige den Type-Wert } + // Partner (optional) klein darunter anzeigen, falls beim Eintrag angegeben + if (entry.partner) { + const partnerLine = document.createElement('small'); + partnerLine.classList.add('text-muted'); + partnerLine.style.display = 'block'; + partnerLine.textContent = `mit ${entry.partner}`; + typeCell.appendChild(partnerLine); + } row.appendChild(typeCell); const editCell = document.createElement('td'); @@ -371,6 +379,7 @@ function fillTableWithEntries(entries, sortField = 'date', sortDirection = 'asc' document.getElementById('editStunden').value = durationDBtoForm(entry.duration)[0]; document.getElementById('editMinuten').value = durationDBtoForm(entry.duration)[1]; document.getElementById('editDatum').value = entry.date; + document.getElementById('editPartnerInput').value = entry.partner || ''; if (entry.type === 2) { document.getElementById('editldcCheck').checked = true; } else { diff --git a/app/static/app/js/home01.js b/app/static/app/js/home01.js index 4f2d0b6..fe6bcbe 100644 --- a/app/static/app/js/home01.js +++ b/app/static/app/js/home01.js @@ -335,6 +335,7 @@ NewEntryButton.addEventListener('click', () => { type: type, status: 1, sondertext: document.getElementById('sonstigesInput').value, + partner: document.getElementById('partnerInput').value.trim(), } addEntry(newEntryData, 'hours').then((id) => { @@ -345,6 +346,7 @@ NewEntryButton.addEventListener('click', () => { hours.value = null mins.value = null document.getElementById('sonstigesInput').value = null + document.getElementById('partnerInput').value = null checkInput() } }) @@ -720,6 +722,7 @@ document.getElementById('editEntrySubmitButton').addEventListener('click', () => type: type, status: 1, sondertext: document.getElementById('editsonstigesInput').value, + partner: document.getElementById('editPartnerInput').value.trim(), }).then(() => { // console.log('Eintrag aktualisiert.'); location.reload() diff --git a/app/templates/app/home.html b/app/templates/app/home.html index 82c903c..f7288e5 100644 --- a/app/templates/app/home.html +++ b/app/templates/app/home.html @@ -191,6 +191,12 @@ + +
Partner (optional)
+ +Optionen:
@@ -258,6 +264,12 @@Partner (optional)
+ +Optionen: