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.
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 6s

This commit is contained in:
Torsten Schulz (local)
2026-04-30 10:50:03 +02:00
parent 2fd5dc0389
commit 1ab5ceaac7

View File

@@ -2686,6 +2686,13 @@ exports.exportWorships = async (req, res) => {
const sacristanServiceStr = worship.sacristanService || ''; const sacristanServiceStr = worship.sacristanService || '';
const organPlayingStr = worship.organPlaying || ''; const organPlayingStr = worship.organPlaying || '';
const includeInternalServiceInfo = format !== 'newsletter'; 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 = []; const secondCellChildren = [];
@@ -2693,7 +2700,7 @@ exports.exportWorships = async (req, res) => {
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: `${timeStr} ${titleStr}`, text: `${timeStr} ${titleStr}`,
bold: true, bold: true,
color: '000000', color: titleColor,
font: 'Arial', font: 'Arial',
size: 22 // 11pt = 22 half-points size: 22 // 11pt = 22 half-points
})); }));
@@ -2707,14 +2714,14 @@ exports.exportWorships = async (req, res) => {
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: 'Gestaltung: ', text: 'Gestaltung: ',
bold: true, bold: true,
color: '000000', color: organizerColor,
font: 'Arial', font: 'Arial',
size: 22 size: 22
})); }));
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: organizerStr, text: organizerStr,
bold: true, bold: true,
color: '000000', color: organizerColor,
font: 'Arial', font: 'Arial',
size: 22 size: 22
})); }));
@@ -2728,13 +2735,13 @@ exports.exportWorships = async (req, res) => {
})); }));
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: 'Dienst: ', text: 'Dienst: ',
color: '000000', color: serviceColor,
font: 'Arial', font: 'Arial',
size: 22 size: 22
})); }));
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: sacristanServiceStr, text: sacristanServiceStr,
color: '000000', color: serviceColor,
font: 'Arial', font: 'Arial',
size: 22 size: 22
})); }));
@@ -2768,13 +2775,13 @@ exports.exportWorships = async (req, res) => {
})); }));
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: 'Orgel: ', text: 'Orgel: ',
color: '000000', color: organColor,
font: 'Arial', font: 'Arial',
size: 22 size: 22
})); }));
secondCellChildren.push(new TextRun({ secondCellChildren.push(new TextRun({
text: organPlayingStr, text: organPlayingStr,
color: '000000', color: organColor,
font: 'Arial', font: 'Arial',
size: 22 size: 22
})); }));