From 734916251c298f4e329db9c62030c26abaee1ced Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Thu, 27 May 2021 00:48:06 -0400
Subject: [PATCH] delay art draw on endweek until after clothing choice

---
 src/endWeek/reports/arcadeReport.js           | 3 ++-
 src/endWeek/reports/brothelReport.js          | 6 ++++--
 src/endWeek/reports/cellblockReport.js        | 8 +++++---
 src/endWeek/reports/clinicReport.js           | 6 ++++--
 src/endWeek/reports/clubReport.js             | 6 ++++--
 src/endWeek/reports/dairyReport.js            | 6 ++++--
 src/endWeek/reports/farmyardReport.js         | 6 ++++--
 src/endWeek/reports/masterSuiteReport.js      | 6 ++++--
 src/endWeek/reports/nurseryReport.js          | 6 ++++--
 src/endWeek/reports/schoolroomReport.js       | 6 ++++--
 src/endWeek/reports/servantsQuartersReport.js | 6 ++++--
 src/endWeek/reports/spaReport.js              | 6 ++++--
 12 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/src/endWeek/reports/arcadeReport.js b/src/endWeek/reports/arcadeReport.js
index 86bf873ce2d..fb3894ec553 100644
--- a/src/endWeek/reports/arcadeReport.js
+++ b/src/endWeek/reports/arcadeReport.js
@@ -82,7 +82,7 @@ App.EndWeek.arcadeReport = function() {
 		if (V.showEWD !== 0) {
 			const {He} = getPronouns(slave);
 			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			r = [];
 			r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
@@ -102,6 +102,7 @@ App.EndWeek.arcadeReport = function() {
 				"div",
 				"indent"
 			);
+			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/brothelReport.js b/src/endWeek/reports/brothelReport.js
index d68b757f873..41342c1dbb4 100644
--- a/src/endWeek/reports/brothelReport.js
+++ b/src/endWeek/reports/brothelReport.js
@@ -266,7 +266,7 @@ App.EndWeek.brothelReport = function() {
 		tired(madam);
 		if (V.showEWD !== 0) {
 			const madamEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(madamEntry, madam);
+			const artSpan = App.UI.DOM.appendNewElement("span", madamEntry);
 			App.SlaveAssignment.appendSlaveLinks(madamEntry, madam);
 			App.Events.addNode(
 				madamEntry,
@@ -276,6 +276,7 @@ App.EndWeek.brothelReport = function() {
 				]
 			);
 			madamEntry.append(App.SlaveAssignment.standardSlaveReport(madam, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, madam);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(madam, true);
 		}
@@ -338,7 +339,7 @@ App.EndWeek.brothelReport = function() {
 			if (V.showEWD !== 0) {
 				const {He} = getPronouns(slave);
 				const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-				App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+				const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 				App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 				r = [];
 				r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
@@ -359,6 +360,7 @@ App.EndWeek.brothelReport = function() {
 					"indent"
 				);
 				slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+				App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 			} else {
 				// discard return values silently
 				App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/cellblockReport.js b/src/endWeek/reports/cellblockReport.js
index 61ec7021206..76d0ceaab01 100644
--- a/src/endWeek/reports/cellblockReport.js
+++ b/src/endWeek/reports/cellblockReport.js
@@ -174,7 +174,7 @@ App.EndWeek.cellblockReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const wardenessEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(wardenessEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", wardenessEntry);
 			App.SlaveAssignment.appendSlaveLinks(wardenessEntry, slave);
 			App.Events.addNode(
 				wardenessEntry,
@@ -184,6 +184,7 @@ App.EndWeek.cellblockReport = function() {
 				]
 			);
 			wardenessEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -293,7 +294,7 @@ App.EndWeek.cellblockReport = function() {
 
 		if (V.showEWD !== 0) {
 			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			r = [];
 			r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
@@ -310,7 +311,8 @@ App.EndWeek.cellblockReport = function() {
 				brokenSlaves++;
 				continue; // slave has been reassigned; remaining report will run at her new assignment
 			}
-			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			artSpan.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/clinicReport.js b/src/endWeek/reports/clinicReport.js
index f75cb416b2c..9e4a8590194 100644
--- a/src/endWeek/reports/clinicReport.js
+++ b/src/endWeek/reports/clinicReport.js
@@ -257,10 +257,11 @@ App.EndWeek.clinicReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const nurseEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(nurseEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", nurseEntry);
 			App.SlaveAssignment.appendSlaveLinks(nurseEntry, slave);
 			$(nurseEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as the clinical nurse.`);
 			nurseEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -398,7 +399,7 @@ App.EndWeek.clinicReport = function() {
 
 		if (V.showEWD !== 0) {
 			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			$(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `);
 			if (slave.choosesOwnAssignment === 2) {
@@ -412,6 +413,7 @@ App.EndWeek.clinicReport = function() {
 				$(patientContent).append(`${He} stays in the clinic ${toSentence(remainReasons)}.`);
 			}
 			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/clubReport.js b/src/endWeek/reports/clubReport.js
index 0d79a0438f8..172bf78bbae 100644
--- a/src/endWeek/reports/clubReport.js
+++ b/src/endWeek/reports/clubReport.js
@@ -151,7 +151,7 @@ App.EndWeek.clubReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const DJEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(DJEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", DJEntry);
 			App.SlaveAssignment.appendSlaveLinks(DJEntry, slave);
 			App.Events.addNode(
 				DJEntry,
@@ -161,6 +161,7 @@ App.EndWeek.clubReport = function() {
 				]
 			);
 			DJEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -203,7 +204,7 @@ App.EndWeek.clubReport = function() {
 
 			if (V.showEWD !== 0) {
 				const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-				App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+				const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 				App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 				r = [];
 				r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
@@ -225,6 +226,7 @@ App.EndWeek.clubReport = function() {
 					"indent"
 				);
 				slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+				App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 			} else {
 				// discard return values silently
 				App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/dairyReport.js b/src/endWeek/reports/dairyReport.js
index 243cde7eced..73d5840e7fe 100644
--- a/src/endWeek/reports/dairyReport.js
+++ b/src/endWeek/reports/dairyReport.js
@@ -339,7 +339,7 @@ App.EndWeek.dairyReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const milkMaidEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(milkMaidEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", milkMaidEntry);
 			App.SlaveAssignment.appendSlaveLinks(milkMaidEntry, slave);
 			App.Events.addNode(
 				milkMaidEntry,
@@ -349,6 +349,7 @@ App.EndWeek.dairyReport = function() {
 				]
 			);
 			milkMaidEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -461,7 +462,7 @@ App.EndWeek.dairyReport = function() {
 		cumWeek += milkResults.cum;
 		if (V.showEWD !== 0) {
 			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			r = [];
 			r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
@@ -483,6 +484,7 @@ App.EndWeek.dairyReport = function() {
 				"indent"
 			);
 			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/farmyardReport.js b/src/endWeek/reports/farmyardReport.js
index 389fdb27dfa..93ed24e49df 100644
--- a/src/endWeek/reports/farmyardReport.js
+++ b/src/endWeek/reports/farmyardReport.js
@@ -258,10 +258,11 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() {
 
 		if (V.showEWD) {
 			const farmerEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(farmerEntry, Farmer);
+			const artSpan = App.UI.DOM.appendNewElement("span", farmerEntry);
 			App.SlaveAssignment.appendSlaveLinks(farmerEntry, Farmer);
 			$(farmerEntry).append(`<span class="slave-name">${SlaveFullName(Farmer)}</span> is serving as the Farmer.`);
 			farmerEntry.append(App.SlaveAssignment.standardSlaveReport(Farmer, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, Farmer);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(Farmer, true);
 		}
@@ -353,7 +354,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() {
 
 			if (V.showEWD) {
 				const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-				App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+				const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 				App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 				$(slaveEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> `);
 
@@ -376,6 +377,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() {
 
 				$(farmhandContent).append(App.SlaveAssignment.workTheFarm(slave));
 				slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+				App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 			} else {	// silently discard return values
 				App.SlaveAssignment.workTheFarm(slave);
 				App.SlaveAssignment.standardSlaveReport(slave, true);
diff --git a/src/endWeek/reports/masterSuiteReport.js b/src/endWeek/reports/masterSuiteReport.js
index c6d08951a85..ed0f38e7341 100644
--- a/src/endWeek/reports/masterSuiteReport.js
+++ b/src/endWeek/reports/masterSuiteReport.js
@@ -431,16 +431,18 @@ App.EndWeek.masterSuiteReport = function() {
 	if (concubine) {
 		tired(concubine);
 		const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-		App.SlaveAssignment.appendSlaveArt(slaveEntry, concubine);
+		const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 		App.SlaveAssignment.appendSlaveLinks(slaveEntry, concubine);
 		App.Events.addNode(slaveEntry, [concubineText(), commonText(concubine)]);
+		App.SlaveAssignment.appendSlaveArt(artSpan, concubine);
 	}
 
 	for (const slave of App.SlaveAssignment.reportSlaves(slaves)) {
 		const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-		App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+		const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 		App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 		App.Events.addNode(slaveEntry, [nonConcubineText(slave), commonText(slave)]);
+		App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 	}
 
 	if (pregnantSlaves > 0 && V.arcologies[0].FSRestart !== "unset" && V.propOutcome !== 1 && V.eugenicsFullControl !== 1) {
diff --git a/src/endWeek/reports/nurseryReport.js b/src/endWeek/reports/nurseryReport.js
index 71540f5f083..821fb0ec56f 100644
--- a/src/endWeek/reports/nurseryReport.js
+++ b/src/endWeek/reports/nurseryReport.js
@@ -140,10 +140,11 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() {
 
 		if (V.showEWD !== 0) {
 			const matronEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(matronEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", matronEntry);
 			App.SlaveAssignment.appendSlaveLinks(matronEntry, slave);
 			$(matronEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> is serving as your Matron.`);
 			matronEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -196,7 +197,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() {
 		if (V.showEWD) {
 			const {He} = getPronouns(slave);
 			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			$(slaveEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> `);
 
@@ -211,6 +212,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() {
 			$(nannyContent).append(`${He} ${App.SlaveAssignment.nanny(slave, matronBonus)}`);	// FIXME: nanny() takes one argument
 
 			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {	// silently discard return values
 			App.SlaveAssignment.nanny(slave, matronBonus);	// FIXME: nanny() takes one argument
 			App.SlaveAssignment.standardSlaveReport(slave, true);
diff --git a/src/endWeek/reports/schoolroomReport.js b/src/endWeek/reports/schoolroomReport.js
index c80b267bce9..ba4a6f59445 100644
--- a/src/endWeek/reports/schoolroomReport.js
+++ b/src/endWeek/reports/schoolroomReport.js
@@ -152,10 +152,11 @@ App.EndWeek.schoolroomReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const schoolteacherEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(schoolteacherEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", schoolteacherEntry);
 			App.SlaveAssignment.appendSlaveLinks(schoolteacherEntry, slave);
 			$(schoolteacherEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Schoolteacher.`);
 			schoolteacherEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -225,7 +226,7 @@ App.EndWeek.schoolroomReport = function() {
 		if (V.showEWD !== 0) {
 			const {He} = getPronouns(slave);
 			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			$(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `);
 			if (slave.choosesOwnAssignment === 2) {
@@ -242,6 +243,7 @@ App.EndWeek.schoolroomReport = function() {
 			const studentContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent");
 			$(studentContent).append(`${He} ${App.SlaveAssignment.takeClasses(slave)}`);
 			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/servantsQuartersReport.js b/src/endWeek/reports/servantsQuartersReport.js
index ee308803e0b..623406d9ee9 100644
--- a/src/endWeek/reports/servantsQuartersReport.js
+++ b/src/endWeek/reports/servantsQuartersReport.js
@@ -241,10 +241,11 @@ App.EndWeek.servantsQuartersReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const stewardessEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(stewardessEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", stewardessEntry);
 			App.SlaveAssignment.appendSlaveLinks(stewardessEntry, slave);
 			$(stewardessEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> is serving as your Stewardess.`);
 			stewardessEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -314,7 +315,7 @@ App.EndWeek.servantsQuartersReport = function() {
 		if (V.showEWD !== 0) {
 			const {He} = getPronouns(slave);
 			const slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			$(slaveEntry).append(`<span class='slave-name'>${SlaveFullName(slave)}</span> `);
 			if (slave.choosesOwnAssignment === 2) {
@@ -332,6 +333,7 @@ App.EndWeek.servantsQuartersReport = function() {
 				SQMilkSale += milkResults.milkSale;
 			}
 			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
diff --git a/src/endWeek/reports/spaReport.js b/src/endWeek/reports/spaReport.js
index 1e9884e14d9..0c728e041c0 100644
--- a/src/endWeek/reports/spaReport.js
+++ b/src/endWeek/reports/spaReport.js
@@ -289,7 +289,7 @@ App.EndWeek.spaReport = function() {
 		/* apply following SA passages to facility leader */
 		if (V.showEWD !== 0) {
 			const attendantEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(attendantEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", attendantEntry);
 			App.SlaveAssignment.appendSlaveLinks(attendantEntry, slave);
 			App.Events.addNode(
 				attendantEntry,
@@ -299,6 +299,7 @@ App.EndWeek.spaReport = function() {
 					App.SlaveAssignment.standardSlaveReport(slave, false),
 				]
 			);
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			App.SlaveAssignment.standardSlaveReport(slave, true);
 		}
@@ -374,7 +375,7 @@ App.EndWeek.spaReport = function() {
 
 		if (V.showEWD !== 0) {
 			const slaveEntry = App.UI.DOM.appendNewElement("div", el, '', "slave-report");
-			App.SlaveAssignment.appendSlaveArt(slaveEntry, slave);
+			const artSpan = App.UI.DOM.appendNewElement("span", slaveEntry);
 			App.SlaveAssignment.appendSlaveLinks(slaveEntry, slave);
 			r = [];
 			r.push(App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name"));
@@ -402,6 +403,7 @@ App.EndWeek.spaReport = function() {
 			}
 			App.Events.addNode(slaveEntry, r, "div", "indent");
 			slaveEntry.append(App.SlaveAssignment.standardSlaveReport(slave, false));
+			App.SlaveAssignment.appendSlaveArt(artSpan, slave);
 		} else {
 			// discard return values silently
 			App.SlaveAssignment.choosesOwnJob(slave);
-- 
GitLab