-
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
…nce-section-to-ejs Feature/#210 implement experience section to ejs
- Loading branch information
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...s/manfred2html/src/engine/template-b/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,65 @@ | ||
<%_ if(experienceCollection && experienceCollection.length !== 0){ -%> | ||
<section class="main__section"> | ||
<div class="main__section__header"> | ||
<h2>Experiencia</h2> | ||
<hr class="divider" /> | ||
</div> | ||
<%_ for(const experience of experienceCollection){ -%> | ||
<div class="main__section__item"> | ||
<div class="dot-icon"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="8" | ||
height="8" | ||
viewBox="0 0 8 8" | ||
fill="none" | ||
> | ||
<circle opacity="0.33" cx="4" cy="4" r="4" fill="#247A7E" /> | ||
</svg> | ||
</div> | ||
<div class="section__content"> | ||
<h3><%- experience.name %></h3> | ||
<%_ if(experience.type) { -%> | ||
<h4><%- experience.description %></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="#0D1418" | ||
stroke-width="0.75" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
<p class="date"><%- 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> | ||
<%_ if(experience.type) { -%> | ||
<p class="section__content__data">Tipo de organización: <b><%- experience.type %></b></p> | ||
<%_ } -%> | ||
<p class="section__content__data">Roles dentro de la empresa: <b><%- experience.roles[0].name %></b></p> | ||
<%_ if(experience.roles[0].challenges && experience.roles[0].challenges.length !== 0) { -%> | ||
<p class="section__content__data">Retos:</p> | ||
<ul class="section__content__data section__content__data__ul"> | ||
<%_ for(const challenge of experience.roles[0].challenges){ -%> | ||
<li><%- challenge.description %></li> | ||
<%_ }-%> | ||
</ul> | ||
<%_ }-%> | ||
</div> | ||
</div> | ||
<%_ }-%> | ||
</section> | ||
<%_ }-%> |
18 changes: 18 additions & 0 deletions
18
...nfred2html/src/engine/template-b/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,18 @@ | ||
import ejs from 'ejs'; | ||
import { ExperienceVm, mapFromMacCvToExperienceSectionVm } from '@lemoncode/manfred-common/experience-section'; | ||
import { ManfredAwesomicCV } from '@/model'; | ||
import experienceTemplate from './experience-section.ejs?raw'; | ||
|
||
export const generateExperiencesSection = (cv: ManfredAwesomicCV): string => { | ||
const experienceSectionVm = mapFromMacCvToExperienceSectionVm(cv); | ||
|
||
return generateExperienceSectionInner(experienceSectionVm); | ||
}; | ||
|
||
const generateExperienceSectionInner = (experienceSectionVm: ExperienceVm[]): string => { | ||
const rootObject = { | ||
experienceCollection: experienceSectionVm, | ||
}; | ||
|
||
return ejs.render(experienceTemplate, rootObject); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/manfred2html/src/engine/template-b/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'; |
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