Skip to content

Commit a33628b

Browse files
committed
first approach at ejs templates
1 parent 5a5651e commit a33628b

25 files changed

+315
-210
lines changed
Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
1-
<section>
2-
<h3>Experiencia</h3>
3-
<div class="section__content section__experiencie">
4-
<article>
5-
<header>
6-
<h3>Manfred</h3>
7-
<h3><span>CEO</span><span class="separator"></span><span>Junio 2018 - Actualidad</span></h3>
8-
</header>
9-
<p>
10-
We grew the company from a recruiting agency to become a genuine career management platform. Now, we are
11-
an international team of 45 people, taking care of the career of +20,000 professionals around the World.
12-
To achieve this, we had to: Adapt the organization processes to scale its operations. Implementation of
13-
Holacracy as the management system. Development of own product to scale the company operations,
14-
especially the value added to candidates. Completing the acquisition process by Sngular, maintaining the
15-
company's core of employees without any productivity or sales suffering before, during, and after it.
16-
</p>
17-
</article>
18-
<hr />
19-
<article>
20-
<header>
21-
<h3>Comalatech</h3>
22-
<h3><span>CEO</span><span class="separator"></span><span>Febrero 2017 - Junio 2018</span></h3>
23-
</header>
24-
<p>
25-
Comalatech was a company with 17 employees and 3 million dollar revenue per year, developing plugins
26-
that extend the functionalities of the Atlassian main products. My goal was to scale the organization to
27-
help grow. With these solid foundations, Comalatech was finally acquired by Appfire in 2022.
28-
</p>
29-
</article>
30-
<hr />
31-
<article>
32-
<header>
33-
<h3>Instituto de empresa</h3>
34-
<h3>
35-
<span>Profesor asociado de productividad y metodologías ágiles</span><span class="separator"></span
36-
><span>Sep 2002 - Jun 2006</span>
37-
</h3>
38-
</header>
39-
<p></p>
40-
</article>
41-
</div>
42-
</section>
1+
<%_ if(experienceCollection && experienceCollection.length !== 0){ -%>
2+
<section>
3+
<h3><%- labels.EXPERIENCE_CAREER_HEADING %></h3>
4+
<div class="section__content section__experiencie">
5+
<%_ for(const experience of experienceCollection){ -%>
6+
<article>
7+
<header>
8+
<h3><%- experience.name %></h3>
9+
<h3><span><%- experience.roles[0].name %></span><span class="separator"></span><span><%- new Date(experience.roles[0].startDate).toLocaleDateString(undefined, { year:"numeric", month:"short"})%> <%_ if(experience.roles[0].finishDate && experience.roles[0].finishDate.toLowerCase() !=='actualidad') { -%>
10+
<%- "- "+new Date(experience.roles[0].finishDate).toLocaleDateString(undefined, { year:"numeric", month:"short"}) -%>
11+
<%_ } else { -%>
12+
- Actualidad
13+
<%_}-%></span></h3>
14+
</header>
15+
<p><%- experience.description %></p>
16+
<%_ if(experience.roles[0].challenges && experience.roles[0].challenges.length !== 0) { -%>
17+
18+
19+
<%_ for(const challenge of experience.roles[0].challenges){ -%>
20+
<p><%- challenge.description %></p>
21+
<%_ }-%>
22+
23+
<%_ }-%>
24+
</article>
25+
<hr />
26+
<%_ }-%>
27+
28+
</div>
29+
</section>
30+
<%_ }-%>
31+
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
import ejs from 'ejs';
2+
import { ExperienceVm, mapFromMacCvToExperienceSectionVm } from '@lemoncode/manfred-common/experience-section';
3+
import { Settings, Language, ManfredAwesomicCV } from '@/model';
4+
import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const';
25
import experienceSection from './experience-section.ejs?raw';
6+
import { getLabels } from './labels';
37

4-
export const generateExperienceSection = (): string => ejs.render(experienceSection);
8+
export const generateExperienceSection = (cv: ManfredAwesomicCV, settings: Settings): string => {
9+
const experienceSectionVm = mapFromMacCvToExperienceSectionVm(cv);
10+
11+
return generateExperienceSectionInner(experienceSectionVm, settings.language);
12+
};
13+
14+
const generateExperienceSectionInner = (
15+
experienceSectionVm: ExperienceVm[],
16+
language: Language = ISO_SPANISH_LANGUAGE
17+
): string => {
18+
const rootObject = {
19+
experienceCollection: experienceSectionVm,
20+
labels: getLabels(language),
21+
};
22+
23+
return ejs.render(experienceSection, rootObject);
24+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ExperienceLabels } from './experience-label.model';
2+
3+
export const englishExperienceLabels: ExperienceLabels = {
4+
EXPERIENCE_CAREER_HEADING: 'Experience / Career',
5+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface ExperienceLabels {
2+
EXPERIENCE_CAREER_HEADING: string;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ExperienceLabels } from './experience-label.model';
2+
3+
export const spanishExperienceLabels: ExperienceLabels = {
4+
EXPERIENCE_CAREER_HEADING: 'Experiencia / Carrera',
5+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Language } from '@/model';
2+
import { ExperienceLabels } from './experience-label.model';
3+
import { spanishExperienceLabels } from './experience-spanish-labels.const';
4+
import { englishExperienceLabels } from './experience-english-labels.const';
5+
6+
export const getLabels = (language: Language): ExperienceLabels => {
7+
switch (language) {
8+
case 'es':
9+
return spanishExperienceLabels;
10+
case 'en':
11+
return englishExperienceLabels;
12+
default:
13+
throw new Error(`Language not supported: ${language}`);
14+
}
15+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Language } from '@/model';
2+
import { LanguageLabels } from './language-label.model';
3+
import { spanishLanguageLabels } from './language-spanish-labels.const';
4+
import { englishLanguageLabels } from './language-english-labels.const';
5+
6+
export const getLabels = (language: Language): LanguageLabels => {
7+
switch (language) {
8+
case 'es':
9+
return spanishLanguageLabels;
10+
case 'en':
11+
return englishLanguageLabels;
12+
default:
13+
throw new Error(`Language not supported: ${language}`);
14+
}
15+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LanguageLabels } from './language-label.model';
2+
3+
export const englishLanguageLabels: LanguageLabels = {
4+
LANGUAGE_HEADING: 'Languages',
5+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface LanguageLabels {
2+
LANGUAGE_HEADING: string;
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LanguageLabels } from './language-label.model';
2+
3+
export const spanishLanguageLabels: LanguageLabels = {
4+
LANGUAGE_HEADING: 'Idiomas',
5+
};

0 commit comments

Comments
 (0)