feat: Add 8 certificate templates with different courses and lecturers

Templates:
- AIcertifikat (Zdarílek), AIcertifikatGablas, AIcertifikatPatrik
- ScrumMaster, ScrumProductOwner (blue background)
- ITILFoundation (green background)
- PRINCE2Foundation, PRINCE2Practitioner (orange background)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2026-01-29 17:15:44 +01:00
parent f7d252ee7b
commit e923e42a65
10 changed files with 630 additions and 113 deletions

View File

@@ -16,28 +16,56 @@ const TEMPLATES_DIR = path.join(process.cwd(), 'src', 'templates', 'certificates
* Available certificate templates
*/
export const CERTIFICATE_TEMPLATES = {
// AI certifikáty s dynamickým názvom kurzu a rôznymi lektormi
AIcertifikat: {
name: 'AI Certifikát',
name: 'AI Certifikát (Zdarílek)',
file: 'AIcertifikat.html',
description: 'Osvedčenie o absolvovaní AI kurzu',
description: 'AI kurz - lektor Zdarílek + Gablasová',
background: 'background.jpeg',
},
ScrumGeneric: {
name: 'Scrum (Gablas)',
file: 'ScrumGeneric.html',
description: 'Scrum Master / Product Owner - lektor Gablas',
AIcertifikatGablas: {
name: 'AI Certifikát (Gablas)',
file: 'AIcertifikatGablas.html',
description: 'AI kurz - lektor Gablas + Gablasová',
background: 'background.jpeg',
},
AIcertifikatPatrik: {
name: 'AI Certifikát (Patrik)',
file: 'AIcertifikatPatrik.html',
description: 'AI kurz - lektor Patrik + Gablasová',
background: 'background.jpeg',
},
// Scrum certifikáty - fixný názov kurzu, podpisy v pozadí
ScrumMaster: {
name: 'Scrum Master',
file: 'ScrumMaster.html',
description: 'Scrum Master - Gablas + Gablasová',
background: 'background-blue.jpeg',
},
ITIL: {
name: 'ITIL (Husam)',
file: 'ITIL.html',
description: 'ITIL Foundation - lektor Husam',
ScrumProductOwner: {
name: 'Scrum Product Owner',
file: 'ScrumProductOwner.html',
description: 'Scrum Product Owner - Gablas + Gablasová',
background: 'background-blue.jpeg',
},
// ITIL certifikát - fixný názov kurzu, podpisy v pozadí
ITILFoundation: {
name: 'ITIL® 4 Foundation',
file: 'ITILFoundation.html',
description: 'ITIL Foundation - Husam + Gablasová',
background: 'background-green.jpeg',
},
PRINCE2: {
name: 'PRINCE2 (Gablas)',
file: 'PRINCE2.html',
description: 'PRINCE2 Foundation/Practitioner - lektor Gablas',
// PRINCE2 certifikáty - fixný názov kurzu, podpisy v pozadí
PRINCE2Foundation: {
name: 'PRINCE2® Foundation',
file: 'PRINCE2Foundation.html',
description: 'PRINCE2 Foundation - Gablas + Gablasová',
background: 'background-orange.jpeg',
},
PRINCE2Practitioner: {
name: 'PRINCE2® Practitioner',
file: 'PRINCE2Practitioner.html',
description: 'PRINCE2 Practitioner - Gablas + Gablasová',
background: 'background-orange.jpeg',
},
};
@@ -74,16 +102,20 @@ const loadAssets = async (templateName) => {
const template = CERTIFICATE_TEMPLATES[templateName];
const backgroundFile = template?.background || 'background.jpeg';
const [background, signatureGablasova, signatureZdarilek] = await Promise.all([
const [background, signatureGablasova, signatureZdarilek, signatureGablas, signaturePatrik] = await Promise.all([
fs.readFile(path.join(ASSETS_DIR, backgroundFile)),
fs.readFile(path.join(ASSETS_DIR, 'signature-gablasova.png')),
fs.readFile(path.join(ASSETS_DIR, 'signature-zdarilek.png')),
fs.readFile(path.join(ASSETS_DIR, 'signature-gablas.png')),
fs.readFile(path.join(ASSETS_DIR, 'signature-patrik.png')),
]);
return {
backgroundImage: `data:image/jpeg;base64,${background.toString('base64')}`,
signatureGablasova: `data:image/png;base64,${signatureGablasova.toString('base64')}`,
signatureZdarilek: `data:image/png;base64,${signatureZdarilek.toString('base64')}`,
signatureGablas: `data:image/png;base64,${signatureGablas.toString('base64')}`,
signaturePatrik: `data:image/png;base64,${signaturePatrik.toString('base64')}`,
};
};