[verified] style: remove playback status labels
This commit is contained in:
1 parent
3349afa386
commit
4011aff8fb
3 files changed
+14
-17
No files matched your search
+3
-6
@@ -41,14 +41,11 @@ async function setEq(uid, control, value, input) {
|
||||
}
|
||||
}
|
||||
function option(value, text) { const item = el('option', null, text); item.value = value; return item; }
|
||||
function stateName(state) { return ({PLAYING:'WIEDERGABE', PAUSED_PLAYBACK:'PAUSIERT', STOPPED:'GESTOPPT', TRANSITIONING:'WECHSEL', UNAVAILABLE:'NICHT ERREICHBAR'})[state] || state; }
|
||||
|
||||
function render() {
|
||||
const root = $('#zones'); root.replaceChildren();
|
||||
for (const zone of zones) {
|
||||
const card = el('article', 'zone'), head = el('div', 'zone-head'), names = el('div');
|
||||
names.append(el('h2', null, zone.name));
|
||||
head.append(names, el('span', 'state', stateName(zone.state)));
|
||||
const card = el('article', 'zone');
|
||||
const name = el('h2', null, zone.name);
|
||||
const track = el('p', 'track', zone.error || (zone.track.title ? `${zone.track.title}${zone.track.artist ? ' · ' + zone.track.artist : ''}` : 'Kein aktueller Titel'));
|
||||
const controls = el('div', 'controls');
|
||||
for (const [icon, label, action] of [['▶','Play','play'], ['Ⅱ','Pause','pause'], ['■','Stopp','stop']]) {
|
||||
@@ -77,7 +74,7 @@ function render() {
|
||||
const leave = el('button', 'danger', 'Aus Gruppe lösen'); leave.hidden = zone.memberUids.length < 2;
|
||||
leave.onclick = () => act(`/api/groups/${encodeURIComponent(zone.uid)}`, 'DELETE');
|
||||
const zoneActions = el('div', 'zone-actions'); zoneActions.append(loudness, leave);
|
||||
card.append(head, track, controls, volume, eq, zoneActions); root.append(card);
|
||||
card.append(name, track, controls, volume, eq, zoneActions); root.append(card);
|
||||
}
|
||||
renderSelects(); loadMusic();
|
||||
}
|
||||
|
||||
@@ -72,17 +72,6 @@ h2 {
|
||||
box-shadow: 0 8px 28px #0005;
|
||||
}
|
||||
|
||||
.zone-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 9px;
|
||||
}
|
||||
|
||||
.state {
|
||||
color: #d8b4fe;
|
||||
font-size: .68rem;
|
||||
}
|
||||
|
||||
.track {
|
||||
min-height: 32px;
|
||||
margin: 8px 0;
|
||||
|
||||
@@ -246,3 +246,14 @@ def test_frontend_serializes_eq_writes_and_reloads_confirmed_values():
|
||||
assert source.count("await load(false)") >= 3
|
||||
assert "loudness.dataset.value !== 'true'" in source
|
||||
assert "value:!zone.loudness" not in source
|
||||
|
||||
|
||||
def test_zone_cards_render_name_directly_without_transport_status():
|
||||
source = Path("app/static/app.js").read_text(encoding="utf-8")
|
||||
styles = Path("app/static/style.css").read_text(encoding="utf-8")
|
||||
assert "stateName" not in source
|
||||
assert "el('span', 'state'" not in source
|
||||
assert "WIEDERGABE" not in source
|
||||
assert "zone-head" not in source
|
||||
assert ".zone-head" not in styles
|
||||
assert "card.append(name, track, controls, volume, eq, zoneActions)" in source
|
||||
Reference in new issue
Block a user