Skip to content

Commit

Permalink
Merge branch 'epic/cv-x-wing-squadron' into feature/#261-CV-X-Wing-Sq…
Browse files Browse the repository at this point in the history
…uadron-Create-languages-section
  • Loading branch information
MTeresaMB committed Dec 15, 2023
2 parents 28f409f + 071a19a commit 919dc59
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,5 @@ describe('Testing profile-section.mapper.ts', () => {
});
});
});

export {};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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>Sobre mi</h2>
<h2><%- labels.ABOUT_ME_HEADING %></h2>
</div>
<p><%= profile?.description %></p>
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import ejs from 'ejs';
import { ProfileSectionVm, mapFromMacCvToProfileSectionVm } from '@lemoncode/manfred-common/profile-section';
import { ManfredAwesomicCV } from '@/model';
import { ManfredAwesomicCV, Language, Settings } from '@/model';
import { ISO_SPANISH_LANGUAGE } from '@/engine/engine.const';
import { getLabels } from './labels';
import aboutMeSection from './about-me-section.ejs?raw';

export const generateAboutMeSection = (cv: ManfredAwesomicCV): string => {
export const generateAboutMeSection = (cv: ManfredAwesomicCV, settings: Settings): string => {
const profileSectionVm = mapFromMacCvToProfileSectionVm(cv);
return generateAboutMeSectionInner(profileSectionVm);
return generateAboutMeSectionInner(profileSectionVm, settings.language);
};

const generateAboutMeSectionInner = (profileSectionVm: ProfileSectionVm): string => {
const generateAboutMeSectionInner = (
profileSectionVm: ProfileSectionVm,
language: Language = ISO_SPANISH_LANGUAGE
): string => {
const rootObject = {
profile: profileSectionVm,
labels: getLabels(language),
};

return ejs.render(aboutMeSection, rootObject);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { AboutMeLabels } from './about-me-labels.model';

export const englishAboutMeLabels: AboutMeLabels = {
ABOUT_ME_HEADING: 'About me',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface AboutMeLabels {
ABOUT_ME_HEADING: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { AboutMeLabels } from './about-me-labels.model';

export const spanishAboutMeLabels: AboutMeLabels = {
ABOUT_ME_HEADING: 'Sobre mí',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Language } from '@/model';
import { AboutMeLabels } from './about-me-labels.model';
import { spanishAboutMeLabels } from './about-me-spanish-labels.const';
import { englishAboutMeLabels } from './about-me-english-labels.const';

export const getLabels = (language: Language): AboutMeLabels => {
switch (language) {
case 'es':
return spanishAboutMeLabels;
case 'en':
return englishAboutMeLabels;
default:
throw new Error(`Language not supported: ${language}`);
}
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%_ if (profile && profile !== 'undefined') { -%>
<%_ if (profile.avatar && profile.avatar.link) { -%>
<%_ if (profile.avatar) { -%>
<img src="<%= profile?.avatar%>" alt="photo cv">
<%_ } -%>
<section class="header__content">
Expand All @@ -11,7 +11,7 @@
<h2 class="surname"><%= profile?.surnames %></h2>
<p class="job-title"><%= profile?.title %></p>
</div>
<%_ if (profile.regionLocation && profile.countryLocation && profile.regionLocation !== 'undefined' && profile.countryLocation !== 'undefined') { -%>
<%_ if (profile.regionLocation) { -%>
<div class="header__content__address">
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="24" viewBox="0 0 18 24" fill="none">
<g clip-path="url(#clip0_1762_1661)">
Expand All @@ -29,86 +29,6 @@
<p><%= profile?.regionLocation %>, <%= profile?.countryLocation %></p>
</div>
<%_ } -%>
<%_ if (profile.relevantLinks && profile.relevantLinks.length !== 0) { -%>
<div class="header__content__links">
<%_ for (const link of profile?.relevantLinks) { -%>
<%_ if (link.type === 'linkedin') { -%>
<div class="aside__section__item">
<a href=<%= link.URL %> target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_1745_1632)">
<path
d="M20.447 20.452H16.893V14.883C16.893 13.555 16.866 11.846 15.041 11.846C13.188 11.846 12.905 13.291 12.905 14.785V20.452H9.351V9H12.765V10.561H12.811C13.288 9.661 14.448 8.711 16.181 8.711C19.782 8.711 20.448 11.081 20.448 14.166V20.452H20.447ZM5.337 7.433C5.06588 7.43313 4.79739 7.37979 4.54691 7.27604C4.29642 7.17229 4.06886 7.02015 3.87724 6.82835C3.68562 6.63654 3.5337 6.40883 3.43019 6.15825C3.32668 5.90766 3.27361 5.63912 3.274 5.368C3.2742 4.95978 3.39544 4.56078 3.6224 4.22147C3.84936 3.88216 4.17184 3.61777 4.54907 3.46173C4.92629 3.30569 5.34131 3.26502 5.74165 3.34485C6.14198 3.42469 6.50966 3.62144 6.79817 3.91024C7.08669 4.19903 7.28309 4.5669 7.36254 4.96731C7.44198 5.36773 7.40091 5.78271 7.2445 6.15978C7.0881 6.53685 6.8234 6.85908 6.48387 7.08571C6.14433 7.31234 5.74522 7.4332 5.337 7.433ZM7.119 20.452H3.555V9H7.119V20.452ZM22.225 0H1.771C0.792 0 0 0.774 0 1.729V22.271C0 23.227 0.792 24 1.771 24H22.222C23.2 24 24 23.227 24 22.271V1.729C24 0.774 23.2 0 22.222 0H22.225Z"
fill="#3BA0B7"
/>
</g>
<defs>
<clipPath id="clip0_1745_1632">
<rect width="24" height="24" fill="white" />
</clipPath>
</defs>
</svg>
</a>
</div>
<%_ } -%>
<%_ if (link.type === 'github') { -%>
<div class="aside__section__item">
<a href=<%= link.URL %> target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_1745_1636)">
<path
d="M12 0.296875C5.37 0.296875 0 5.66988 0 12.2969C0 17.5999 3.438 22.0969 8.205 23.6819C8.805 23.7949 9.025 23.4239 9.025 23.1049C9.025 22.8199 9.015 22.0649 9.01 21.0649C5.672 21.7889 4.968 19.4549 4.968 19.4549C4.422 18.0699 3.633 17.6999 3.633 17.6999C2.546 16.9559 3.717 16.9709 3.717 16.9709C4.922 17.0549 5.555 18.2069 5.555 18.2069C6.625 20.0419 8.364 19.5119 9.05 19.2049C9.158 18.4289 9.467 17.8999 9.81 17.5999C7.145 17.2999 4.344 16.2679 4.344 11.6699C4.344 10.3599 4.809 9.28988 5.579 8.44988C5.444 8.14688 5.039 6.92688 5.684 5.27388C5.684 5.27388 6.689 4.95188 8.984 6.50388C9.944 6.23688 10.964 6.10488 11.984 6.09888C13.004 6.10488 14.024 6.23688 14.984 6.50388C17.264 4.95188 18.269 5.27388 18.269 5.27388C18.914 6.92688 18.509 8.14688 18.389 8.44988C19.154 9.28988 19.619 10.3599 19.619 11.6699C19.619 16.2799 16.814 17.2949 14.144 17.5899C14.564 17.9499 14.954 18.6859 14.954 19.8099C14.954 21.4159 14.939 22.7059 14.939 23.0959C14.939 23.4109 15.149 23.7859 15.764 23.6659C20.565 22.0919 24 17.5919 24 12.2969C24 5.66988 18.627 0.296875 12 0.296875Z"
fill="#3BA0B7"
/>
</g>
<defs>
<clipPath id="clip0_1745_1636">
<rect width="24" height="24" fill="white" />
</clipPath>
</defs>
</svg>
</a>
</div>
<%_ } %>
<%_ if (link.type === 'twitter') { -%>
<div class="aside__section__item">
<a href=<%= link.URL %> target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<path
d="M0.048762 0.640625L7.77054 10.9654L0 19.3598H1.74884L8.55193 12.0104L14.0486 19.3598H20L11.8438 8.45433L19.0765 0.640625H17.3277L11.0624 7.40935L6.00012 0.640625H0.048762ZM2.62056 1.92882H5.35462L17.4278 18.0714H14.6937L2.62056 1.92882Z"
fill="#3BA0B7"
/>
</svg>
</a>
</div>
<%_ } %>
<%_ if (link.type === 'web') { -%>
<div class="aside__section__item">
<a href=<%= link.URL %> target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="20" viewBox="0 0 24 20" fill="none">
<path
d="M21.742 10.4387C23.8608 8.31996 23.8608 4.88871 21.742 2.76996C19.867 0.89496 16.912 0.65121 14.7558 2.19246L14.6958 2.23371C14.1558 2.61996 14.032 3.36996 14.4183 3.90621C14.8045 4.44246 15.5545 4.56996 16.0908 4.18371L16.1508 4.14246C17.3545 3.28371 19.0008 3.41871 20.0433 4.46496C21.2245 5.64621 21.2245 7.55871 20.0433 8.73996L15.8358 12.955C14.6545 14.1362 12.742 14.1362 11.5608 12.955C10.5145 11.9087 10.3795 10.2625 11.2383 9.06246L11.2795 9.00246C11.6658 8.46246 11.5383 7.71246 11.002 7.32996C10.4658 6.94746 9.71203 7.07121 9.32953 7.60746L9.28828 7.66746C7.74328 9.81996 7.98703 12.775 9.86203 14.65C11.9808 16.7687 15.412 16.7687 17.5308 14.65L21.742 10.4387ZM2.25703 9.56121C0.138281 11.68 0.138281 15.1112 2.25703 17.23C4.13203 19.105 7.08703 19.3487 9.24328 17.8075L9.30328 17.7662C9.84328 17.38 9.96703 16.63 9.58078 16.0937C9.19453 15.5575 8.44453 15.43 7.90828 15.8162L7.84828 15.8575C6.64453 16.7162 4.99828 16.5812 3.95578 15.535C2.77453 14.35 2.77453 12.4375 3.95578 11.2562L8.16328 7.04496C9.34453 5.86371 11.257 5.86371 12.4383 7.04496C13.4845 8.09121 13.6195 9.73746 12.7608 10.9412L12.7195 11.0012C12.3333 11.5412 12.4608 12.2912 12.997 12.6737C13.5333 13.0562 14.287 12.9325 14.6695 12.3962L14.7108 12.3362C16.2558 10.18 16.012 7.22496 14.137 5.34996C12.0183 3.23121 8.58703 3.23121 6.46828 5.34996L2.25703 9.56121Z"
fill="#3BA0B7"
/>
</svg>
</a>
</div>
<%_ } %>
<%_ if (link.type === 'otros') { -%>
<div class="aside__section__item">
<a href=<%= link.URL %> target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="20" viewBox="0 0 24 20" fill="none">
<path
d="M21.742 10.4387C23.8608 8.31996 23.8608 4.88871 21.742 2.76996C19.867 0.89496 16.912 0.65121 14.7558 2.19246L14.6958 2.23371C14.1558 2.61996 14.032 3.36996 14.4183 3.90621C14.8045 4.44246 15.5545 4.56996 16.0908 4.18371L16.1508 4.14246C17.3545 3.28371 19.0008 3.41871 20.0433 4.46496C21.2245 5.64621 21.2245 7.55871 20.0433 8.73996L15.8358 12.955C14.6545 14.1362 12.742 14.1362 11.5608 12.955C10.5145 11.9087 10.3795 10.2625 11.2383 9.06246L11.2795 9.00246C11.6658 8.46246 11.5383 7.71246 11.002 7.32996C10.4658 6.94746 9.71203 7.07121 9.32953 7.60746L9.28828 7.66746C7.74328 9.81996 7.98703 12.775 9.86203 14.65C11.9808 16.7687 15.412 16.7687 17.5308 14.65L21.742 10.4387ZM2.25703 9.56121C0.138281 11.68 0.138281 15.1112 2.25703 17.23C4.13203 19.105 7.08703 19.3487 9.24328 17.8075L9.30328 17.7662C9.84328 17.38 9.96703 16.63 9.58078 16.0937C9.19453 15.5575 8.44453 15.43 7.90828 15.8162L7.84828 15.8575C6.64453 16.7162 4.99828 16.5812 3.95578 15.535C2.77453 14.35 2.77453 12.4375 3.95578 11.2562L8.16328 7.04496C9.34453 5.86371 11.257 5.86371 12.4383 7.04496C13.4845 8.09121 13.6195 9.73746 12.7608 10.9412L12.7195 11.0012C12.3333 11.5412 12.4608 12.2912 12.997 12.6737C13.5333 13.0562 14.287 12.9325 14.6695 12.3962L14.7108 12.3362C16.2558 10.18 16.012 7.22496 14.137 5.34996C12.0183 3.23121 8.58703 3.23121 6.46828 5.34996L2.25703 9.56121Z"
fill="#3BA0B7"
/>
</svg>
</a>
</div>
<%_ } %>
<%_ } %>
<%_ } %>
</div>
</section>
<%_ } -%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const exportManfredJsonToCVXWingHTML = (manfredJsonContent: ManfredAwesom
const headerElementEnd = generateHeaderElementEnd();
const headerSection = generateHeaderSection(manfredJsonContent);
const mainElementStart = generateMainElementStart();
const aboutMeSection = generateAboutMeSection(manfredJsonContent);
const aboutMeSection = generateAboutMeSection(manfredJsonContent, settings);
const mainElementEnd = generateMainElementEnd();
const languageSection = generateLanguageSection(manfredJsonContent, settings);
return `
Expand Down

0 comments on commit 919dc59

Please sign in to comment.