Live-Tag: Sterne nach Abschluss immer am Balkenende (gold, gefuellt+leer)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 20:31:21 +02:00
parent 25faca0819
commit 05ace93318
+11 -2
View File
@@ -1732,13 +1732,12 @@ async function renderLiveSummary() {
var pctW = Math.max(0.8, pctR - pctL); // mindestens 0.8 % sichtbar
var simShort = LIVE_SIM_SHORT[sess.simId] || sess.simIcon || sess.simId;
var lbl = simShort + (sess.lessonLabel ? ' '+sess.lessonLabel : '');
var stars = (sess.stars != null) ? (' ' + '★'.repeat(Math.max(0,Math.min(5,sess.stars))) + '☆'.repeat(5-Math.max(0,Math.min(5,sess.stars)))) : '';
var color = _liveSuccessColor(sess.success);
var tip = (sess.simTitle||sess.simId) + (sess.lessonLabel?' · '+sess.lessonLabel:'')
+ ' · ' + _fmtHM(sess.startMs) + '' + _fmtHM(endMs)
+ ' · ' + _liveFmtMin(realDurSec)
+ (sess.stars!=null?' · '+sess.stars+'/5★':'');
var inner = (pctW < 3) ? '' : (pctW < 8) ? simShort : (lbl + stars);
var inner = (pctW < 3) ? '' : (pctW < 8) ? simShort : lbl;
var sessKey = s.studentId + ':' + sess.simId + ':' + (sess.lessonLabel||'_') + ':' + sess.startMs;
html += '<div onclick="openLiveSessionDetail(\''+sessKey+'\')" '
+ 'title="'+esc(tip)+'" '
@@ -1748,6 +1747,16 @@ async function renderLiveSummary() {
+ 'white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;'
+ 'box-shadow:0 1px 2px rgba(0,0,0,.1)">'
+ esc(inner) + '</div>';
// Nach Abschluss immer die Sterne (gold) am Balkenende zeigen
if (sess.stars != null) {
var _sc = Math.max(0, Math.min(5, sess.stars));
var _starTxt = '★'.repeat(_sc) + '<span style="color:#d9d2be">' + '★'.repeat(5-_sc) + '</span>';
var _rightEdge = pctR > 82;
html += '<span style="position:absolute;'
+ (_rightEdge ? 'right:'+(100-pctR)+'%;padding-right:4px;' : 'left:'+pctR+'%;padding-left:3px;')
+ 'top:0;height:28px;line-height:28px;font-size:.62rem;color:#e0a838;font-weight:700;'
+ 'letter-spacing:.5px;white-space:nowrap;pointer-events:none">'+_starTxt+'</span>';
}
});
html += '</div>';
});