Allow a comment without a rating on scales instead of "Keine Angabe"
CI / Deploy / PHP 8.5 (push) Successful in 1m13s
CI / Deploy / PHP 8.4 (push) Successful in 1m18s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

With the comment field enabled, scales and star ratings accept a
comment alone. It counts as taking part but not in the average or the
distribution; the number is shown separately. The explicit skip button
and its setting are removed again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-21 12:58:01 +01:00
1 parent d6432911ed
commit dbac9e93c7
14 files changed
+85 -105

No files matched your search

-1
View File
@@ -225,7 +225,6 @@ h3 { font-size: 1.05rem; margin-top: 1.6em; }
.button--danger { color: var(--danger); }
.button--danger:hover { border-color: var(--danger); }
.button--ghost { border-color: transparent; background: transparent; }
.button--skip { margin-top: 8px; }
.button--small { padding: 6px 10px; font-size: .85rem; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.button--block { width: 100%; padding: 14px; font-size: 1.05rem; }
+10 -7
View File
@@ -616,7 +616,11 @@
'Kommentar ' + (Comments.index + 1) + ' von ' + Comments.items.length;
text.textContent = item.text;
var value = node.querySelector('[data-comment-value]');
value.textContent = item.value === null || item.value === undefined ? '' : 'Bewertung: ' + Comments.format(item.value);
// With ratings shown, comments sent without one say so (keeps the box at the same height).
var rated = Comments.items.some(function (other) { return other.value !== null && other.value !== undefined; });
value.textContent = item.value === null || item.value === undefined
? (rated ? 'Ohne Bewertung' : '')
: 'Bewertung: ' + Comments.format(item.value);
value.hidden = value.textContent === '';
// Only announce changes the viewer triggered, not every automatic rotation.
node.setAttribute('aria-live', Comments.paused ? 'polite' : 'off');
@@ -797,7 +801,7 @@
el('span', {
class: 'average__count',
text: total + (total === 1 ? ' Bewertung' : ' Bewertungen')
+ (results.skipped ? ' · ' + results.skipped + '× keine Angabe' : '')
+ (results.commentOnly ? ' · ' + results.commentOnly + '× nur Kommentar' : '')
})
]);
},
@@ -3334,11 +3338,10 @@
if (event.defaultPrevented) {
return; // handled via fetch (word cloud)
}
// All buttons (e.g. "Absenden" and "Keine Angabe"); the pressed one is already part of the request.
var buttons = form.querySelectorAll('button[type=submit], button:not([type])');
setTimeout(function () {
buttons.forEach(function (button) { button.disabled = true; });
}, 0);
var button = form.querySelector('button[type=submit], button:not([type])');
if (button) {
setTimeout(function () { button.disabled = true; }, 0);
}
});
});
});