{# Single source of truth for the Settings in-page floating side menu. Used by settings.html (mode="tabs" -> client-side switchTab) and by encoding.html (mode="links" -> navigates back to the Settings tabs, with "Encoding" as the active entry). "Encoding" is always a real link to its own /encoding route (E2), inserted right after "General". is_admin gates the admin-only entries, matching settings.html's original gating. #} {% macro settings_menu(mode='tabs', active='overview', is_admin=True) %}
{%- set rows = [ ('overview', _('Overview'), false), ('general', _('General'), false), ('startpage', _('Start Page'), false), ('library', _('Library and Statistics'), false), ('design', _('Design'), false), ('sources', _('Sources'), true), ('downloads', _('Downloads'), false), ('autosync', 'Auto-Sync', false), ('network', _('Network & Access'), false), ('auth', _('Authentication'), true), ('api', 'API', true), ('privacy', _('Privacy & Telemetry'), true), ('backup', _('Backup'), true), ('updates', _('Updates'), false) ] -%} {%- for id, label, admin_only in rows %} {%- if not admin_only or is_admin %} {%- if mode == 'tabs' %} {%- else %} {{ label }} {%- endif %} {%- endif %} {%- if id == 'general' and is_admin %} {%- if mode == 'tabs' %} {%- else %} {{ _('Encoding') }} {%- endif %} {%- endif %} {%- endfor %}
{% endmacro %}