Files
cv-site/templates/partials/navigation/view-controls.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

71 lines
3.2 KiB
HTML

{{define "view-controls"}}
<!-- Center: View controls with labels -->
<div class="view-controls-center">
<!-- CV Length toggle -->
<div class="selector-group" id="desktop-length-toggle">
<label class="selector-label">{{.UI.ViewControls.Length}}:</label>
<label class="icon-toggle">
<input type="checkbox"
id="lengthToggle"
{{if eq .CVLengthClass "cv-long"}}checked{{end}}
hx-post="/toggle/length?lang={{.Lang}}"
hx-swap="none"
_="on change call toggleCVLength(my.checked)">
<span class="icon-toggle-slider">
<iconify-icon icon="mdi:file-document-outline" width="16" height="16" class="icon-left"></iconify-icon>
<iconify-icon icon="mdi:file-document-multiple-outline" width="16" height="16" class="icon-right"></iconify-icon>
</span>
</label>
<iconify-icon icon="mdi:loading"
class="htmx-indicator spinning small light"
width="14"
height="14"
aria-label="Saving"></iconify-icon>
</div>
<!-- Icon toggle -->
<div class="selector-group" id="desktop-icon-toggle">
<label class="selector-label">{{.UI.ViewControls.Icons}}:</label>
<label class="icon-toggle">
<input type="checkbox"
id="iconToggle"
{{if .ShowIcons}}checked{{end}}
hx-post="/toggle/icons?lang={{.Lang}}"
hx-swap="none"
_="on change call toggleIcons(my.checked)">
<span class="icon-toggle-slider">
<iconify-icon icon="mdi:image-off-outline" width="16" height="16" class="icon-left"></iconify-icon>
<iconify-icon icon="mdi:image-multiple-outline" width="16" height="16" class="icon-right"></iconify-icon>
</span>
</label>
<iconify-icon icon="mdi:loading"
class="htmx-indicator spinning small light"
width="14"
height="14"
aria-label="Saving"></iconify-icon>
</div>
<!-- Theme toggle -->
<div class="selector-group" id="desktop-theme-toggle">
<label class="selector-label">{{.UI.ViewControls.View}}:</label>
<label class="icon-toggle">
<input type="checkbox"
id="themeToggle"
{{if .ThemeClean}}checked{{end}}
hx-post="/toggle/theme?lang={{.Lang}}"
hx-swap="none"
_="on change call toggleTheme(my.checked)">
<span class="icon-toggle-slider">
<iconify-icon icon="mdi:page-layout-sidebar-left" width="16" height="16" class="icon-left"></iconify-icon>
<iconify-icon icon="mdi:page-layout-body" width="16" height="16" class="icon-right"></iconify-icon>
</span>
</label>
<iconify-icon icon="mdi:loading"
class="htmx-indicator spinning small light"
width="14"
height="14"
aria-label="Saving"></iconify-icon>
</div>
</div>
{{end}}