feat(official-tournaments): add venue handling and repair logic for tournament venues
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 1m2s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 1m2s
This commit is contained in:
@@ -580,6 +580,15 @@ class PDFGenerator {
|
||||
this.pdf.text(lines, 105, y + 1, { align: 'center' });
|
||||
y += boxHeight + 4;
|
||||
}
|
||||
const venueLines = Array.isArray(venues) ? venues.filter(Boolean) : [];
|
||||
if (venueLines.length) {
|
||||
const venueText = `${this.t('pdfGenerator.venue')}: ${venueLines.join(' · ')}`;
|
||||
const lines = this.pdf.splitTextToSize(venueText, 210 - this.margin * 2);
|
||||
this.pdf.setFont('helvetica', 'bold');
|
||||
this.pdf.setFontSize(11);
|
||||
this.pdf.text(lines, this.margin, y);
|
||||
y += lines.length * 5 + 3;
|
||||
}
|
||||
this.pdf.setFont('helvetica', 'bold');
|
||||
this.pdf.setFontSize(12);
|
||||
this.pdf.text(`${this.t('pdfGenerator.member')} ${memberName}`, this.margin, y);
|
||||
@@ -632,37 +641,6 @@ class PDFGenerator {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Austragungsort(e) direkt vor den Hinweisen
|
||||
const venueLines = Array.isArray(venues) ? venues.filter(Boolean) : [];
|
||||
if (venueLines.length) {
|
||||
const heading = venueLines.length === 1 ? this.t('pdfGenerator.venue') : this.t('pdfGenerator.venues');
|
||||
const maxWidth = 210 - this.margin * 2;
|
||||
if (y + 20 + venueLines.length * 6 > this.pageHeight) {
|
||||
this.addNewPage();
|
||||
y = this.margin;
|
||||
} else {
|
||||
y += 6;
|
||||
}
|
||||
this.pdf.setFont('helvetica', 'bold');
|
||||
this.pdf.setFontSize(13);
|
||||
this.pdf.text(`${heading}:`, this.margin, y);
|
||||
y += 7;
|
||||
this.pdf.setFont('helvetica', 'normal');
|
||||
this.pdf.setFontSize(12);
|
||||
for (const v of venueLines) {
|
||||
const wrapped = this.pdf.splitTextToSize(String(v), maxWidth);
|
||||
for (const line of wrapped) {
|
||||
this.pdf.text(line, this.margin, y);
|
||||
y += 6;
|
||||
if (y > this.pageHeight) {
|
||||
this.addNewPage();
|
||||
y = this.margin;
|
||||
this.pdf.setFont('helvetica', 'normal');
|
||||
this.pdf.setFontSize(12);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hinweise-Sektion
|
||||
const remainingForHints = 60; // Platz für Überschrift + Liste abschätzen
|
||||
if (y + remainingForHints > this.pageHeight) {
|
||||
|
||||
Reference in New Issue
Block a user