diff --git a/src/assets/certificate/background-blue.jpeg b/src/assets/certificate/background-blue.jpeg new file mode 100644 index 0000000..03eadf5 Binary files /dev/null and b/src/assets/certificate/background-blue.jpeg differ diff --git a/src/assets/certificate/background-green.jpeg b/src/assets/certificate/background-green.jpeg new file mode 100644 index 0000000..20b4d96 Binary files /dev/null and b/src/assets/certificate/background-green.jpeg differ diff --git a/src/assets/certificate/background-orange.jpeg b/src/assets/certificate/background-orange.jpeg new file mode 100644 index 0000000..9c6df35 Binary files /dev/null and b/src/assets/certificate/background-orange.jpeg differ diff --git a/src/assets/certificate/signature-gablas.png b/src/assets/certificate/signature-gablas.png new file mode 100644 index 0000000..7a77550 Binary files /dev/null and b/src/assets/certificate/signature-gablas.png differ diff --git a/src/assets/certificate/signature-husam.png b/src/assets/certificate/signature-husam.png new file mode 100644 index 0000000..a56382a Binary files /dev/null and b/src/assets/certificate/signature-husam.png differ diff --git a/src/services/ai-kurzy/certificate.service.js b/src/services/ai-kurzy/certificate.service.js index 24d7bec..d51f63d 100644 --- a/src/services/ai-kurzy/certificate.service.js +++ b/src/services/ai-kurzy/certificate.service.js @@ -20,13 +20,26 @@ export const CERTIFICATE_TEMPLATES = { name: 'AI Certifikát', file: 'AIcertifikat.html', description: 'Osvedčenie o absolvovaní AI kurzu', + background: 'background.jpeg', + }, + ScrumGeneric: { + name: 'Scrum (Gablas)', + file: 'ScrumGeneric.html', + description: 'Scrum Master / Product Owner - lektor Gablas', + background: 'background-blue.jpeg', + }, + ITIL: { + name: 'ITIL (Husam)', + file: 'ITIL.html', + description: 'ITIL Foundation - lektor Husam', + background: 'background-green.jpeg', + }, + PRINCE2: { + name: 'PRINCE2 (Gablas)', + file: 'PRINCE2.html', + description: 'PRINCE2 Foundation/Practitioner - lektor Gablas', + background: 'background-orange.jpeg', }, - // Add more templates here in the future - // participation: { - // name: 'Potvrdenie o účasti', - // file: 'participation.html', - // description: 'Potvrdenie o účasti na školení', - // }, }; /** @@ -57,9 +70,12 @@ const generateCertificateId = (registraciaId) => { /** * Load assets as base64 for embedding in HTML */ -const loadAssets = async () => { +const loadAssets = async (templateName) => { + const template = CERTIFICATE_TEMPLATES[templateName]; + const backgroundFile = template?.background || 'background.jpeg'; + const [background, signatureGablasova, signatureZdarilek] = await Promise.all([ - fs.readFile(path.join(ASSETS_DIR, 'background.jpeg')), + 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')), ]); @@ -196,7 +212,7 @@ export const generateCertificate = async (registraciaId, templateName = 'AIcerti // Load template and assets const [templateHtml, assets] = await Promise.all([ loadTemplate(templateName), - loadAssets(), + loadAssets(templateName), ]); // Generate certificate data diff --git a/src/templates/certificates/ITIL.html b/src/templates/certificates/ITIL.html new file mode 100644 index 0000000..77bc4d9 --- /dev/null +++ b/src/templates/certificates/ITIL.html @@ -0,0 +1,120 @@ + + + + + + Osvedčenie - {{participantName}} + + + +
+
+

{{courseTitle}}

+ {{#if dateRange}} +

{{dateRange}}

+ {{/if}} + {{#if courseHours}} +

v rozsahu {{courseHours}} hodín

+ {{/if}} +
+ +
+

{{participantName}}

+
+ +
{{issueDate}}
+
ID: {{certificateId}}
+
+ + diff --git a/src/templates/certificates/PRINCE2.html b/src/templates/certificates/PRINCE2.html new file mode 100644 index 0000000..77bc4d9 --- /dev/null +++ b/src/templates/certificates/PRINCE2.html @@ -0,0 +1,120 @@ + + + + + + Osvedčenie - {{participantName}} + + + +
+
+

{{courseTitle}}

+ {{#if dateRange}} +

{{dateRange}}

+ {{/if}} + {{#if courseHours}} +

v rozsahu {{courseHours}} hodín

+ {{/if}} +
+ +
+

{{participantName}}

+
+ +
{{issueDate}}
+
ID: {{certificateId}}
+
+ + diff --git a/src/templates/certificates/ScrumGeneric.html b/src/templates/certificates/ScrumGeneric.html new file mode 100644 index 0000000..0a75ca8 --- /dev/null +++ b/src/templates/certificates/ScrumGeneric.html @@ -0,0 +1,126 @@ + + + + + + Osvedčenie - {{participantName}} + + + +
+
+

{{courseTitle}}

+ {{#if dateRange}} +

{{dateRange}}

+ {{/if}} + {{#if courseHours}} +

v rozsahu {{courseHours}} hodín

+ {{/if}} +
+ +
+

{{participantName}}

+
+ +
{{issueDate}}
+
ID: {{certificateId}}
+
+ +