-
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
…ce-Create-hard-skills-section Closed #272
- Loading branch information
Showing
10 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
...tml/src/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-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,10 @@ | ||
<%_ if (hardSkillsCollection && hardSkillsCollection.length !== 0) { -%> | ||
<section class="section hard-skills"> | ||
<h2 class="title"><%- labels.HARD_SKILLS_HEADING %></h2> | ||
<ul class="hard-skills__list"> | ||
<%_ for (const item of hardSkillsCollection) { -%> | ||
<li class="chip chip-primary"><%- item.skill.name %></li> | ||
<%_ } -%> | ||
</ul> | ||
</section> | ||
<%_ } -%> |
22 changes: 22 additions & 0 deletions
22
...rc/engine/cv-monochrome-force/html-parts/hard-skills-section/hard-skills-section.parts.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 ejs from 'ejs'; | ||
import { HardSkillVM, mapFromCvToHardSkillVm } from '@lemoncode/manfred-common/hard-skill-section'; | ||
import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const'; | ||
import { Settings, Language, ManfredAwesomicCV } from '@/model'; | ||
import { getLabels } from './labels'; | ||
import hardSkillsSection from './hard-skills-section.ejs?raw'; | ||
|
||
export const generateHardSkillsSection = (cv: ManfredAwesomicCV, settings: Settings): string => { | ||
const hardSkillsSectionVm = mapFromCvToHardSkillVm(cv); | ||
return generateHardSkillsSectionInner(hardSkillsSectionVm, settings.language); | ||
}; | ||
|
||
const generateHardSkillsSectionInner = ( | ||
hardSkillsSectionVm: HardSkillVM[], | ||
language: Language = ISO_SPANISH_LANGUAGE | ||
): string => { | ||
const rootObject = { | ||
hardSkillsCollection: hardSkillsSectionVm, | ||
labels: getLabels(language), | ||
}; | ||
return ejs.render(hardSkillsSection, rootObject); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/manfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-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 './hard-skills-section.parts'; |
5 changes: 5 additions & 0 deletions
5
...onochrome-force/html-parts/hard-skills-section/labels/hard-skills-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 { HardSkillsLabels } from './hard-skills-label.model'; | ||
|
||
export const englishHardSkillsLabels: HardSkillsLabels = { | ||
HARD_SKILLS_HEADING: 'Hard Skills', | ||
}; |
3 changes: 3 additions & 0 deletions
3
...gine/cv-monochrome-force/html-parts/hard-skills-section/labels/hard-skills-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 HardSkillsLabels { | ||
HARD_SKILLS_HEADING: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
...onochrome-force/html-parts/hard-skills-section/labels/hard-skills-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 { HardSkillsLabels } from './hard-skills-label.model'; | ||
|
||
export const spanishHardSkillsLabels: HardSkillsLabels = { | ||
HARD_SKILLS_HEADING: 'Competencias', | ||
}; |
15 changes: 15 additions & 0 deletions
15
...anfred2html/src/engine/cv-monochrome-force/html-parts/hard-skills-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 { HardSkillsLabels } from './hard-skills-label.model'; | ||
import { spanishHardSkillsLabels } from './hard-skills-spanish-labels.const'; | ||
import { englishHardSkillsLabels } from './hard-skills-english-labels.const'; | ||
|
||
export const getLabels = (language: Language): HardSkillsLabels => { | ||
switch (language) { | ||
case 'es': | ||
return spanishHardSkillsLabels; | ||
case 'en': | ||
return englishHardSkillsLabels; | ||
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
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