From 1ab5ceaac777055d7b353b5112ac73b451fcf03e Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 30 Apr 2026 10:50:03 +0200 Subject: [PATCH] Update worship export colors in worshipController.js: Introduce dynamic color assignment for title, organizer, service, and organ text based on the worship format and neighbor invitation status, enhancing visual differentiation in exported documents. --- controllers/worshipController.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/controllers/worshipController.js b/controllers/worshipController.js index b75e8fa..15906ea 100644 --- a/controllers/worshipController.js +++ b/controllers/worshipController.js @@ -2686,6 +2686,13 @@ exports.exportWorships = async (req, res) => { const sacristanServiceStr = worship.sacristanService || ''; const organPlayingStr = worship.organPlaying || ''; const includeInternalServiceInfo = format !== 'newsletter'; + const isNeighborInvitation = !!worship.neighborInvitation; + const titleColor = format === 'newsletter' + ? (isNeighborInvitation ? '0432FF' : '000000') + : (isNeighborInvitation ? '0432FF' : '009051'); + const organizerColor = 'EE0000'; + const serviceColor = '0070C0'; + const organColor = 'FF9300'; const secondCellChildren = []; @@ -2693,7 +2700,7 @@ exports.exportWorships = async (req, res) => { secondCellChildren.push(new TextRun({ text: `${timeStr} ${titleStr}`, bold: true, - color: '000000', + color: titleColor, font: 'Arial', size: 22 // 11pt = 22 half-points })); @@ -2707,14 +2714,14 @@ exports.exportWorships = async (req, res) => { secondCellChildren.push(new TextRun({ text: 'Gestaltung: ', bold: true, - color: '000000', + color: organizerColor, font: 'Arial', size: 22 })); secondCellChildren.push(new TextRun({ text: organizerStr, bold: true, - color: '000000', + color: organizerColor, font: 'Arial', size: 22 })); @@ -2728,13 +2735,13 @@ exports.exportWorships = async (req, res) => { })); secondCellChildren.push(new TextRun({ text: 'Dienst: ', - color: '000000', + color: serviceColor, font: 'Arial', size: 22 })); secondCellChildren.push(new TextRun({ text: sacristanServiceStr, - color: '000000', + color: serviceColor, font: 'Arial', size: 22 })); @@ -2768,13 +2775,13 @@ exports.exportWorships = async (req, res) => { })); secondCellChildren.push(new TextRun({ text: 'Orgel: ', - color: '000000', + color: organColor, font: 'Arial', size: 22 })); secondCellChildren.push(new TextRun({ text: organPlayingStr, - color: '000000', + color: organColor, font: 'Arial', size: 22 }));