Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#208 implement soft skills section to ejs #222

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from './header-section';
export * from './relevants-links-section';
export * from './language-section';
export * from './hard-skills-section';
export * from './soft-skills-section';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './soft-skills-section.part';
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<%_ if (softSkillsCollection && softSkillsCollection.length !== 0) { -%>
<div class="aside__section">
<h3>Habilidades interpersonales</h3>
<ul class="aside__section__list-items">
<%_ for (const item of softSkillsCollection) { -%>
<li><%- item.skill.name %></li>
<%_ } -%>
</ul>
</div>
<%_ } -%>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import ejs from 'ejs';
import { ManfredAwesomicCV } from '@/model';
import { SoftSkillVM, mapFromCvToSoftSkillVm } from '@lemoncode/manfred-common/soft-skill-section';
import softSkillsSection from './soft-skills-section.ejs?raw';

export const generateSoftSkillsSection = (cv: ManfredAwesomicCV): string => {
const softSkillsSectionVm = mapFromCvToSoftSkillVm(cv);
return generateSoftSkillsSectionInner(softSkillsSectionVm);
};

const generateSoftSkillsSectionInner = (softSkillsSectionVm: SoftSkillVM[]): string => {
const rootObject = {
softSkillsCollection: softSkillsSectionVm,
};
return ejs.render(softSkillsSection, rootObject);
};
3 changes: 3 additions & 0 deletions packages/manfred2html/src/engine/template-b/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
generateRelevantsLinksSection,
generateLanguageSection,
generateHardSkillsSection,
generateSoftSkillsSection,
} from './html-parts';

export const exportManfredJSonToHTMLTemplateB = (manfredJsonContent: ManfredAwesomicCV, theme?: string): string => {
Expand All @@ -23,6 +24,7 @@ export const exportManfredJSonToHTMLTemplateB = (manfredJsonContent: ManfredAwes
const headerSection = generateHeaderSection(manfredJsonContent);
const relevantsLinksSection = generateRelevantsLinksSection(manfredJsonContent);
const hardSkillsSection = generateHardSkillsSection(manfredJsonContent);
const softSkillsSection = generateSoftSkillsSection(manfredJsonContent);
const languageSection = generateLanguageSection(manfredJsonContent);
const asideElementStart = generateAsideElementStart();
const asideElementEnd = generateAsideElementEnd();
Expand All @@ -38,6 +40,7 @@ export const exportManfredJSonToHTMLTemplateB = (manfredJsonContent: ManfredAwes
${relevantsLinksSection}
${languageSection}
${hardSkillsSection}
${softSkillsSection}
${asideElementEnd}
${mainElementStart}
${mainElementEnd}
Expand Down
Loading