Files
cv-site/templates/language-switch.html
T
juanatsap 9636b3659f refactor: Extract all hardcoded content to JSON files
- Move all bilingual text from templates to UI JSON (labels, buttons, modals)
- Move skills summary paragraph to CV JSON with HTML support
- Add new UI sections: navigation, viewControls, sections, footer, portfolio,
  pdfModal, shortcutsModal, infoModal, widgets
- Update Go structs to match expanded JSON structure
- Add template.HTML type for CV.SkillsSummary field
- Add JSON content validation test (70-json-content-validation.test.mjs)

Templates now contain only structural logic (CSS classes, HTML attributes)
while all user-visible text loads from JSON files for proper i18n support.
2025-11-30 10:13:37 +00:00

115 lines
4.5 KiB
HTML

<!-- Primary response: Updated language selector -->
<div class="language-selector" id="language-selector">
<button class="selector-btn {{if eq .Lang "en"}}active{{end}}"
data-short="EN"
hx-get="/switch-language?lang=en"
hx-target="#language-selector"
hx-swap="outerHTML swap:250ms settle:250ms"
hx-indicator="#lang-indicator-en"
hx-push-url="/?lang=en"
aria-label="English">
<span>English</span>
</button>
<button class="selector-btn {{if eq .Lang "es"}}active{{end}}"
data-short="ES"
hx-get="/switch-language?lang=es"
hx-target="#language-selector"
hx-swap="outerHTML swap:250ms settle:250ms"
hx-indicator="#lang-indicator-es"
hx-push-url="/?lang=es"
aria-label="Español">
<span>Español</span>
</button>
</div>
<!-- Out-of-band swap: Page 1 content wrapper with fade transition -->
<div id="cv-inner-content-page-1"
class="cv-page-content-wrapper"
hx-swap-oob="outerHTML"
_="on htmx:afterSettle wait 100ms then remove .loading from me">
{{template "title-badges" .}}
<!-- Page 1 Content Grid: Left Sidebar + Main Content -->
<div class="page-content">
<!-- Left Sidebar - Skills (first half) -->
<aside class="cv-sidebar cv-sidebar-left">
<details class="sidebar-accordion">
<summary class="sidebar-accordion-header">
<iconify-icon icon="mdi:brain" width="20" height="20"></iconify-icon>
<span>{{.UI.Sections.TechnicalSkills}}</span>
<iconify-icon icon="mdi:chevron-down" width="20" height="20" class="chevron"></iconify-icon>
</summary>
<div class="sidebar-accordion-content">
{{range .SkillsLeft}}
<section class="sidebar-section">
<details open>
<summary>
<h3 class="sidebar-title">{{.Category}}</h3>
</summary>
<div class="sidebar-content">
{{range .Items}}<div class="skill-item">{{.}}</div>{{end}}
</div>
</details>
</section>
{{end}}
</div>
</details>
</aside>
<!-- Main Content Area - Page 1 -->
<main class="cv-main">
{{template "section-header" .}}
{{template "section-education" .}}
{{template "section-skills-summary" .}}
{{template "section-experience" .}}
</main>
</div>
</div>
<!-- Out-of-band swap: Page 2 content wrapper with fade transition -->
<div id="cv-inner-content-page-2"
class="cv-page-content-wrapper"
hx-swap-oob="outerHTML"
_="on htmx:afterSettle wait 100ms then remove .loading from me">
{{template "title-badges" .}}
<!-- Page 2 Content Grid: Main Content + Right Sidebar -->
<div class="page-content">
<!-- Main Content Area - Page 2 -->
<main class="cv-main">
{{template "section-awards" .}}
{{template "section-projects" .}}
{{template "section-courses" .}}
{{template "section-languages" .}}
{{template "section-references" .}}
{{template "section-other" .}}
</main>
<!-- Right Sidebar - Skills (second half) -->
<aside class="cv-sidebar cv-sidebar-right">
<details class="sidebar-accordion">
<summary class="sidebar-accordion-header">
<iconify-icon icon="mdi:brain" width="20" height="20"></iconify-icon>
<span>{{.UI.Sections.MoreSkills}}</span>
<iconify-icon icon="mdi:chevron-down" width="20" height="20" class="chevron"></iconify-icon>
</summary>
<div class="sidebar-accordion-content">
{{range .SkillsRight}}
<section class="sidebar-section">
<details open>
<summary>
<h3 class="sidebar-title">{{.Category}}</h3>
</summary>
<div class="sidebar-content">
{{range .Items}}<div class="skill-item">{{.}}</div>{{end}}
</div>
</details>
</section>
{{end}}
</div>
</details>
</aside>
</div>
{{template "cv-footer" .}}
</div>