-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…n-Create-Experience-section Closed #264
- Loading branch information
Showing
12 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...d2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<%_ if(experienceCollection && experienceCollection.length !== 0) { -%> | ||
<section class="main__section"> | ||
<div class="main__section__header"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="6" viewBox="0 0 32 6" fill="none"> | ||
<path d="M5.51343e-07 3L32 3" stroke="#3BA0B7" stroke-width="6" /> | ||
</svg> | ||
<h2><%- labels.EXPERIENCE_CAREER_HEADING %></h2> | ||
</div> | ||
<%_ for(const experience of experienceCollection) { -%> | ||
<section class="main__section__item"> | ||
<h3><%= experience.name %></h3> | ||
<h4><%= experience.roles[0].name %></h4> | ||
<div class="section__content__date"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none"> | ||
<path | ||
opacity="0.75" | ||
d="M4.33333 1V3M13.6667 1V3M1 15V5C1 4.46957 1.21071 3.96086 1.58579 3.58579C1.96086 3.21071 2.46957 3 3 3H15C15.5304 3 16.0391 3.21071 16.4142 3.58579C16.7893 3.96086 17 4.46957 17 5V15M1 15C1 15.5304 1.21071 16.0391 1.58579 16.4142C1.96086 16.7893 2.46957 17 3 17H15C15.5304 17 16.0391 16.7893 16.4142 16.4142C16.7893 16.0391 17 15.5304 17 15M1 15V8.33333C1 7.8029 1.21071 7.29419 1.58579 6.91912C1.96086 6.54405 2.46957 6.33333 3 6.33333H15C15.5304 6.33333 16.0391 6.54405 16.4142 6.91912C16.7893 7.29419 17 7.8029 17 8.33333V15M9 9.66667H9.00711V9.67378H9V9.66667ZM9 11.6667H9.00711V11.6738H9V11.6667ZM9 13.6667H9.00711V13.6738H9V13.6667ZM7 11.6667H7.00711V11.6738H7V11.6667ZM7 13.6667H7.00711V13.6738H7V13.6667ZM5 11.6667H5.00711V11.6738H5V11.6667ZM5 13.6667H5.00711V13.6738H5V13.6667ZM11 9.66667H11.0071V9.67378H11V9.66667ZM11 11.6667H11.0071V11.6738H11V11.6667ZM11 13.6667H11.0071V13.6738H11V13.6667ZM13 9.66667H13.0071V9.67378H13V9.66667ZM13 11.6667H13.0071V11.6738H13V11.6667Z" | ||
stroke="#353241" | ||
stroke-width="0.75" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
<p><%- new Date(experience.roles[0].startDate).toLocaleDateString(undefined, { year:"numeric", month:"short"})%> <%_ if(experience.roles[0].finishDate && experience.roles[0].finishDate.toLowerCase() !=='actualidad') { -%> | ||
<%- "- "+new Date(experience.roles[0].finishDate).toLocaleDateString(undefined, { year:"numeric", month:"short"}) -%> | ||
<%_ } else { -%> | ||
- Actualidad | ||
<%_}-%> | ||
</p> | ||
</div> | ||
<div class="main__section__data"> | ||
<%_ if(experience.type) { -%> | ||
<p><%= experience.description %></p> | ||
<%_ } -%> | ||
<%_ if(experience.roles[0].challenges && experience.roles[0].challenges.length !== 0){ -%> | ||
<ul> | ||
<%_ for(const challenge of experience.roles[0].challenges){ -%> | ||
<li><%= challenge.description %></li> | ||
<%_ } -%> | ||
</ul> | ||
<%_ } -%> | ||
</div> | ||
<a href="<%= experience.URL %>" target="_blank"><%= experience.name %></a> | ||
<%_ if (experience.roles[0].competences && experience.roles[0].competence !== 0) { -%> | ||
<h3 class="tech__tools__heading">Tecnologías y Herramientas</h3> | ||
<ul class="ul__technologies"> | ||
<%_ for(const competence of experience.roles[0].competences) { -%> | ||
<li class="li__technologies"><%= competence.name %></li> | ||
<%_ } -%> | ||
</ul> | ||
<%_ } -%> | ||
</section> | ||
<%_}-%> | ||
</section> | ||
<%_}-%> |
22 changes: 22 additions & 0 deletions
22
...ml/src/engine/cv-x-wing-squadron/html-parts/experience-section/experience-section.part.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ExperienceVm, mapFromMacCvToExperienceSectionVm } from '@lemoncode/manfred-common/experience-section'; | ||
import { ManfredAwesomicCV, Settings, Language } from '@/model'; | ||
import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const'; | ||
import { getLabels } from './labels'; | ||
import ejs from 'ejs'; | ||
import experienceTemplate from './experience-section.ejs?raw'; | ||
|
||
export const generateExperienceSection = (cv: ManfredAwesomicCV, settings: Settings): string => { | ||
const experienceSectionVm = mapFromMacCvToExperienceSectionVm(cv); | ||
return generateExperienceSectionInner(experienceSectionVm, settings.language); | ||
}; | ||
|
||
const generateExperienceSectionInner = ( | ||
experienceSectionVm: ExperienceVm[], | ||
language: Language = ISO_SPANISH_LANGUAGE | ||
): string => { | ||
const rootObject = { | ||
experienceCollection: experienceSectionVm, | ||
labels: getLabels(language), | ||
}; | ||
return ejs.render(experienceTemplate, rootObject); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './experience-section.part'; |
5 changes: 5 additions & 0 deletions
5
...v-x-wing-squadron/html-parts/experience-section/labels/experience-english-labels.const.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ExperienceLabels } from './experience-label.model'; | ||
|
||
export const englishExperienceLabels: ExperienceLabels = { | ||
EXPERIENCE_CAREER_HEADING: 'Experience / Career', | ||
}; |
3 changes: 3 additions & 0 deletions
3
.../engine/cv-x-wing-squadron/html-parts/experience-section/labels/experience-label.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface ExperienceLabels { | ||
EXPERIENCE_CAREER_HEADING: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
...v-x-wing-squadron/html-parts/experience-section/labels/experience-spanish-labels.const.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ExperienceLabels } from './experience-label.model'; | ||
|
||
export const spanishExperienceLabels: ExperienceLabels = { | ||
EXPERIENCE_CAREER_HEADING: 'Experiencia / Carrera', | ||
}; |
15 changes: 15 additions & 0 deletions
15
.../manfred2html/src/engine/cv-x-wing-squadron/html-parts/experience-section/labels/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Language } from '@/model'; | ||
import { ExperienceLabels } from './experience-label.model'; | ||
import { spanishExperienceLabels } from './experience-spanish-labels.const'; | ||
import { englishExperienceLabels } from './experience-english-labels.const'; | ||
|
||
export const getLabels = (language: Language): ExperienceLabels => { | ||
switch (language) { | ||
case 'es': | ||
return spanishExperienceLabels; | ||
case 'en': | ||
return englishExperienceLabels; | ||
default: | ||
throw new Error(`Language not supported: ${language}`); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters